diff --git a/templates/gitlab-ci-docker.yml b/templates/gitlab-ci-docker.yml index 18e6faa292cc19523e7f74aa380d0a20b920b0a5..aa5ec3f1c7bd286595b478cfe792c2f23e904e7c 100644 --- a/templates/gitlab-ci-docker.yml +++ b/templates/gitlab-ci-docker.yml @@ -445,6 +445,29 @@ stages: fi } + function maybe_install_python3() { + if ! command -v python3 > /dev/null + then + if command -v apt-get > /dev/null + then + # Debian + apt-get update + apt-get install --no-install-recommends --yes --quiet python3 + elif command -v apk > /dev/null + then + # Alpine + apk add --no-cache python3 + elif command -v dnf > /dev/null + then + # Fedora + dnf install -y -q python3 + else + log_error "... didn't find any supported package manager to install python3" + exit 1 + fi + fi + } + function github_get_latest_version() { if command -v curl &> /dev/null then @@ -837,6 +860,7 @@ stages: function init_workspace() { install_custom_ca_certs maybe_install_awk + maybe_install_python3 unscope_variables eval_all_secrets configure_registries_auth