Commit 898ebdfa authored by Emeric Verschuur's avatar Emeric Verschuur

Improve messages/help formating

parent 60390b5b
......@@ -388,22 +388,26 @@ fi
if [ ${#CITBX_MISSING_PKGS[@]} -eq 0 ]; then
eval "$(citbx_job_list -f 'printf("CITBX_JOB_LIST+=(\"%s\");", $0);')"
fi
bashopts_setup -n "run.sh" \
-d "Gitlab-CI job runner tool" \
-s "$CITBX_RC_PATH" \
-u "$0 command [command options] [arguments...]
-s "$CITBX_RC_PATH"
command=$1
shift || true
case "$command" in
''|h|help|-h|--help)
bashopts_tool_usage="$0 command [command options] [arguments...]
=> type '$0 command -h' to display the contextual help
COMMANDS:
help : Display this help
setup : Setup the environment
update : Update this tool (fetch the last version from https://gitlab.com/ercom/citbx4gitlab)
<job name> from : ${CITBX_JOB_LIST[*]}"
... or a job from the job list
command=$1
shift || true
case "$command" in
''|h|help|-h|--help)
JOBS:
$(for j in "${CITBX_JOB_LIST[@]}"; do echo " $j"; done | sort -u)"
bashopts_diplay_help_delayed
;;
setup)
......@@ -585,7 +589,7 @@ gitlab_ci_script ".\"$CI_JOB_NAME\".\"before_script\"" \
|| gitlab_ci_script ".\"before_script\"" \
|| true
gitlab_ci_script ".\"$CI_JOB_NAME\".\"script\"" \
|| print_critical "script $CI_JOB_NAME.script node nor found!"
|| print_critical "script \"$CI_JOB_NAME\".script node nor found!"
for line in "${CITBX_YAML_SCRIPT_ELTS[@]}"; do
CITBX_JOB_SCRIPT="$CITBX_JOB_SCRIPT
print_cmd $(bashopts_get_def line)
......@@ -675,7 +679,7 @@ done
case "$CITBX_JOB_EXECUTOR" in
shell)
print_info "Running the job $CI_JOB_NAME into the shell $CITBX_JOB_SHELL..."
print_info "Running the job \"$CI_JOB_NAME\" into the shell $CITBX_JOB_SHELL..."
(
unset CITBX
export GITLAB_CI=true
......@@ -688,7 +692,7 @@ case "$CITBX_JOB_EXECUTOR" in
docker)
# Setup docker environment
if [ -z "$CITBX_DOCKER_IMAGE" ] || [ "$CITBX_DOCKER_IMAGE" == "null" ]; then
print_critical "No image property found in .gitlab-ci.yml for the job $CI_JOB_NAME"
print_critical "No image property found in .gitlab-ci.yml for the job \"$CI_JOB_NAME\""
fi
CITBX_ID=$(head -c 8 /dev/urandom | od -t x8 -An | grep -oE '\w+')
CITBX_DOCKER_PREFIX="citbx-$CITBX_ID"
......@@ -838,7 +842,7 @@ case "$CITBX_JOB_EXECUTOR" in
print_info "Running a shell into the $CITBX_DOCKER_IMAGE docker container..."
CITBX_JOB_DOCKER_RUN_ARGS+=(-w "$PWD")
else
print_info "Running the job $CI_JOB_NAME into the $CITBX_DOCKER_IMAGE docker container..."
print_info "Running the job \"$CI_JOB_NAME\" into the $CITBX_DOCKER_IMAGE docker container..."
CITBX_JOB_DOCKER_RUN_ARGS+=(-w "$CI_PROJECT_DIR")
fi
......
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