Skip to content

Commit 8139e50

Browse files
committed
Allow disabling all installation steps with the EXECUTE_ALL_STEPS var
1 parent ab7a5af commit 8139e50

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

deploy_dqmgui.sh

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ set -ex
2121
# Main directory we're installing into.
2222
INSTALLATION_DIR=/data/srv
2323

24+
# Default value set for each step flag. Set this to 0 to skip all steps.
25+
# This helps if you want to only run only a few steps of the installation only.
26+
EXECUTE_ALL_STEPS=1
27+
2428
# This scipt's directory
2529
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
2630

@@ -555,14 +559,6 @@ declare -a installation_steps=(preliminary_checks
555559
clean_acrontab
556560
install_acrontab)
557561

558-
# Create dynamic flags to selectively disable/enable steps of the installation
559-
# Those flags are named "do_" with the name of the function, e.g. "do_install_yui" for
560-
# the "install_yui" step and "do_check_dependencies" for "check_dependencies".
561-
# We set those flags to 1 by default.
562-
for step in "${installation_steps[@]}"; do
563-
eval "do_${step}=1"
564-
done
565-
566562
# Parse command line arguments -- use <key>=<value> to override the flags mentioned above.
567563
# e.g. do_install_yui=0
568564
for ARGUMENT in "$@"; do
@@ -572,6 +568,20 @@ for ARGUMENT in "$@"; do
572568
eval "$KEY=$VALUE"
573569
done
574570

571+
# Create dynamic flags to selectively disable/enable steps of the installation
572+
# Those flags are named "do_" with the name of the function, e.g. "do_install_yui" for
573+
# the "install_yui" step and "do_check_dependencies" for "check_dependencies".
574+
# We set those flags to the value of EXECUTE_ALL_STEPS by default.
575+
for step in "${installation_steps[@]}"; do
576+
flag_name="do_${step}"
577+
if [ -z "${!flag_name}" ]; then
578+
echo "${flag_name} not defined"
579+
eval "do_${step}=$EXECUTE_ALL_STEPS"
580+
else
581+
echo "${flag_name} defined and is ${!flag_name}"
582+
fi
583+
done
584+
575585
## Internal temporary paths
576586
ROOT_TMP_DIR="${TMP_BASE_PATH}/root"
577587
ROOT_TMP_BUILD_DIR="${TMP_BASE_PATH}/root_build"

0 commit comments

Comments
 (0)