Commit 43073264 authored by Stephane Bausseron's avatar Stephane Bausseron

Merge branch 'fix-auto-upgrade' into 'master'

Fix auto upgrade

See merge request !31
parents 91e61dbb bf8eabde
Pipeline #27345334 passed with stages
in 5 minutes and 44 seconds
# Changelog
## 5.2.1
* [ci-toolbox] Fix CITBX_VERSION_REQ_MIN test to prevent recursive 'ci-toolbox setup' call
* [wrapper] Improve existing file detection (file command not enough reliable)
## 5.2.0
* [job-test-services] Add timeout
* [ci-toolbox] deprecate citbx_run_ext_job function
......
......@@ -26,7 +26,7 @@ fi
citbx_env_init
# Check minimum version if required
if [ -n "$CITBX_VERSION_REQ_MIN" ] \
if [ -n "$CITBX_VERSION_REQ_MIN" ] && [ "$1" != "setup" ] \
&& [ $(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" \
......
......@@ -35,11 +35,6 @@ CI_PROJECT_DIR="$(git rev-parse --show-toplevel 2>/dev/null || true)"
CITBX_SEARCH_PATH=${CITBX_SEARCH_PATH:-"tools/ci-toolbox:tools/gitlab-ci:/usr/local/lib/ci-toolbox:/usr/lib/ci-toolbox"}
is_bash_file() {
grep -q 'Bourne-Again shell script, ASCII text executable$' \
<<< "$(LC_ALL=C file "$(readlink -f $1)" 2> /dev/null)"
}
_IFS=$IFS
IFS=':'
for d in $CITBX_SEARCH_PATH; do
......@@ -49,12 +44,12 @@ for d in $CITBX_SEARCH_PATH; do
fi
d="$CI_PROJECT_DIR/$d"
fi
if is_bash_file "$d/ci-toolbox.sh"; then
if [ -e "$d/ci-toolbox.sh" ]; then
CITBX_CI_TOOLBOX_PATH="$d/ci-toolbox.sh"
break
fi
# Assure backward compatibility with CITBX_VERSION < 4
if is_bash_file "$d/run.sh"; then
if [ -e "$d/run.sh" ]; then
CITBX_CI_TOOLBOX_PATH="$d/run.sh"
break
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