Skip to content
Snippets Groups Projects
Commit bb602d8e authored by Cédric OLIVIER's avatar Cédric OLIVIER
Browse files

fix: allow installation of missing package awk

parent 5a8ef2b2
Branches
No related tags found
No related merge requests found
...@@ -352,6 +352,30 @@ stages: ...@@ -352,6 +352,30 @@ stages:
fi fi
} }
function maybe_install_awk() {
if ! command -v awk > /dev/null
then
if command -v apt-get > /dev/null
then
# Debian
apt-get update
apt-get install --no-install-recommends --yes --quiet awk
elif command -v apk > /dev/null
then
# Alpine
apk add --no-cache gawk
elif command -v dnf > /dev/null
then
# Fedora
dnf install -y -q awk
else
log_error "... didn't find any supported package manager to install awk"
exit 1
fi
fi
}
function unscope_variables() { function unscope_variables() {
_scoped_vars=$(env | awk -F '=' "/^scoped__[a-zA-Z0-9_]+=/ {print \$1}" | sort) _scoped_vars=$(env | awk -F '=' "/^scoped__[a-zA-Z0-9_]+=/ {print \$1}" | sort)
if [[ -z "$_scoped_vars" ]]; then return; fi if [[ -z "$_scoped_vars" ]]; then return; fi
...@@ -684,6 +708,7 @@ stages: ...@@ -684,6 +708,7 @@ stages:
} }
function init_workspace() { function init_workspace() {
maybe_install_awk
install_custom_ca_certs install_custom_ca_certs
unscope_variables unscope_variables
eval_all_secrets eval_all_secrets
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment