Commit fe0e935b authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

fix(bash mode): unmask errors in shell pipelines with 'set -o pipefail'

parent e82d00c8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ stages:

.zola-pages-scripts: &zola-pages-scripts |
  # BEGSCRIPT
  set -e
  set -eo pipefail

  function log_info() {
      echo -e "[\\e[1;94mINFO\\e[0m] $*"
+3 −2
Original line number Diff line number Diff line
@@ -141,7 +141,7 @@ stages:

.zola-scripts: &zola-scripts |
  # BEGSCRIPT
  set -e
  set -eo pipefail

  function log_info() {
    >&2 echo -e "[\\e[1;94mINFO\\e[0m] $*"
@@ -351,7 +351,8 @@ stages:
  }

  function eval_all_secrets() {
    encoded_vars=$(env | grep -v '^scoped__' | awk -F '=' '/^[a-zA-Z0-9_]*=@(b64|hex|url)@/ {print $1}')
    # exclude scoped variables and their copies passed to container services (`<service_name>_ENV_scoped__xxx`)
    encoded_vars=$(env | awk -F '=' '$1 !~ /(^|_ENV_)scoped__/ && $2 ~ /^@(b64|hex|url)@/ {print $1}')
    for var in $encoded_vars
    do
      eval_secret "$var"