Commit a090af40 authored by Emeric Verschuur's avatar Emeric Verschuur

[ci-toolbox] Add a way to check minimal tool version for certain projects

parent 7c1d5c6c
# CI toolbox for Gitlab - properties
#
# To demand a minimal tool version
#CITBX_VERSION_REQ_MIN=5.1
#
# Scripts root directory
#CITBX_SCRIPTS_DIR=$CI_PROJECT_DIR/ci-scripts
#
......
......@@ -25,6 +25,19 @@ fi
citbx_env_init
# Check minimum version if required
if [ -n "$CITBX_VERSION_REQ_MIN" ] \
&& [ $(printf "%d%04d%04d" ${CITBX_VERSION//[^0-9]/ }) \
-lt $(printf "%d%04d%04d" ${CITBX_VERSION_REQ_MIN//[^0-9]/ }) ]; then
print_warning "This project require CI-Toolbox version $CITBX_VERSION_REQ_MIN or greater" \
"This tool will be upgraded to the last available version" \
"You can abort this process and manually update this tool using 'ci-toolbox setup --component ci-toolbox <specific version>"
echo -n "Type [ENTER] to continue or [CTRL]+[C] to abort."
read
exec ci-toolbox setup --component ci-toolbox
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" \
......
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