Loading templates/gitlab-ci-bash.yml +35 −4 Original line number Diff line number Diff line Loading @@ -314,6 +314,28 @@ stages: done } function maybe_install_packages() { if command -v apt-get > /dev/null then # Debian if ! dpkg --status "$@" > /dev/null then apt-get update apt-get install --no-install-recommends --yes --quiet "$@" fi elif command -v apk > /dev/null then # Alpine if ! apk info --installed "$@" > /dev/null then apk add --no-cache "$@" fi else log_error "... didn't find any supported package manager to install $*" exit 1 fi } function install_bats_libs() { export BATS_LIBRARIES_DIR=/opt/bats/libexec Loading @@ -322,6 +344,13 @@ stages: return fi if [[ "$https_proxy" || "$HTTPS_PROXY" ]] then # BusyBox wget doesn't support proxies and TLS/SSL at the same time: need to use offical full-featured wget instead maybe_install_packages wget fi # install Bats libraries for lib in $BASH_BATS_LIBRARIES do Loading @@ -333,7 +362,7 @@ stages: target=$(mktemp) # 1: download log_info " ... download" log_info " ... download with wget" wget -O "$target" "$lib_url" # 2: unzip Loading @@ -349,9 +378,11 @@ stages: fi done if [ -n "${TRACE}" ]; then # debug log log_info " ... DONE" ls -lart "$BATS_LIBRARIES_DIR" fi } function glob_expand() { Loading Loading
templates/gitlab-ci-bash.yml +35 −4 Original line number Diff line number Diff line Loading @@ -314,6 +314,28 @@ stages: done } function maybe_install_packages() { if command -v apt-get > /dev/null then # Debian if ! dpkg --status "$@" > /dev/null then apt-get update apt-get install --no-install-recommends --yes --quiet "$@" fi elif command -v apk > /dev/null then # Alpine if ! apk info --installed "$@" > /dev/null then apk add --no-cache "$@" fi else log_error "... didn't find any supported package manager to install $*" exit 1 fi } function install_bats_libs() { export BATS_LIBRARIES_DIR=/opt/bats/libexec Loading @@ -322,6 +344,13 @@ stages: return fi if [[ "$https_proxy" || "$HTTPS_PROXY" ]] then # BusyBox wget doesn't support proxies and TLS/SSL at the same time: need to use offical full-featured wget instead maybe_install_packages wget fi # install Bats libraries for lib in $BASH_BATS_LIBRARIES do Loading @@ -333,7 +362,7 @@ stages: target=$(mktemp) # 1: download log_info " ... download" log_info " ... download with wget" wget -O "$target" "$lib_url" # 2: unzip Loading @@ -349,9 +378,11 @@ stages: fi done if [ -n "${TRACE}" ]; then # debug log log_info " ... DONE" ls -lart "$BATS_LIBRARIES_DIR" fi } function glob_expand() { Loading