(refactor)build: ensure 'latest' tag corresponds to release builds (#86)

Signed-off-by: ksatchit <ksatchit@mayadata.io>
This commit is contained in:
Karthik Satchitanand 2019-11-07 17:26:04 +05:30 committed by GitHub
parent aaebdedce3
commit c7c8b753f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 6 deletions

View File

@ -17,7 +17,7 @@ jobs:
CHANGE_MINIKUBE_NONE_USER: true
REPONAME: litmuschaos
IMGNAME: chaos-operator
IMGTAG: latest
IMGTAG: ci
steps:
- checkout
- run:
@ -41,7 +41,7 @@ jobs:
echo 'export PATH="$GOPATH/bin:$PATH"' >> workspace/env-vars
echo 'export REPONAME="litmuschaos"' >> workspace/env-vars
echo 'export IMGNAME="chaos-operator"' >> workspace/env-vars
echo 'export IMGTAG="latest"' >> workspace/env-vars
echo 'export IMGTAG="ci"' >> workspace/env-vars
cat workspace/env-vars >> $BASH_ENV
source $BASH_ENV
- run: make deps
@ -61,7 +61,7 @@ jobs:
machine:
image: circleci/classic:201808-01
environment:
IMGTAG: latest
IMGTAG: ci
working_directory: ~/go/src/github.com/litmuschaos/chaos-operator
steps:
- attach_workspace:
@ -77,7 +77,7 @@ jobs:
machine:
image: circleci/classic:201808-01
environment:
IMGTAG: latest
IMGTAG: ci
working_directory: ~/go/src/github.com/litmuschaos/chaos-operator
steps:
- attach_workspace:

View File

@ -20,6 +20,9 @@ function push_release_image(){
echo "Pushing ${REPONAME}/${IMGNAME}:${CIRCLE_TAG} ..."
docker tag ${IMAGEID} ${REPONAME}/${IMGNAME}:${CIRCLE_TAG}
docker push ${REPONAME}/${IMGNAME}:${CIRCLE_TAG}
echo "Pushing ${REPONAME}/${IMGNAME}:latest ..."
docker tag ${IMAGEID} ${REPONAME}/${IMGNAME}:latest
docker push ${REPONAME}/${IMGNAME}:latest
fi;
}

View File

@ -16,7 +16,7 @@ spec:
serviceAccountName: litmus
containers:
- name: chaos-operator
image: litmuschaos/chaos-operator:latest
image: litmuschaos/chaos-operator:ci
command:
- chaos-operator
imagePullPolicy: IfNotPresent
@ -28,4 +28,4 @@ spec:
fieldRef:
fieldPath: metadata.name
- name: OPERATOR_NAME
value: "chaos-operator"
value: "chaos-operator"