You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/pages/output_files.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -131,7 +131,7 @@ to the directory:
131
131
└── git_repos
132
132
└── local_repos
133
133
134
-
.. note:: Please see :ref:`pages/using:analyzing a locally cloned repository` to know how to set the directory for analyzing local repositories.
134
+
.. note:: Please see :ref:`pages/using:analyzing a repository on the local file system` to know how to set the directory for analyzing local repositories.
.. note:: By default, Macaron would generate report files into the ``output`` directory in the current workspace. To understand the structure of this directory please see :ref:`Output Files Guide <output_files_guide>`.
54
+
.. note:: By default, Macaron would generate report files into the ``output`` directory in the current working directory. To understand the structure of this directory please see :ref:`Output Files Guide <output_files_guide>`.
55
55
56
56
With the example above, the generated output reports can be seen here:
57
57
@@ -238,7 +238,7 @@ With the example above, the generated output reports can be seen here:
238
238
Analyzing dependencies in the SBOM without the main software component
In the case where the repository URL of the main software component is not available (e.g. the repository is in a private domain where Macaron cannot access),
241
+
In the case where the repository URL of the main software component is not available (e.g. the repository is in a self-hosted git service instance where Macaron cannot access),
242
242
Macaron can still run the analysis on the dependencies listed in the SBOM.
243
243
To do that, you must first create a PURL to present the main software component. This is so that this software component could be referenced later in the :ref:`verify-policy <verify-policy-command-cli>` command.
244
244
For example: ``pkg:private_domain.com/org/name``.
@@ -300,9 +300,9 @@ An example configuration file for utilising this feature:
300
300
301
301
302
302
303
-
-------------------------------------
304
-
Analyzing a locally cloned repository
305
-
-------------------------------------
303
+
-----------------------------------------------
304
+
Analyzing a repository on the local file system
305
+
-----------------------------------------------
306
306
307
307
.. warning::
308
308
During the analysis, Macaron can check out different commits, which can reset the index and working tree of the repository.
@@ -312,9 +312,55 @@ Analyzing a locally cloned repository
312
312
.. note::
313
313
We assume that the ``origin`` remote exists in the cloned repository and checkout the relevant commits from ``origin`` only.
314
314
315
-
If you have a local repository that you want to analyze, Macaron also supports running the analysis against a local repository.
315
+
Macaron supports analyzing a repository on the local file system.
316
316
317
-
Assume that the dir tree at the local repository has the following components:
If the repository remote URL is from an unknown git service (see :ref:`Git Services <supported_git_services>` for a list of supported git services in Macaron), Macaron won't recognize it when analyzing the repository.
322
+
323
+
You would need to tell Macaron about that git service through the ``defaults.ini`` config.
324
+
For example, let's say you want to analyze a repository hosted at ``https://git.example.com/foo/target``. First, you need to create a ``defaults.ini`` file in the current working directory with the following content:
325
+
326
+
.. code-block:: ini
327
+
328
+
[git_service.local_repo]
329
+
hostname = git.example.com
330
+
331
+
In which ``hostname`` contains the hostname of the git service URL. In this example it is ``git.example.com``.
332
+
333
+
.. note::
334
+
335
+
This ``defaults.ini`` section must only be used for analyzing a repository on the local file system. If the hostname has already been supported in other services, it doesn't need to be defined again here.
336
+
337
+
Assume that the dir tree at the current working directory has the following structure:
338
+
339
+
.. code-block:: shell
340
+
341
+
boo
342
+
├── foo
343
+
│ └── target
344
+
345
+
We can run Macaron against the local repository at ``target`` by using this command:
With ``rest_of_args`` being the arguments to the ``analyze`` command (e.g. ``--branch/-b``, ``--digest/-d`` or ``--skip-deps`` similar to two previous examples).
352
+
353
+
The ``--local-repos-path/-lr`` flag tells Macaron to look into ``./boo/foo`` for local repositories. For more information, please see :ref:`Command Line Usage <cli-usage>`.
354
+
355
+
.. note:: If ``--local-repos-path/-lr`` is not provided, Macaron will looks inside ``<current_working_directory>/output/git_repos/local_repos/`` whenever you provide a local path to ``--repo-path/-rp``.
If the local repository you want to analyze has a remote origin hosted on a supported git service, you can run the analysis directly without having to prepare ``defaults.ini`` as above.
362
+
363
+
Assume that the dir tree at the current working directory has the following structure:
318
364
319
365
.. code-block:: shell
320
366
@@ -326,13 +372,13 @@ We can run Macaron against the local repository at ``target`` by using this comm
With ``rest_of_args`` being the arguments to the ``analyze`` command (e.g. ``-b``, ``-d`` or ``--skip-deps`` similar to two previous examples)
377
+
With ``rest_of_args`` being the arguments to the ``analyze`` command (e.g. ``--branch/-b``, ``--digest/-d`` or ``--skip-deps`` similar to two previous examples).
332
378
333
-
The ``-lr`` flag configure Macaron to looks into ``path/to/boo/foo`` for local repositories. For more information, please see :ref:`Command Line Usage <cli-usage>`.
379
+
The ``--local-repos-path/-lr`` flag tells Macaron to look into ``./boo/foo`` for local repositories. For more information, please see :ref:`Command Line Usage <cli-usage>`.
334
380
335
-
.. note:: If ``-lr`` is not provided, Macaron will looks inside ``<working_directory>/output/git_repos/local_repos/`` whenever you provide a local path to ``-rp``.
381
+
.. note:: If ``--local-repos-path/-lr`` is not provided, Macaron will looks inside ``<current_working_directory>/output/git_repos/local_repos/`` whenever you provide a local path to ``--repo-path/-rp``.
0 commit comments