Commit 06b6d9fb authored by Emeric Verschuur's avatar Emeric Verschuur Committed by Brian Lee

[ci-toolbox] Deprecate the citbx_run_ext_job function

parent 5dda8aac
......@@ -171,7 +171,6 @@ Exemple de script de module : [ci-scripts/modules/example.sh](ci-scripts/modules
### Liste des fonctions utiles
* `citbx_run_ext_job <nom de la tâche>` : Exécuter une autre tâche
* `citbx_job_list [prefix]` : Obtenir la liste des tâches (en option : avec le préfixe spécifié)
* `citbx_use <nom du module>` : Charger un module
* `print_critical <message>` : Affichage d'un message d'erreur et sortie (code de retour : 1)
......
......@@ -171,7 +171,6 @@ Example of module script: [ci-scripts/modules/example.sh](ci-scripts/modules/exa
### Useful function list
* `citbx_run_ext_job <job name>`: Run an other job
* `citbx_job_list [prefix]`: Get the job list (optionally with the specified prefix)
* `citbx_use <module name>`: Load a module
* `print_critical <message>`: Print an error message and exit (exit code: 1)
......
......@@ -38,13 +38,6 @@ if [ -n "$CITBX_VERSION_REQ_MIN" ] \
exit 1
fi
# Force use citbx_run_ext_job to run another job
if [ "$CITBX" == "true" ]; then
print_critical "You cannot call another CI script (i.e. other external job) into a CI script" \
"Please use citbx_run_ext_job instead"
fi
export CITBX="true"
# Collect OS release information
declare -A OS_RELEASE_INFO
eval "$(sed -E 's/^([^=]+)=(.*)$/OS_RELEASE_INFO[\1]=\2/g' /etc/os-release)"
......@@ -207,25 +200,23 @@ citbx_gitlab_ci_script() {
esac
}
# Run an other job
# DEPRECATED: Run an other job
citbx_run_ext_job() {
local job_name=$1
test -n "$job_name" \
|| print_critical "Usage: citbx_run_ext_job <job name>"
print_note "Starting job $job_name"
(
set -e
unset CITBX
unset CITBX_COMMAND
unset CITBX_JOB_FILE_NAME
# NOTE: Assure backward compatibility (old name for CITBX_JOB_FILE_NAME property)
unset CITBX_JOB_RUN_FILE_NAME
unset CITBX_GIT_CLEAN
unset CITBX_RUN_SHELL
bashopts_export_opts
export CI_JOB_NAME=$job_name
exec $0 "$@"
)
print_warning "The 'citbx_run_ext_job' function is deprecated since version 5.2.0 and will be removed in a future release." \
"=> Please remove all references to this function in the job_define/job_setup hook from the following file:" \
" * $CITBX_JOBS_DIR/$CITBX_JOB_FILE_NAME"
local env_args
local env
for env in "${bashopts_optlist[@]:1}"; do
case "$env" in
CITBX_COMMAND|CITBX_JOB_FILE_NAME|CITBX_JOB_RUN_FILE_NAME|CITBX_GIT_CLEAN|CITBX_RUN_SHELL|CITBX_DOCKER_IMAGE)
;;
*)
env_args+=("$env=${!env}")
;;
esac
done
env "${env_args[@]}" "$0" "$@"
}
# Export an variable to the job environment
......@@ -649,7 +640,6 @@ case "$CITBX_JOB_EXECUTOR" in
shell)
print_info "Running the job \"$CI_JOB_NAME\" into the shell..."
(
unset CITBX
export GITLAB_CI=true
for e in ${CITBX_ENV_EXPORT_LIST[@]}; do
export $e
......
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