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

feat: support CA certs provided as file

parent aa7b4e0d
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -170,10 +170,19 @@ stages:
      echo -e "[\\e[1;91mERROR\\e[0m] $*"
  }

  function as_content() {
    file_or_content=$1
    if [[ -f "${file_or_content}" ]]; then
      cat "${file_or_content}"
    else
      echo "${file_or_content}"
    fi
  }

  function install_ca_certs() {
    certs="$1"

    if [[ -z "${certs}" ]]
    if [[ -z "$certs" ]]
    then
      return
    fi
@@ -198,7 +207,7 @@ stages:
      fi

      # Import certificates in bundle
      echo "${certs}" | tr -d '\r' >> "${bundle}"
      as_content "$certs" | tr -d '\r' >> "${bundle}"

      log_info "Custom CA certificates imported in \\e[33;1m${bundle}\\e[0m"
      imported=1