File tree Expand file tree Collapse file tree 5 files changed +51
-0
lines changed Expand file tree Collapse file tree 5 files changed +51
-0
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,15 @@ jobs:
118118 if-no-files-found : error
119119 retention-days : 5
120120
121+ # Upload Database Export
122+ - name : Archive exported database
123+ uses : actions/upload-artifact@v3
124+ with :
125+ name : code-report-database-export-${{ matrix.java }}-python-${{ matrix.python }}-mambaforge-${{ matrix.mambaforge }}
126+ path : ./temp/**/import
127+ if-no-files-found : error
128+ retention-days : 5
129+
121130 # Commit and push the native image agent results
122131 - name : Display environment variable "github.event_name"
123132 run : echo "github.event_name=${{ github.event_name }}"
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ Script | Directory | Description
7171| [ Cyclic_Dependencies_Concatenated.cypher] ( ./Cyclic_Dependencies/Cyclic_Dependencies_Concatenated.cypher ) | Cyclic_Dependencies | Cyclic Dependencies Concatenated |
7272| [ Cyclic_Dependencies_as_List.cypher] ( ./Cyclic_Dependencies/Cyclic_Dependencies_as_List.cypher ) | Cyclic_Dependencies | Cyclic Dependencies as List |
7373| [ Cyclic_Dependencies_as_unwinded_List.cypher] ( ./Cyclic_Dependencies/Cyclic_Dependencies_as_unwinded_List.cypher ) | Cyclic_Dependencies | Cyclic Dependencies as unwinded List |
74+ | [ Export_the_whole_database_as_CSV.cypher] ( ./Export_the_whole_database_as_CSV.cypher ) | | Export the whole database as CSV |
7475| [ External_package_usage_overall.cypher] ( ./External_Dependencies/External_package_usage_overall.cypher ) | External_Dependencies | External package usage overall |
7576| [ External_package_usage_per_artifact.cypher] ( ./External_Dependencies/External_package_usage_per_artifact.cypher ) | External_Dependencies | External package usage per artifact |
7677| [ External_package_usage_per_artifact_and_package.cypher] ( ./External_Dependencies/External_package_usage_per_artifact_and_package.cypher ) | External_Dependencies | External package usage per artifact and package |
Original file line number Diff line number Diff line change 1+ // Export the whole database as CSV
2+ CALL apoc .export .csv .all ("codegraph.csv" , {} )
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # Exports the whole graph database as a CSV file using the APOC procedure "apoc.export.csv.all"
4+ # The exported file can be found in the subdirectory "import" inside the tools/neo4j.. directory.
5+
6+ # Overrideable Constants (defaults also defined in sub scripts)
7+ REPORTS_DIRECTORY=${REPORTS_DIRECTORY:- " reports" }
8+
9+ # # Get this "scripts/reports" directory if not already set
10+ # Even if $BASH_SOURCE is made for Bourne-like shells it is also supported by others and therefore here the preferred solution.
11+ # CDPATH reduces the scope of the cd command to potentially prevent unintended directory changes.
12+ # This way non-standard tools like readlink aren't needed.
13+ REPORTS_SCRIPT_DIR=${REPORTS_SCRIPT_DIR:- $( CDPATH=. cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " && pwd -P )}
14+ echo " ExternalDependenciesCsv: REPORTS_SCRIPT_DIR=${REPORTS_SCRIPT_DIR} "
15+
16+ # Get the "scripts" directory by taking the path of this script and going one directory up.
17+ SCRIPTS_DIR=${SCRIPTS_DIR:- " ${REPORTS_SCRIPT_DIR} /.." }
18+ echo " ExternalDependenciesCsv SCRIPTS_DIR=${SCRIPTS_DIR} "
19+
20+ # Get the "cypher" directory by taking the path of this script and going two directory up and then to "cypher".
21+ CYPHER_DIR=${CYPHER_DIR:- " ${SCRIPTS_DIR} /../cypher" }
22+ echo " ExportDatabase: CYPHER_DIR=$CYPHER_DIR "
23+
24+ # Define functions to execute a cypher query from within the given file (first and only argument)
25+ source " ${SCRIPTS_DIR} /executeQueryFunctions.sh"
26+
27+ # Execute Database Export Procedure in background
28+ # The exported file can then be found in the subdirectory "import" inside the tools/neo4j.. directory.
29+ execute_cypher " ${CYPHER_DIR} /Export_the_whole_database_as_CSV.cypher" &
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ NEO4J_BOLT_PORT=${NEO4J_BOLT_PORT:-"7687"}
2121NEO4J_INSTALLATION_NAME=" neo4j-${NEO4J_EDITION} -${NEO4J_VERSION} "
2222NEO4J_INSTALLATION_DIRECTORY=" ${TOOLS_DIRECTORY} /${NEO4J_INSTALLATION_NAME} "
2323NEO4J_CONFIG=" ${NEO4J_INSTALLATION_DIRECTORY} /conf/neo4j.conf"
24+ NEO4J_APOC_CONFIG=" ${NEO4J_INSTALLATION_DIRECTORY} /conf/apoc.conf"
2425NEO4J_APOC_PLUGIN_ARTIFACT=" apoc-${NEO4J_APOC_PLUGIN_VERSION} -all.jar"
2526NEO4J_GDS_PLUGIN_ARTIFACT=" neo4j-graph-data-science-${NEO4J_GDS_PLUGIN_VERSION} .jar"
2627
@@ -147,6 +148,15 @@ if [ ! -f "${NEO4J_INSTALLATION_DIRECTORY}/plugins/${NEO4J_APOC_PLUGIN_ARTIFACT}
147148 echo " setupNeo4j: Failed to download and install ${NEO4J_APOC_PLUGIN_ARTIFACT} "
148149 exit 1
149150 fi
151+
152+ # Configure Neo4j Plugin "Awesome Procedures for Neo4j" (APOC)
153+ echo " setupNeo4j: Configuring Neo4j Plugin ${NEO4J_APOC_PLUGIN_ARTIFACT} (APOC)"
154+ {
155+ echo " # Reference: https://neo4j.com/docs/apoc/current/config/#_apoc_export_file_enabled"
156+ echo " "
157+ echo " # Enables writing local files to disk for file export. Default=false"
158+ echo " apoc.export.file.enabled=true"
159+ } >> " ${NEO4J_APOC_CONFIG} "
150160else
151161 echo " setupNeo4j: ${NEO4J_APOC_PLUGIN_ARTIFACT} already installed"
152162fi
You can’t perform that action at this time.
0 commit comments