6565# Download and extract Neo4j
6666if [ ! -d " ${NEO4J_INSTALLATION_DIRECTORY} " ] ; then
6767
68- # Download Neo4j
69- if [ ! -f " ${SHARED_DOWNLOADS_DIRECTORY} /${NEO4J_INSTALLATION_NAME} -unix.tar.gz" ] ; then
70- echo " setupNeo4j: Downloading ${NEO4J_INSTALLATION_NAME} "
71-
72- # Download Neo4j
73- # With the option "-L" a redirection will be followed automatically
74- curl -L --fail-with-body -o " ${SHARED_DOWNLOADS_DIRECTORY} /${NEO4J_INSTALLATION_NAME} -unix.tar.gz" " https://dist.neo4j.org/${NEO4J_INSTALLATION_NAME} -unix.tar.gz" || exit 1
75- else
76- echo " setupNeo4j: ${NEO4J_INSTALLATION_NAME} already downloaded"
77- fi
78-
79- downloaded_neo4j_archive=" ${SHARED_DOWNLOADS_DIRECTORY} /${NEO4J_INSTALLATION_NAME} -unix.tar.gz"
80-
81- # Check downloaded file size to be at least 100 bytes
82- downloaded_file_size=$( wc -c " ${downloaded_neo4j_archive} " | awk ' {print $1}' )
83- if [[ " $downloaded_file_size " -le 100 ]]; then
84- echo " setupNeo4j: Error: Failed to download ${NEO4J_INSTALLATION_NAME} : Invalid Filesize."
85- rm -f " ${downloaded_neo4j_archive} "
86- exit 1
87- fi
68+ neo4jDownloadArchiveFileName=" ${NEO4J_INSTALLATION_NAME} -unix.tar.gz"
69+ source ${SCRIPTS_DIR} /download.sh --url " https://dist.neo4j.org/${neo4jDownloadArchiveFileName} " || exit 1
8870
8971 # Extract the tar file
90- tar -xf " ${downloaded_neo4j_archive} " --directory " ${TOOLS_DIRECTORY} "
72+ tar -xf " ${SHARED_DOWNLOADS_DIRECTORY} / ${neo4jDownloadArchiveFileName} " --directory " ${TOOLS_DIRECTORY} " || exit 1
9173
9274 # Fail if Neo4j hadn't been downloaded successfully
9375 if [ ! -d " ${NEO4J_INSTALLATION_DIRECTORY} " ] ; then
156138# Download and Install the Neo4j Plugin "Awesome Procedures for Neo4j" (APOC)
157139if [ ! -f " ${NEO4J_PLUGINS} /${NEO4J_APOC_PLUGIN_ARTIFACT} " ] ; then
158140
159- # Download the Neo4j Plugin "Awesome Procedures for Neo4j"
160- if [ ! -f " ${SHARED_DOWNLOADS_DIRECTORY} /${NEO4J_APOC_PLUGIN_ARTIFACT} " ] ; then
161- # Download the Neo4j Plugin "Awesome Procedures for Neo4j"
162- echo " setupNeo4j: Downloading ${NEO4J_APOC_PLUGIN_ARTIFACT} "
163- curl -L --fail-with-body -o " ${SHARED_DOWNLOADS_DIRECTORY} /${NEO4J_APOC_PLUGIN_ARTIFACT} " https://github.com/${NEO4J_APOC_PLUGIN_GITHUB} /releases/download/${NEO4J_APOC_PLUGIN_VERSION} /apoc-${NEO4J_APOC_PLUGIN_VERSION} -${NEO4J_APOC_PLUGIN_EDITION} .jar || exit 1
164- else
165- echo " setupNeo4j: ${NEO4J_APOC_PLUGIN_ARTIFACT} already downloaded"
166- fi
167-
168- # Check downloaded file size to be at least 100 bytes
169- downloaded_file_size=$( wc -c " ${SHARED_DOWNLOADS_DIRECTORY} /${NEO4J_APOC_PLUGIN_ARTIFACT} " | awk ' {print $1}' )
170- if [[ " $downloaded_file_size " -le 100 ]]; then
171- echo " setupNeo4j: Error: Failed to download ${NEO4J_APOC_PLUGIN_ARTIFACT} : Invalid Filesize."
172- rm -f " ${SHARED_DOWNLOADS_DIRECTORY} /${NEO4J_APOC_PLUGIN_ARTIFACT} "
173- exit 1
174- fi
141+ source ${SCRIPTS_DIR} /download.sh --url " https://github.com/${NEO4J_APOC_PLUGIN_GITHUB} /releases/download/${NEO4J_APOC_PLUGIN_VERSION} /${NEO4J_APOC_PLUGIN_ARTIFACT} " || exit 1
175142
176143 # Uninstall previously installed Neo4j Plugin "Awesome Procedures for Neo4j" (APOC)
177144 rm -f " ${NEO4J_PLUGINS} /apoc*.jar"
@@ -182,7 +149,7 @@ if [ ! -f "${NEO4J_PLUGINS}/${NEO4J_APOC_PLUGIN_ARTIFACT}" ] ; then
182149
183150 # Fail if Neo4j Plugin "Awesome Procedures for Neo4j" (APOC) hadn't been downloaded successfully
184151 if [ ! -f " ${NEO4J_PLUGINS} /${NEO4J_APOC_PLUGIN_ARTIFACT} " ] ; then
185- echo " setupNeo4j: Error: Failed to download and install ${NEO4J_APOC_PLUGIN_ARTIFACT} "
152+ echo " setupNeo4j: Error: Failed to install ${NEO4J_APOC_PLUGIN_ARTIFACT} "
186153 exit 1
187154 fi
188155
@@ -207,36 +174,18 @@ if [[ ${NEO4J_GDS_PLUGIN_EDITION} == "open" ]]; then
207174 else
208175 neo4jGraphDataScienceNeo4jVersion=" 4.4.23"
209176 fi
210- neo4jGraphDataScienceReleaseArtifactPrefix=" open-graph-data-science"
211- neo4jGraphDataScienceReleaseArtifact=" ${neo4jGraphDataScienceReleaseArtifactPrefix} -${NEO4J_GDS_PLUGIN_VERSION} -for-neo4j-${neo4jGraphDataScienceNeo4jVersion} .jar"
177+ neo4jGraphDataScienceReleaseArtifact=" open-graph-data-science-${NEO4J_GDS_PLUGIN_VERSION} -for-neo4j-${neo4jGraphDataScienceNeo4jVersion} .jar"
212178else
213179 neo4jGraphDataScienceDownloadUrl=" https://github.com/neo4j/graph-data-science/releases/download/${NEO4J_GDS_PLUGIN_VERSION} "
214- neo4jGraphDataScienceReleaseArtifactPrefix=" neo4j-graph-data-science"
215- neo4jGraphDataScienceReleaseArtifact=" ${neo4jGraphDataScienceReleaseArtifactPrefix} -${NEO4J_GDS_PLUGIN_VERSION} -${NEO4J_GDS_PLUGIN_EDITION} .jar"
180+ neo4jGraphDataScienceReleaseArtifact=" neo4j-graph-data-science-${NEO4J_GDS_PLUGIN_VERSION} -${NEO4J_GDS_PLUGIN_EDITION} .jar"
216181fi
217182
218183if [ ! -f " ${NEO4J_PLUGINS} /${neo4jGraphDataScienceReleaseArtifact} " ] ; then
219184 # Download the Neo4j Plugin "Graph Data Science" (GDS)
220- # source ${SCRIPTS_DIR}/download.sh --url "${neo4jGraphDataScienceDownloadUrl}/${neo4jGraphDataScienceReleaseArtifact}"
221-
222- # Download the Neo4j Plugin "Graph Data Science" (GDS)
223- if [ ! -f " ${SHARED_DOWNLOADS_DIRECTORY} /${neo4jGraphDataScienceReleaseArtifact} " ] ; then
224- echo " setupNeo4j: Downloading ${neo4jGraphDataScienceReleaseArtifact} from ${neo4jGraphDataScienceDownloadUrl} /${neo4jGraphDataScienceReleaseArtifact} "
225- curl -L --fail-with-body -o " ${SHARED_DOWNLOADS_DIRECTORY} /${neo4jGraphDataScienceReleaseArtifact} " ${neo4jGraphDataScienceDownloadUrl} /${neo4jGraphDataScienceReleaseArtifact} || exit 1
226- else
227- echo " setupNeo4j: ${neo4jGraphDataScienceReleaseArtifact} already downloaded"
228- fi
229-
230- # Check downloaded file size to be at least 100 bytes
231- downloaded_file_size=$( wc -c " ${SHARED_DOWNLOADS_DIRECTORY} /${neo4jGraphDataScienceReleaseArtifact} " | awk ' {print $1}' )
232- if [[ " $downloaded_file_size " -le 100 ]]; then
233- echo " setupNeo4j: Error: Failed to download ${neo4jGraphDataScienceReleaseArtifact} . Invalid Filesize."
234- rm -f " ${SHARED_DOWNLOADS_DIRECTORY} /${neo4jGraphDataScienceReleaseArtifact} "
235- exit 1
236- fi
185+ source ${SCRIPTS_DIR} /download.sh --url " ${neo4jGraphDataScienceDownloadUrl} /${neo4jGraphDataScienceReleaseArtifact} " || exit 1
237186
238187 # Uninstall previously installed Neo4j Plugin "Graph Data Science" (GDS)
239- rm -f " ${NEO4J_PLUGINS} /${neo4jGraphDataScienceReleaseArtifactPrefix} *.jar"
188+ rm -f " ${NEO4J_PLUGINS} /*graph-data-science *.jar"
240189
241190 # Install the Neo4j Plugin "Graph Data Science" (GDS)
242191 echo " setupNeo4j: Installing ${neo4jGraphDataScienceReleaseArtifact} "
0 commit comments