Skip to content

Commit

Permalink
use commit instead of tag (#11)
Browse files Browse the repository at this point in the history
pushing klar image with commit hash as a image tag in addition to image tag as branch tag
  • Loading branch information
bensagi committed Nov 3, 2020
1 parent f0eb688 commit 50a9d73
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,19 @@ jobs:
- checkout
- setup_remote_docker
- run: docker login -u _json_key -p "${GCR_REGISTRY_SERVICE_ACCOUNT}" http://gcr.io
- run: echo ${CIRCLE_SHA1}
- run: echo ${CIRCLE_TAG}
- run: >
if [ "${CIRCLE_TAG}" != "" ];
then
VERSION=${CIRCLE_TAG} make docker.push
VERSION=${CIRCLE_TAG} make docker.push
VERSION=${CIRCLE_SHA1} make docker.push
docker login -u unused scan.connect.redhat.com -p ${KLAR_REDHAT_REGISTRY_KEY}
export REDHAT_REGISTRY=scan.connect.redhat.com/${KLAR_REDHAT_PROJECT_ID}
VERSION=${CIRCLE_TAG} DOCKER_REGISTRY=${REDHAT_REGISTRY} make docker.push
export KLAR_REDHAT_IMAGE_NAME_AND_TAG="${REDHAT_REGISTRY}/klar:${CIRCLE_TAG}"
VERSION=${CIRCLE_SHA1} DOCKER_REGISTRY=${REDHAT_REGISTRY} make docker.push
export KLAR_REDHAT_IMAGE_NAME_AND_TAG="${REDHAT_REGISTRY}/klar:${CIRCLE_SHA1}"
export DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' ${KLAR_REDHAT_IMAGE_NAME_AND_TAG} | grep -o sha256:.*)
until wget --header "accept: */*" --header "Authorization: Bearer ${REDHAT_API_KEY}" --header "Content-Type: application/json" --post-data "{}" https://connect.redhat.com/api/v2/projects/${KLAR_REDHAT_PROJECT_ID}/containers/${DIGEST}/tags/${CIRCLE_TAG}/publish; do echo "failed"; sleep 1; done
until wget --header "accept: */*" --header "Authorization: Bearer ${REDHAT_API_KEY}" --header "Content-Type: application/json" --post-data "{}" https://connect.redhat.com/api/v2/projects/${KLAR_REDHAT_PROJECT_ID}/containers/${DIGEST}/tags/${CIRCLE_SHA1}/publish; do echo "failed"; sleep 1; done
else
make build
fi
Expand Down

0 comments on commit 50a9d73

Please sign in to comment.