From 1361af9750801a9bfadd232de8d548faaef6423c Mon Sep 17 00:00:00 2001 From: Aditya Konarde Date: Wed, 22 Nov 2017 12:34:39 +0530 Subject: [PATCH] Use IMAGE_TAG_VERSION parameter to set Image Version Add a new parameter IMAGE_TAG_VERSION to store the value of image tag. Retained the old IMAGE_TAG variable as its required by saasherder. Fix the value type of parameter to use string instead of int. --- cico_build_deploy.sh | 2 +- openshift/mattermost-push-proxy.app.yaml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cico_build_deploy.sh b/cico_build_deploy.sh index e4ac584..79f38f2 100644 --- a/cico_build_deploy.sh +++ b/cico_build_deploy.sh @@ -16,7 +16,7 @@ TEMPLATE="openshift/mattermost-push-proxy.app.yaml" #Find tag used by deployment template echo -e "Scanning OpenShift Deployment Template for Image tag" -TAG=$(cat $TEMPLATE | grep -o -e "registry.*" | awk '{split($0,array,"/")} END{print array[3]}' | awk '{split($0,array,":")} END{print array[2]}') +TAG=$(cat $TEMPLATE | grep -A 1 "name: IMAGE_TAG_VERSION" | grep "value:" | awk '{split($0,array,":")} END{print array[2]}') #Check if image is in the registry echo -e "Checking if image exists on the registry" diff --git a/openshift/mattermost-push-proxy.app.yaml b/openshift/mattermost-push-proxy.app.yaml index bc29d07..2f890fc 100644 --- a/openshift/mattermost-push-proxy.app.yaml +++ b/openshift/mattermost-push-proxy.app.yaml @@ -34,7 +34,7 @@ objects: service: mattermost-push-proxy spec: containers: - - image: registry.centos.org/mattermost/mattermost-push-proxy:${IMAGE_TAG} + - image: registry.centos.org/mattermost/mattermost-push-proxy:${IMAGE_TAG_VERSION} imagePullPolicy: Always name: mattermost-push-proxy ports: @@ -138,5 +138,6 @@ objects: wildcardPolicy: None status: {} parameters: +- name: IMAGE_TAG_VERSION + value: "3.10.0" - name: IMAGE_TAG - value: 3.10.0