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: COMMANDS.md
+48-14Lines changed: 48 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,28 +2,62 @@
2
2
3
3
## Start an analysis
4
4
5
-
Use the following commands in the root directory of this repository to start an analysis manually e.g. for [AxonFramework](./scripts/artifacts/downloadAxonFramework.sh).
1. Optionally use a script to download artifacts from Maven ([details](#download-maven-artifacts-to-analyze))
40
+
41
+
1. Start the analysis
42
+
43
+
```shell
44
+
./../../scripts/analysis/analyze.sh
45
+
```
46
+
47
+
<span style="font-size:1.8em;">📖</span>
48
+
See [scripts/examples/analyzeAxonFramework.sh](./scripts/examples/analyzeAxonFramework.sh) as an example for all the above steps. See [code-reports Pipeline](./.github/workflows/code-reports.yml) on how to do this within a GitHub Actions Workflow.
49
+
50
+
<span style="font-size:1.6em;">ⓘ</span>
51
+
Add the command line argument `--report Csv` of [analyze.sh](./scripts/analysis/analyze.sh) to only generate CSV reports. This speeds up the report generation and doesn't depend on Python, Jupyter Notebook or any other related dependencies.
52
+
53
+
<span style="font-size:1.6em;">ⓘ</span>
54
+
Add the command line argument `--profile Neo4jv4` of [analyze.sh](./scripts/analysis/analyze.sh) if you want to use the older long term support (june 2023) version v4.4.x of Neo4j and compatible versions of plugins and JQAssistant.
19
55
20
56
### Notes
21
57
22
-
- Be sure to use Java 11 (Mai 2023 Neo4j v4 requirement) or Java 17 (June 2023 Neo4j v5 and jQAssistant CLI v2)
58
+
- Be sure to use Java 17 for Neo4j v5 and Java 11 for Neo4j v4
23
59
- Use your own initial Neo4j password
24
60
- For more details have a look at the script [analyze.sh](./scripts/analysis/analyze.sh)
25
-
- The script file names (without the prefix "download" and without the file extension) in the directory [scripts/artifacts](./scripts/artifacts) provide all analysis names that are available.
26
-
27
61
28
62
Have a look at [code-reports.yml](./.github/workflows/code-reports.yml) for all details about setup steps and full automation.
- Trigger Artifacts download that contain the code to be analyzed [scripts/artifacts](./scripts/artifacts/)
65
65
- Generate CSV Reports [scripts/reports](./scripts/reports) using the command line JSON parser [jq](https://jqlang.github.io/jq)
66
66
- Generate [Jupyter Notebook](https://jupyter.org) reports using these libraries specified in the [environment.yml](./jupyter/environment.yml):
67
67
-[Python](https://www.python.org)
@@ -97,7 +97,7 @@ The [Code Reports Pipeline](./.github/workflows/code-reports.yml) utilizes [GitH
97
97
## 🤔 Questions & Answers
98
98
99
99
- How can i run an analysis locally?
100
-
👉 See [start-an-analysis](./COMMANDS.md#start-an-analysis) in the [Commands Reference](./COMMANDS.md).
100
+
👉 See [Start an analysis](./COMMANDS.md#start-an-analysis) in the [Commands Reference](./COMMANDS.md).
101
101
102
102
- How can i add an CSV report to the pipeline?
103
103
👉 Put your new cypher query into the [cypher](./cypher) directory or a suitable (new) sub directory.
@@ -109,12 +109,12 @@ The [Code Reports Pipeline](./.github/workflows/code-reports.yml) utilizes [GitH
109
109
👉 Create a new Jupyter report script in the [scripts/reports](./scripts/reports/) directory. Take [OverviewJupyter.sh](./scripts/reports/OverviewJupyter.sh) as a reference for example.
110
110
👉 The script will automatically be included because of the directory and its name ending with "Jupyter.sh".
111
111
112
-
- How can i add another code base to analyze?
113
-
👉 Create an new artifacts download script in the [scripts/artifacts](./scripts/artifacts) directory. Take [downloadAxonFramework.](./scripts/artifacts/downloadAxonFramework.sh) as a reference for example.
114
-
👉 The script will be triggered when the [analyze](./scripts/analysis/analyze.sh)command
112
+
- How can i add another code basis to be analyzed automatically?
113
+
👉 Create a new artifacts download script in the [scripts/artifacts](./scripts/artifacts) directory. Take for example [downloadAxonFramework.sh](./scripts/downloader/downloadAxonFramework.sh) as a reference.
114
+
👉 Run the script separately before executing [analyze.sh](./scripts/analysis/analyze.sh)also in the [pipeline](./.github/workflows/code-reports.yml).
115
115
116
116
- How can i trigger a full rescan of all artifacts?
117
-
👉 Delete the file `artifactsChangeDetectionHash.txt` in the temporary `artifacts` directory.
117
+
👉 Delete the file `artifactsChangeDetectionHash.txt` in the `artifacts` directory.
118
118
119
119
- How can PDF generation be skipped to speed up report generation and not depend on chromium?
120
120
👉 Set environment variable `SKIP_JUPYTER_NOTEBOOK_PDF_GENERATION` to anything except an empty string. Example:
|[copyReportsIntoResults.sh](./copyReportsIntoResults.sh)|| Copies the results from the temp directory to the results directory grouped by the analysis name. |
11
10
|[detectChangedArtifacts.sh](./detectChangedArtifacts.sh)|| Detect changed files in the artifacts directory with a text file containing the last hash code of the contents. |
12
11
|[downloadMavenArtifact.sh](./downloadMavenArtifact.sh)|| Downloads an artifact from Maven Central (https://mvnrepository.com/repos/central)|
|[executeJupyterNotebook.sh](./executeJupyterNotebook.sh)|| Executes all steps in the given Jupyter Notebook (ipynb), stores it and converts it to Markdown (md) and PDF. |
14
14
|[executeQuery.sh](./executeQuery.sh)|| Utilizes Neo4j's HTTP API to execute a Cypher query from an input file and provides the results in CSV format. |
15
15
|[executeQueryFunctions.sh](./executeQueryFunctions.sh)|| Provides functions to execute Cypher queries using either "executeQuery.sh" or Neo4j's "cypher-shell". |
echo"analyze ${analysisName}: Error: No download${analysisName}.sh script in the directory ${SCRIPTS_DIR}/${ARTIFACT_SCRIPTS_DIRECTORY} for analysis name ${analysisName}."
123
-
exit 1
124
-
fi
83
+
echo"analyze: SCRIPTS_DIR=${SCRIPTS_DIR}"
125
84
126
85
# Assure that there is a report compilation script for the given report argument.
echo"analyze${analysisName}: Error: No ${analysisReportCompilation}Reports.sh script in the directory ${SCRIPTS_DIR}/${REPORTS_SCRIPTS_DIRECTORY}/${REPORT_COMPILATIONS_SCRIPTS_DIRECTORY} for report name ${analysisReportCompilation}."
88
+
echo"analyze: Error: No ${analysisReportCompilation}Reports.sh script in the directory ${SCRIPTS_DIR}/${REPORTS_SCRIPTS_DIRECTORY}/${REPORT_COMPILATIONS_SCRIPTS_DIRECTORY} for report name ${analysisReportCompilation}."
130
89
exit 1
131
90
fi
132
91
133
92
# Assure that there is a script file for the given settings profile name.
echo"analyze${analysisName}: Error: No ${settingsProfile}.sh script in the directory ${SCRIPTS_DIR}/${SETTINGS_PROFILE_SCRIPTS_DIRECTORY} for settings profile ${settingsProfile}."
95
+
echo"analyze: Error: No ${settingsProfile}.sh script in the directory ${SCRIPTS_DIR}/${SETTINGS_PROFILE_SCRIPTS_DIRECTORY} for settings profile ${settingsProfile}."
137
96
exit 1
138
97
fi
139
98
140
99
# Execute the settings profile script that sets all the neccessary settings variables (overrideable by environment variables).
141
-
echo"analyze ${analysisName}: Using analysis settings profile script ${SETTINGS_PROFILE_SCRIPT}"
142
-
source"${SETTINGS_PROFILE_SCRIPT}"||exit 1
143
-
144
-
# Create working directory if it hadn't been created yet
echo"analyzeAxonFramework: Error: Requires environment variable NEO4J_INITIAL_PASSWORD to be set first. Use 'export NEO4J_INITIAL_PASSWORD=<your-own-password>'."
19
+
exit 1
20
+
fi
21
+
22
+
# Create the temporary directory for all analysis projects.
23
+
mkdir -p ./temp ||exit 1
24
+
cd ./temp ||exit 1
25
+
26
+
# Create the working directory for this specific analysis.
0 commit comments