Commit fee00385 authored by Emeric Verschuur's avatar Emeric Verschuur

[ci-toolbox] Replacing useless legacy CITBX_TOOL_NAME variable by the fixed 'ci-toolbox' value

parent 7a499b60
......@@ -62,7 +62,7 @@ if [ -n "$CI_PROJECT_DIR" ]; then
if [ ${#CITBX_MISSING_PKGS[@]} -eq 0 ]; then
GITLAB_CI_JSON=$(yaml2json $CI_PROJECT_DIR/.gitlab-ci.yml)
else
print_warning "System setup required (command '$CITBX_TOOL_NAME setup')"
print_warning "System setup required (command 'ci-toolbox setup')"
fi
fi
......@@ -74,7 +74,7 @@ gitlab_ci_query() {
citbx_check_env() {
if [ "$1" != "true" ]; then
if [ ${#CITBX_MISSING_PKGS[@]} -gt 0 ]; then
print_critical "System setup needed (binary(ies)/component(s) '${CITBX_MISSING_PKGS[*]}' missing): please execute '$CITBX_TOOL_NAME setup' first"
print_critical "System setup needed (binary(ies)/component(s) '${CITBX_MISSING_PKGS[*]}' missing): please execute 'ci-toolbox setup' first"
fi
return 0
fi
......@@ -265,14 +265,12 @@ if [ ${#CITBX_MISSING_PKGS[@]} -eq 0 ]; then
eval "$(citbx_job_list -f 'printf("CITBX_JOB_LIST+=(\"%s\");", $0);')"
fi
CITBX_TOOL_NAME=${CITBX_TOOL_NAME:-$0}
if [ "$CITBX_OPTION_INTERACTIVE_MODE_ENABLED_DEFAULT" != "true" ]; then
# Set non interactive mode by default
BASHOPTS_SETUP_OPTS+=(-y)
fi
bashopts_setup -n "$(basename $CITBX_TOOL_NAME)" \
bashopts_setup -n "$(basename ci-toolbox)" \
-d "CI toolbox for Gitlab-CI (version $CITBX_VERSION)" \
-s "$CITBX_RC_PATH" "${BASHOPTS_SETUP_OPTS[@]}"
......@@ -286,8 +284,8 @@ command=$1
shift || true
case "$command" in
''|h|help|-h|--help)
bashopts_tool_usage="$CITBX_TOOL_NAME command [command options] [arguments...]
=> type '$CITBX_TOOL_NAME command -h' to display the contextual help
bashopts_tool_usage="ci-toolbox command [command options] [arguments...]
=> type 'ci-toolbox command -h' to display the contextual help
COMMANDS:
help : Display this help
......@@ -300,8 +298,8 @@ $(for j in "${CITBX_JOB_LIST[@]}"; do echo " $j"; done | sort -u)"
bashopts_display_help_delayed
;;
setup)
bashopts_tool_usage="$CITBX_TOOL_NAME $command [arguments...]
=> type '$CITBX_TOOL_NAME help' to display the global help"
bashopts_tool_usage="ci-toolbox $command [arguments...]
=> type 'ci-toolbox help' to display the global help"
CITBX_SETUP_COMPONENT_DEFAULT_LIST+=(base-pkgs docker-cfg ca-certs)
bashopts_declare -n CITBX_SETUP_COMPONENT -l component -i \
-t enum -m add -d "Setup only specified components" \
......@@ -345,7 +343,7 @@ $(for j in "${CITBX_JOB_LIST[@]}"; do echo " $j"; done | sort -u)"
*)
# Command check
if ! printf "%s\n" "${CITBX_JOB_LIST[@]}" | grep -q ^"$command"$; then
print_critical "Unreconized command '$command'; type '$CITBX_TOOL_NAME help' to display the help"
print_critical "Unreconized command '$command'; type 'ci-toolbox help' to display the help"
fi
CI_JOB_NAME=$command
# Read Image property
......@@ -376,8 +374,8 @@ $(for j in "${CITBX_JOB_LIST[@]}"; do echo " $j"; done | sort -u)"
# NOTE: Assure backward compatibility (old name for CITBX_JOB_FILE_NAME property)
CITBX_JOB_FILE_NAME=${CITBX_JOB_FILE_NAME:-${CITBX_JOB_RUN_FILE_NAME:-"$CI_JOB_NAME.sh"}}
# Define job usage
bashopts_tool_usage="$CITBX_TOOL_NAME '${command//\'/\\\'}' [arguments...]
=> type '$CITBX_TOOL_NAME help' to display the global help"
bashopts_tool_usage="ci-toolbox '${command//\'/\\\'}' [arguments...]
=> type 'ci-toolbox help' to display the global help"
# Define the generic options
bashopts_declare -n GIT_SUBMODULE_STRATEGY -l submodule-strategy \
-d "Git submodule strategy (none, normal or recursive)" -t enum -v "${GIT_SUBMODULE_STRATEGY:-none}" \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment