Skip to content

Commit

Permalink
use commit instead of tag
Browse files Browse the repository at this point in the history
use commit instead of tag
  • Loading branch information
bensagi committed Nov 2, 2020
1 parent f0eb688 commit d866e87
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,18 @@ 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_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}"
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
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_SHA1} | 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}/SHA1s/${CIRCLE_SHA1}/publish; do echo "failed"; sleep 1; done
else
make build
fi
Expand Down

0 comments on commit d866e87

Please sign in to comment.