Commit a0c33840 authored by Girija Saint-Ange's avatar Girija Saint-Ange
Browse files

Merge branch 'fix/install-awk' into 'main'

fix: install awk

See merge request to-be-continuous/azure!21
parents b1534444 3bbe5146
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
@@ -619,6 +619,35 @@ stages:
    fi
  }

  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
    elif command -v dnf > /dev/null
    then
      # RPM based
      if ! dnf info --installed "$@" > /dev/null
      then
        dnf install --assumeyes --quiet "$@"
      fi
    else
      log_error "... didn't find any supported package manager to install $*"
      exit 1
    fi
  }

  unscope_variables
  eval_all_secrets

@@ -638,6 +667,8 @@ stages:
  before_script:
    - !reference [.azure-scripts]
    - install_ca_certs "${CUSTOM_CA_CERTS:-$DEFAULT_CA_CERTS}"
    # install awk
    - maybe_install_packages awk

# Env management job prototype
# Can be extended to define a concrete environment