-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGraphVisualization.sh
executable file
·41 lines (30 loc) · 2.22 KB
/
GraphVisualization.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
# DEPRECATED: Creates the "graph-visualization" report using the (now deprecated) nodejs project "graph-visualization".
# It contains the hierarchical artifact dependencies graph
# Requires executeJupyterNotebook.sh
# Fail on any error ("-e" = exit on first error, "-o pipefail" exist on errors within piped commands)
set -o errexit -o pipefail
echo "GraphVisualization: Graph Visualization with the nodejs project 'graph-visualization' is deprecated and will be skipped."
return 0
# Overrideable Constants (defaults also defined in sub scripts)
REPORTS_DIRECTORY=${REPORTS_DIRECTORY:-"reports"}
## Get this "scripts/reports" directory if not already set
# Even if $BASH_SOURCE is made for Bourne-like shells it is also supported by others and therefore here the preferred solution.
# CDPATH reduces the scope of the cd command to potentially prevent unintended directory changes.
# This way non-standard tools like readlink aren't needed.
REPORTS_SCRIPT_DIR=${REPORTS_SCRIPT_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )}
echo "GraphVisualization: REPORTS_SCRIPT_DIR=${REPORTS_SCRIPT_DIR}"
# Get the "scripts" directory by taking the path of this script and going one directory up.
SCRIPTS_DIR=${SCRIPTS_DIR:-"${REPORTS_SCRIPT_DIR}/.."} # Repository directory containing the shell scripts
echo "GraphVisualization: SCRIPTS_DIR=${SCRIPTS_DIR}"
# Get the "graph-visualization" directory by taking the path of this script and going two directory up and then to "visualization".
GRAPH_VISUALIZATION_DIRECTORY=${GRAPH_VISUALIZATION_DIRECTORY:-"${SCRIPTS_DIR}/../graph-visualization"} # Repository directory containing the Jupyter Notebooks
echo "GraphVisualization: GRAPH_VISUALIZATION_DIRECTORY=${GRAPH_VISUALIZATION_DIRECTORY}"
# Execute "npm ci" to get all required node modules from npm package manager
if [ ! -d "${GRAPH_VISUALIZATION_DIRECTORY}/node_modules" ] ; then
echo "GraphVisualization: Resolving node_modules..."
(cd "${GRAPH_VISUALIZATION_DIRECTORY}" && exec npm ci)
fi
# Execute the node.js script to render the graph visualizations as image files
(cd "${REPORTS_DIRECTORY}" && exec node "${GRAPH_VISUALIZATION_DIRECTORY}/renderVisualizations.js")
echo "GraphVisualization: Successfully finished"