Skip to content

Commit bc2b382

Browse files
authored
Add a QuickStart introduction chapter in the documentation (#1722)
Signed-off-by: tdruez <tdruez@nexb.com>
1 parent e4ba158 commit bc2b382

File tree

8 files changed

+200
-31
lines changed

8 files changed

+200
-31
lines changed

docs/faq.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,18 @@ you may use the Docker image to run pipelines as a single command:
2222
.. code-block:: bash
2323
2424
docker run --rm \
25-
-v "$(pwd)":/codedrop \
2625
ghcr.io/aboutcode-org/scancode.io:latest \
27-
sh -c "run scan_codebase /codedrop" \
26+
-v "$(pwd)":/codedrop \
27+
run scan_codebase /codedrop \
2828
> results.json
2929
3030
Refer to the :ref:`cli_run` section for more about this approach.
3131

32+
.. tip::
33+
Prefer a one-liner? Use this to scan your current directory::
34+
35+
curl -sSL https://raw.githubusercontent.com/aboutcode-org/scancode.io/main/etc/scripts/run-scan.sh | bash
36+
3237
.. _faq_which_pipeline:
3338

3439
Which pipeline should I use?

docs/index.rst

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
ScanCode.io documentation
1+
ScanCode.io Documentation
22
=========================
33

4-
Welcome to the very start of your ScanCode.io journey! In this documentation
5-
you’ll find information on:
4+
Welcome! This is your starting point for everything ScanCode.io.
65

7-
- An overview of ScanCode.io and ScanPipe
8-
- Installation instructions
9-
- Tutorials to get you started
10-
- Reference documentation about the ScanPipe concepts, Pipelines, Pipes and more
11-
- How to make technical contributions to the project and the community
6+
In this documentation, you’ll find:
7+
8+
- A **QuickStart guide** to run your first scan
9+
- An **overview** of what ScanCode.io is and what it can do
10+
- **Installation instructions** for full access
11+
- Step-by-step **tutorials** to dive deeper
12+
- In-depth **reference docs** on concepts, pipelines, configuration, and APIs
13+
- Guides on how to **contribute** to the project and community
1214

1315
.. toctree::
1416
:maxdepth: 2
1517
:caption: Getting Started
1618

19+
quickstart
1720
introduction
1821
installation
1922
user-interface
@@ -23,7 +26,7 @@ you’ll find information on:
2326

2427
.. toctree::
2528
:maxdepth: 2
26-
:caption: Tutorial
29+
:caption: Tutorials
2730

2831
tutorial_web_ui_analyze_docker_image
2932
tutorial_web_ui_review_scan_results
@@ -37,7 +40,7 @@ you’ll find information on:
3740

3841
.. toctree::
3942
:maxdepth: 2
40-
:caption: Reference Documentation
43+
:caption: Reference
4144

4245
scanpipe-concepts
4346
built-in-pipelines

docs/installation.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ And visit the web UI at: http://localhost/project/
221221

222222
.. _local_development_installation:
223223

224-
Local development installation
225-
------------------------------
224+
Local development
225+
-----------------
226226

227227
Supported Platforms
228228
^^^^^^^^^^^^^^^^^^^
@@ -247,7 +247,7 @@ Before you install ScanCode.io, make sure you have the following prerequisites:
247247

248248
* **Python: versions 3.10 to 3.13** found at https://www.python.org/downloads/
249249
* **Git**: most recent release available at https://git-scm.com/
250-
* **PostgreSQL**: release 11 or later found at https://www.postgresql.org/ or
250+
* **PostgreSQL**: release 13 or later found at https://www.postgresql.org/ or
251251
https://postgresapp.com/ on macOS
252252

253253
.. _system_dependencies:

docs/introduction.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,3 @@ images, containers, root filesystems, and virtual machine images.
105105
As a common practice, ScanCode.io releases usually follow ScanCode Toolkit releases
106106
to ensure the latest improvements of the scanning engines are included in the
107107
latest release of ScanCode.io.
108-
109-
110-
.. Some of this documentation is borrowed from the metaflow documentation and is also
111-
under Apache-2.0
112-
.. Copyright (c) Netflix

docs/quickstart.rst

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
.. _quickstart:
2+
3+
QuickStart
4+
==========
5+
6+
Run a Scan (no installation required!)
7+
--------------------------------------
8+
9+
The **fastest way** to get started and **scan a codebase** —
10+
**no installation needed** — is by using the latest
11+
**ScanCode.io Docker image**.
12+
13+
.. warning::
14+
**Docker must be installed on your system**.
15+
Visit the `Docker documentation <https://docs.docker.com/get-docker/>`_ to install
16+
it for your platform.
17+
18+
To run the :ref:`pipeline_scan_codebase` pipeline on a **local directory**
19+
with a **single command**:
20+
21+
.. code-block:: bash
22+
23+
docker run --rm \
24+
-v "$(pwd)":/codedrop \
25+
ghcr.io/aboutcode-org/scancode.io:latest \
26+
run scan_codebase /codedrop \
27+
> results.json
28+
29+
Let's unpack what each part of the command does:
30+
31+
- ``docker run --rm``
32+
Runs a temporary Docker container that is automatically removed after it finishes.
33+
34+
- ``-v "$(pwd)":/codedrop``
35+
Mounts your current directory into the container at ``/codedrop`` so it can be
36+
scanned.
37+
38+
- ``ghcr.io/aboutcode-org/scancode.io:latest``
39+
Uses the latest ScanCode.io image from GitHub Container Registry.
40+
41+
- ``run scan_codebase /codedrop``
42+
Runs the ``scan_codebase`` pipeline inside the container, using the mounted directory
43+
as the input source.
44+
45+
- ``> results.json``
46+
Saves the scan output to a ``results.json`` file on your machine.
47+
48+
The result? A **full scan of your local directory — no setup, one command!**
49+
50+
See the :ref:`RUN command <cli_run>` section for more details on this command.
51+
52+
.. note::
53+
Not sure which pipeline to use? Check out :ref:`faq_which_pipeline`.
54+
55+
Next Step: Local Installation
56+
-----------------------------
57+
58+
Install ScanCode.io, to **unlock all features**:
59+
60+
- **User Interface:** Explore dashboards, codebase data, charts, and scan results.
61+
See :ref:`user_interface`.
62+
- **Project Management:** Create, filter, and monitor projects.
63+
- **REST API:** Automate your scans with the :ref:`rest_api`.
64+
- **CLI:** Use the :ref:`command_line_interface` to work from the terminal.
65+
- **Webhooks:** Get real-time updates via custom integrations. See :ref:`webhooks`.
66+
- **Slack Notifications:** Send project updates to Slack. Follow setup in
67+
:ref:`webhooks_slack_notifications`.
68+
69+
See the :ref:`installation` chapter for the full list of installation options.
70+
71+
Integrate with Your Workflows
72+
-----------------------------
73+
74+
ScanCode.io can be part of your CI/CD workflow.
75+
76+
GitHub Actions
77+
^^^^^^^^^^^^^^
78+
79+
Use the official `scancode-action <https://github.com/aboutcode-org/scancode-action>`_
80+
to integrate **ScanCode.io into your GitHub workflows** with ease.
81+
82+
This action lets you:
83+
84+
- **Run pipelines**
85+
- **Check for compliance issues**
86+
- **Detect vulnerabilities**
87+
- **Generate SBOMs and scan results**
88+
89+
Example usage:
90+
91+
.. code-block:: yaml
92+
93+
runs-on: ubuntu-latest
94+
steps:
95+
- uses: actions/checkout@v4
96+
with:
97+
path: scancode-inputs
98+
- uses: aboutcode-org/scancode-action@main
99+
with:
100+
pipelines: "scan_codebase"
101+
output-formats: "json xlsx spdx cyclonedx"
102+
103+
Full details available at:
104+
https://github.com/aboutcode-org/scancode-action
105+
106+
.. tip::
107+
Learn more about automation options in the :ref:`automation` section.

etc/scripts/run-scan.sh

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/bin/bash
2+
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# http://nexb.com and https://github.com/aboutcode-org/scancode.io
6+
# The ScanCode.io software is licensed under the Apache License version 2.0.
7+
# Data generated with ScanCode.io is provided as-is without warranties.
8+
# ScanCode is a trademark of nexB Inc.
9+
10+
# Usage:
11+
# Default scan of current directory using 'scan_codebase':
12+
# ./run-scan.sh
13+
#
14+
# Run pipelines on current directory:
15+
# ./run-scan.sh scan_codebase find_vulnerabilities
16+
#
17+
# Run pipelines on a specific directory:
18+
# ./run-scan.sh scan_codebase /path/to/scan/dir
19+
#
20+
# Run multiple pipelines on a specific directory (directory must come last):
21+
# ./run-scan.sh scan_codebase find_vulnerabilities /my/codebase
22+
#
23+
# Scan a directory using default pipeline:
24+
# ./run-scan.sh /path/to/codebase
25+
26+
set -e
27+
28+
readonly SCIO_DOCKER_IMAGE="ghcr.io/aboutcode-org/scancode.io:latest"
29+
readonly RESULTS_LOCATION="results.json"
30+
31+
# Default values
32+
SCAN_DIR="$(pwd)"
33+
PIPELINES=()
34+
35+
# Check if last argument is a directory
36+
LAST_ARG="${!#}"
37+
if [ -d "$LAST_ARG" ]; then
38+
SCAN_DIR="$LAST_ARG"
39+
PIPELINES=("${@:1:$#-1}") # All args except last
40+
else
41+
PIPELINES=("$@")
42+
fi
43+
44+
# Default pipeline if none specified
45+
if [ "${#PIPELINES[@]}" -eq 0 ]; then
46+
PIPELINES=("scan_codebase")
47+
fi
48+
49+
# Run the scan
50+
docker run --rm \
51+
-v "$SCAN_DIR":/codebase \
52+
"$SCIO_DOCKER_IMAGE" \
53+
run "${PIPELINES[@]}" /codebase \
54+
> "$RESULTS_LOCATION"
55+
56+
ABS_RESULTS_PATH="$(pwd)/$RESULTS_LOCATION"
57+
58+
echo "✅ Scan complete using pipeline(s): ${PIPELINES[*]}"
59+
echo "💾 Results saved to: $ABS_RESULTS_PATH"

scanpipe/migrations/0031_scancode_toolkit_v32_data_updates.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def compute_package_declared_license_expression_spdx(apps, schema_editor):
2525
).only("declared_license_expression")
2626

2727
object_count = queryset.count()
28-
logger.info(f"Compute declared_license_expression_spdx for {object_count:,} packages.")
28+
logger.debug(f"Compute declared_license_expression_spdx for {object_count:,} packages.")
2929

3030
chunk_size = 2000
3131
iterator = queryset.iterator(chunk_size=chunk_size)
@@ -37,9 +37,9 @@ def compute_package_declared_license_expression_spdx(apps, schema_editor):
3737
unsaved_objects.append(package)
3838

3939
if not (index % chunk_size) and unsaved_objects:
40-
logger.info(f" {index:,} / {object_count:,} computed")
40+
logger.debug(f" {index:,} / {object_count:,} computed")
4141

42-
logger.info("Updating DB objects...")
42+
logger.debug("Updating DB objects...")
4343
DiscoveredPackage.objects.bulk_update(
4444
objs=unsaved_objects,
4545
fields=["declared_license_expression_spdx"],
@@ -65,7 +65,7 @@ def compute_resource_detected_license_expression(apps, schema_editor):
6565
)
6666

6767
object_count = queryset.count()
68-
logger.info(f"Compute detected_license_expression for {object_count:,} resources.")
68+
logger.debug(f"Compute detected_license_expression for {object_count:,} resources.")
6969

7070
chunk_size = 2000
7171
iterator = queryset.iterator(chunk_size=chunk_size)
@@ -92,9 +92,9 @@ def compute_resource_detected_license_expression(apps, schema_editor):
9292
unsaved_objects.append(resource)
9393

9494
if not (index % chunk_size) and unsaved_objects:
95-
logger.info(f" {index:,} / {object_count:,} computed")
95+
logger.debug(f" {index:,} / {object_count:,} computed")
9696

97-
logger.info("Updating DB objects...")
97+
logger.debug("Updating DB objects...")
9898
CodebaseResource.objects.bulk_update(
9999
objs=unsaved_objects,
100100
fields=[
@@ -168,7 +168,7 @@ def compute_resource_license_detections(apps, schema_editor):
168168
queryset = CodebaseResource.objects.filter(~Q(licenses=[])).only("licenses")
169169

170170
object_count = queryset.count()
171-
logger.info(f"Compute license_detections for {object_count:,} resources.")
171+
logger.debug(f"Compute license_detections for {object_count:,} resources.")
172172

173173
chunk_size = 2000
174174
iterator = queryset.iterator(chunk_size=chunk_size)
@@ -180,9 +180,9 @@ def compute_resource_license_detections(apps, schema_editor):
180180
unsaved_objects.append(resource)
181181

182182
if not (index % chunk_size):
183-
logger.info(f" {index:,} / {object_count:,} computed")
183+
logger.debug(f" {index:,} / {object_count:,} computed")
184184

185-
logger.info("Updating DB objects...")
185+
logger.debug("Updating DB objects...")
186186
# Keeping the batch_size small as the `license_detections` content is often large,
187187
# and it may raise `django.db.utils.OperationalError: out of memory`
188188
CodebaseResource.objects.bulk_update(

scanpipe/migrations/0055_discoveredpackage_datafile_paths.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def update_package_datasource_ids(apps, schema_editor):
1818

1919
object_count = queryset.count()
2020
if object_count:
21-
logger.info(f"Compute datasource_ids for {object_count:,} packages.")
21+
logger.debug(f"Compute datasource_ids for {object_count:,} packages.")
2222

2323
chunk_size = 2000
2424
iterator = queryset.iterator(chunk_size=chunk_size)
@@ -30,7 +30,7 @@ def update_package_datasource_ids(apps, schema_editor):
3030
unsaved_objects.append(package)
3131

3232
if not (index % chunk_size) and unsaved_objects:
33-
logger.info(f" {index:,} / {object_count:,} computed")
33+
logger.debug(f" {index:,} / {object_count:,} computed")
3434

3535
DiscoveredPackage.objects.bulk_update(
3636
objs=unsaved_objects,

0 commit comments

Comments
 (0)