Commit 0f66b7a0 authored by Clement Bois's avatar Clement Bois
Browse files

Merge branch 'install-python3' into 'master'

fix: install python3 if it is not present

Closes #158

See merge request to-be-continuous/docker!178
parents 01e241cc 4a44ec82
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -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