From aa5cf05b97a45745d599162352b15c1d3eb7998a Mon Sep 17 00:00:00 2001 From: Dr Nic Williams Date: Mon, 19 Nov 2018 12:02:57 +1000 Subject: [PATCH] use explicit image tag --- ci/pipeline.yml | 10 ++++++---- ci/scripts/build-chart | 16 +++++++++++----- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/ci/pipeline.yml b/ci/pipeline.yml index 373750a..a06d1d2 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -84,6 +84,7 @@ groups: jobs: - name: latest-image public: true + serial_groups: [test-image] plan: - get: git trigger: true @@ -100,12 +101,13 @@ jobs: - name: helm-test public: true + serial_groups: [test-image] # to ensure :latest is what comes from image-latest above plan: - aggregate: - - { get: git, trigger: true } + - { get: git } - { get: image-latest, params: {skip_download: true} } # - { get: git, passed: [latest-image], trigger: true } - # - { get: image-latest, passed: [latest-image] } + # - { get: image-latest, passed: [latest-image], params: {skip_download: true} } - name: build-chart task: build-chart config: @@ -131,7 +133,7 @@ jobs: params: chart: chart/*.tgz devel: true - wait_until_ready: 10 + wait_until_ready: 60 - name: shipit public: true @@ -223,7 +225,7 @@ jobs: - put: helm-install-latest params: chart: github/*.tgz - wait_until_ready: 10 + wait_until_ready: 60 - name: rc public: true diff --git a/ci/scripts/build-chart b/ci/scripts/build-chart index d505c19..586e7b7 100755 --- a/ci/scripts/build-chart +++ b/ci/scripts/build-chart @@ -24,11 +24,17 @@ header() { CHART_NAME=$(bosh int ${REPO_ROOT}/${CHART_ROOT}/Chart.yaml --path /name) header "Copy chart into folder with chart name ${CHART_NAME}..." -mkdir -p chart/${CHART_NAME} -cp -r ${REPO_ROOT}/${CHART_ROOT}/* chart/${CHART_NAME} -header "Set values.yaml for docker + version" -echo "TODO ****" +mkdir -p build-chart/${CHART_NAME} +cp -r ${REPO_ROOT}/${CHART_ROOT}/* build-chart/${CHART_NAME} + +header "Use latest docker image" +tmpfile=$(mktemp /tmp/chart-yaml.XXXX) +sed -e "s/^ tag:.*$/ tag: latest/g" build-chart/${CHART_NAME}/values.yaml > $tmpfile +cp $tmpfile build-chart/${CHART_NAME}/values.yaml + +header "Updated values.yaml" +cat build-chart/${CHART_NAME}/values.yaml header "Build helm chart" -helm package chart/${CHART_NAME} -d ${CHART_OUT} +helm package build-chart/${CHART_NAME} -d ${CHART_OUT}