3030
3131# Requires setupNeo4j.sh,setupJQAssistant.sh,startNeo4j.sh,resetAndScanChanged.sh,prepareAnalysis.sh,stopNeo4j.sh,comilations/*.sh,profiles/*.sh
3232
33+ # Fail on any error ("-e" = exit on first error, "-o pipefail" exist on errors within piped commands)
34+ set -eo pipefail
35+
3336# Overrideable variables with directory names
3437REPORTS_SCRIPTS_DIRECTORY=${REPORTS_SCRIPTS_DIRECTORY:- " reports" } # Working directory containing the generated reports
3538REPORT_COMPILATIONS_SCRIPTS_DIRECTORY=${REPORT_COMPILATIONS_SCRIPTS_DIRECTORY:- " compilations" } # Repository directory that contains scripts that execute selected report generation scripts
116119
117120# Execute the settings profile script that sets all the neccessary settings variables (overrideable by environment variables).
118121echo " analyze: Using analysis settings profile script ${SETTINGS_PROFILE_SCRIPT} "
119- source " ${SETTINGS_PROFILE_SCRIPT} " || exit 2
122+ source " ${SETTINGS_PROFILE_SCRIPT} "
120123
121124# Setup Tools
122- source " ${SCRIPTS_DIR} /setupNeo4j.sh" || exit 3
123- source " ${SCRIPTS_DIR} /setupJQAssistant.sh" || exit 3
124- source " ${SCRIPTS_DIR} /startNeo4j.sh" || exit 3
125+ source " ${SCRIPTS_DIR} /setupNeo4j.sh"
126+ source " ${SCRIPTS_DIR} /setupJQAssistant.sh"
127+ source " ${SCRIPTS_DIR} /startNeo4j.sh"
125128
126129# Scan and analyze artifacts when they were changed
127- source " ${SCRIPTS_DIR} /resetAndScanChanged.sh" || exit 4
130+ source " ${SCRIPTS_DIR} /resetAndScanChanged.sh"
128131
129132# Prepare and validate graph database before analyzing and creating reports
130- source " ${SCRIPTS_DIR} /prepareAnalysis.sh" || exit 5
133+ source " ${SCRIPTS_DIR} /prepareAnalysis.sh"
131134
132135if ${exploreMode} ; then
133136 echo " analyze: Explore mode activated. Report generation will be skipped. Neo4j keeps running."
138141# Create Reports
139142# ########################
140143echo " analyze: Creating Reports with ${REPORT_COMPILATION_SCRIPT} ..."
141- source " ${REPORT_COMPILATION_SCRIPT} " || exit 6
144+ source " ${REPORT_COMPILATION_SCRIPT} "
142145
143146# Stop Neo4j at the end
144147source " ${SCRIPTS_DIR} /stopNeo4j.sh"
0 commit comments