From d57ef6d2e372b7065e536e8fae57ea63c6633ca4 Mon Sep 17 00:00:00 2001 From: Michael Leu Date: Tue, 16 Nov 2021 09:57:35 +0100 Subject: [PATCH 1/2] feat(rails): support spaces in cnb env vars --- README.md | 15 +++++++++++++-- rails-kubernetes.yml | 4 +--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c1a3888..248a95f 100644 --- a/README.md +++ b/README.md @@ -319,8 +319,19 @@ include: file: rails-kubernetes.yml variables: - # rails specific: - CNB_ENV_VARS: "MY_ENV_VAR=bla MY_VAR_FROM_ENV" # specify environment variables to be present at container build time, optionally with a value, or else the value is taken from the environment + # Rails specific optional configuration: + + # Set environment variables to be present at container build time, separated by newlines. + # If no value is defined it is taken from the environment. + CNB_ENV_VARS: | + MY_ENV_VAR="hello world" + MY_VAR_FROM_ENV + # pass extra arguments to the `pack` command + CNB_EXTRA_ARGS: "--verbose" + # override default builder + CNB_BUILDER: "heroku/buildpacks:20" + # override pack CLI version + CNB_PACK_VERSION: "0.22.0" ``` Recommended [values](#values-handling): diff --git a/rails-kubernetes.yml b/rails-kubernetes.yml index 11b3cb7..d8b8eaa 100644 --- a/rails-kubernetes.yml +++ b/rails-kubernetes.yml @@ -3,8 +3,6 @@ include: variables: CNB_BUILDER: "heroku/buildpacks:18" - CNB_ENV_VARS: "BUNDLE_GIT__PANTER__CH" - CNB_EXTRA_ARGS: "" CNB_PACK_VERSION: "0.20.0" # rails needs no app build @@ -23,5 +21,5 @@ docker-build: - chmod +x /usr/local/bin/pack # replace private git ssh gem sources with https to make bundler with credentials via env var work - sed --in-place 's|git@\([^:]*\):|https://\1/|g' Gemfile Gemfile.lock - - for v in $CNB_ENV_VARS; do env_args="$env_args --env $v"; done + - env_args=$(IFS=$'\n'; for var in $CNB_ENV_VARS; do echo -n "--env $var "; done) - pack build $IMAGE_NAME:$IMAGE_TAG --builder $CNB_BUILDER --publish --cache-image $CACHE_IMAGE $env_args $CNB_EXTRA_ARGS -- GitLab From 6ee17aaaaecc83f9765b4bf0f358d7d1eab7b9fe Mon Sep 17 00:00:00 2001 From: Gitlab Runner Date: Tue, 16 Nov 2021 09:54:10 +0000 Subject: [PATCH 2/2] adjust PIPELINE_IMAGE_TAG --- helm-chart.yml | 2 +- monorepo.yml | 2 +- panter-kubernetes-base.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/helm-chart.yml b/helm-chart.yml index c0dd4d0..141c345 100644 --- a/helm-chart.yml +++ b/helm-chart.yml @@ -11,7 +11,7 @@ image: variables: HELM_EXPERIMENTAL_OCI: 1 AUTO_RELEASE: "true" - PIPELINE_IMAGE_TAG: bb9c8edb701da31d025523c18254d204e5ac4c88 + PIPELINE_IMAGE_TAG: d57ef6d2e372b7065e536e8fae57ea63c6633ca4 stages: - lint diff --git a/monorepo.yml b/monorepo.yml index c9f54d5..03facc3 100644 --- a/monorepo.yml +++ b/monorepo.yml @@ -12,7 +12,7 @@ include: - /includes/open-mr.yml variables: - PIPELINE_IMAGE_TAG: bb9c8edb701da31d025523c18254d204e5ac4c88 + PIPELINE_IMAGE_TAG: d57ef6d2e372b7065e536e8fae57ea63c6633ca4 image: git.panter.ch:5001/catladder/gitlab-ci/pipeline:$PIPELINE_IMAGE_TAG diff --git a/panter-kubernetes-base.yml b/panter-kubernetes-base.yml index b0ce3af..cec8b1c 100644 --- a/panter-kubernetes-base.yml +++ b/panter-kubernetes-base.yml @@ -12,7 +12,7 @@ include: - /includes/open-mr.yml variables: - PIPELINE_IMAGE_TAG: bb9c8edb701da31d025523c18254d204e5ac4c88 + PIPELINE_IMAGE_TAG: d57ef6d2e372b7065e536e8fae57ea63c6633ca4 CUSTOMER_NAME: panter APP_NAME: demo COMPONENT_NAME: web -- GitLab