Skip to content

Commit

Permalink
Refine the documentation navigation #8
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Druez <tdruez@nexb.com>
  • Loading branch information
tdruez committed Sep 21, 2020
1 parent e109395 commit 28dbe04
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 39 deletions.
18 changes: 14 additions & 4 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Pre-requisite
* **PostgreSQL** 10 or later: https://www.postgresql.org/ (or https://postgresapp.com/ on macOS)
* Recent version of **git**: https://git-scm.com/

Development setup
-----------------
Local installation
------------------

Clone the git `ScanCode.io repo <https://github.com/nexB/scancode.io>`_,
install dependencies, and prepare the database::
Expand All @@ -29,7 +29,17 @@ Validate the installation by running the tests suite::

make test

Next Step
----

You are now ready to move onto the **Tutorials**: :ref:`scanpipe_tutorial_1`.

Upgrading
---------

You are now ready to move onto the tutorial: :ref:`scanpipe_tutorial_1`.
If you have already a clone of the ScanCode.io repo, you can upgrade to the
latest version with::

cd scancode.io
git pull
make dev
make migrate
6 changes: 0 additions & 6 deletions docs/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,5 @@ The first set of available pipelines helps automate the analysis of Docker
comprehensive software stacks from an operating system with its kernel through
system and application packages to original and custom applications.


Next step
---------

Install ScanCode.io :ref:`installation`.

.. Some of this documentation is borrowed from the metaflow documentation and is also under Apache-2.0
.. Copyright (c) Netflix
5 changes: 0 additions & 5 deletions docs/scanpipe-concepts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,3 @@ Some of the ``DiscoveredPackage`` interesting attributes are:
.. note::
In general the attributes and their names are the same that are used in
`ScanCode-toolkit <https://github.com/nexB/scancode-toolkit>`_ for packages.

Next step
---------

Explore :ref:`scanpipe_command_line`.
47 changes: 23 additions & 24 deletions docs/scanpipe-tutorial-1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,23 @@ Before you start
----------------

- Download the following test Docker image and save this in your home directory:

https://github.com/nexB/scancode.io-tutorial/releases/download/sample-images/30-alpine-nickolashkraus-staticbox-latest.tar
https://github.com/nexB/scancode.io-tutorial/releases/download/sample-images/30-alpine-nickolashkraus-staticbox-latest.tar


Step-by-step
------------

- Open a shell in the ScanCode.io installation directory.
- Activate the virtualenv::
- Open a shell in the ScanCode.io installation directory and activate the virtualenv::

$ source bin/activate

- Create a new project named ``p1``::
- Create a new project named ``staticbox``::

$ scanpipe create-project p1
$ scanpipe create-project staticbox

- Add the test Docker image tarball to the project workspace's input directory::
- Add the test Docker image tarball to the project workspace's :guilabel:`input/` directory::

$ scanpipe add-input --project p1 ~/30-alpine-nickolashkraus-staticbox-latest.tar
$ scanpipe add-input --project staticbox ~/30-alpine-nickolashkraus-staticbox-latest.tar

.. note::
The command output will let you know where is the project workspace :guilabel:`input/` directory
Expand All @@ -41,40 +39,41 @@ Step-by-step

- Add the docker pipeline to your project::

$ scanpipe add-pipeline --project p1 scanpipe/pipelines/docker.py
$ scanpipe add-pipeline --project staticbox scanpipe/pipelines/docker.py

- Check that the docker pipeline was added to your project::

$ scanpipe show-pipeline --project p1
$ scanpipe show-pipeline --project staticbox

.. note::
The ``scanpipe show-pipeline`` command lists all the pipelines added to the project and their planned runs.
The ``scanpipe show-pipeline`` command lists all the pipelines added to the
project and their planned runs.
You can use this to get a quick overview of the pipelines that have been running already
(with their success "V" or fail status "f") and those that will be running next.

- Run the docker pipeline proper on this project::
- Run the docker pipeline on this project::

$ scanpipe run --project p1
$ scanpipe run --project staticbox

- Executing the ``show-pipeline`` command again will confirm the success of the pipeline run::
- Executing the ``show-pipeline`` command again will confirm the success of the
pipeline run::

$ scanpipe show-pipeline --project p1
$ scanpipe show-pipeline --project staticbox
"[V] scanpipe/pipelines/docker.py"

- Get the results of the pipeline run as a JSON file using the ``output`` command::

$ scanpipe output --project p1 results.json
$ scanpipe output --project staticbox results.json

- Open the ``results.json`` in your preferred viewer.

----

.. note::
The ``inputs`` and ``pipelines`` can be provided directly at once when
calling the ``create-project`` command. For example, this command will create a
project named ``p2``, copy our test docker image to the project's inputs,
and add the docker pipeline in one operation::
calling the ``create-project`` command.
For example, this command will create a project named ``p2``, copy our test
docker image to the project's inputs, and add the docker pipeline in one
operation::

$ scanpipe create-project p2 --input ~/30-alpine-nickolashkraus-staticbox-latest.tar --pipeline scanpipe/pipelines/docker.py

Next step
---------

Explore :ref:`scanpipe_concepts`.

0 comments on commit 28dbe04

Please sign in to comment.