Skip to content

Commit

Permalink
provisional fix for CI pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarri committed Feb 16, 2022
1 parent 4be8e08 commit 998f3f7
Showing 1 changed file with 52 additions and 72 deletions.
124 changes: 52 additions & 72 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ jobs:
resource_class: xlarge
# parameters are set on the job level, see below
parameters:
docker-image-platforms:
docker-image-platform:
type: string
default: linux/amd64
docker-distroless-version:
Expand All @@ -335,56 +335,53 @@ jobs:
no_output_timeout: 60m
command: |
export DOCKER_IMAGE_SIGN="<< parameters.docker-image-sign >>"
export DOCKER_IMAGE_PLATFORMS="<< parameters.docker-image-platforms >>"
export DOCKER_IMAGE_PLATFORM="<< parameters.docker-image-platform >>"
export DOCKER_IMAGE_VERSION="<< parameters.docker-distroless-version >>"
export DOCKER_IMAGE_REF="<< parameters.docker-image-registry >>/<< parameters.docker-image-tag >>"
for PLATFORM in $DOCKER_IMAGE_PLATFORMS; do
TARGETOS="$(echo "${PLATFORM}" | cut -d '/' -f 1)"
TARGETARCH="$(echo "${PLATFORM}" | cut -d '/' -f 2)"
TARGETOS="$(echo "${DOCKER_IMAGE_PLATFORM}" | cut -d '/' -f 1)"
TARGETARCH="$(echo "${DOCKER_IMAGE_PLATFORM}" | cut -d '/' -f 2)"
if [ $TARGETOS != "linux" ]; then
echo "Targeted OS not supported $TARGETOS"
exit 1
fi
if [ $TARGETOS != "linux" ]; then
echo "Targeted OS not supported $TARGETOS"
exit 1
fi
if [ $TARGETARCH == "amd64" ]; then
DOCKER_IMAGE_TAG="${DOCKER_IMAGE_REF}"
else
DOCKER_IMAGE_TAG="${DOCKER_IMAGE_REF}.${TARGETARCH}"
fi
if [ $TARGETARCH == "amd64" ]; then
DOCKER_IMAGE_TAG="${DOCKER_IMAGE_REF}"
else
DOCKER_IMAGE_TAG="${DOCKER_IMAGE_REF}.${TARGETARCH}"
fi
echo "Building image ${DOCKER_IMAGE_TAG} for {os:${TARGETOS}, arch:$TARGETARCH}..."
DOCKER_BUILDKIT=1 docker build --build-arg VERSION=${DOCKER_IMAGE_VERSION} \
--label org.opencontainers.image.created=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--label org.opencontainers.image.url="https://consensys.net" \
--label org.opencontainers.image.documentation="https://docs.quorum-key-manager.consensys.net/" \
--label org.opencontainers.image.source="${CIRCLE_REPOSITORY_URL}" \
--label org.opencontainers.image.version="${CIRCLE_TAG-branch}" \
--label org.opencontainers.image.revision="${CIRCLE_SHA1:0:7}" \
--label org.opencontainers.image.vendor="ConsenSys Software Inc." \
--label org.opencontainers.image.licenses="BUSL-1.1" \
--label org.opencontainers.image.title="${CIRCLE_PROJECT_REPONAME}" \
--label org.opencontainers.image.description="A universal Key & Account Management solution for blockchain applications." \
--platform ${PLATFORM} \
--push -t ${DOCKER_IMAGE_TAG} \
-q \
.
echo "Building image ${DOCKER_IMAGE_TAG} for {os:${TARGETOS}, arch:$TARGETARCH}..."
DOCKER_BUILDKIT=1 docker build --build-arg VERSION=${DOCKER_IMAGE_VERSION} \
--label org.opencontainers.image.created=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--label org.opencontainers.image.url="https://consensys.net" \
--label org.opencontainers.image.documentation="https://docs.quorum-key-manager.consensys.net/" \
--label org.opencontainers.image.source="${CIRCLE_REPOSITORY_URL}" \
--label org.opencontainers.image.version="${CIRCLE_TAG-branch}" \
--label org.opencontainers.image.revision="${CIRCLE_SHA1:0:7}" \
--label org.opencontainers.image.vendor="ConsenSys Software Inc." \
--label org.opencontainers.image.licenses="BUSL-1.1" \
--label org.opencontainers.image.title="${CIRCLE_PROJECT_REPONAME}" \
--label org.opencontainers.image.description="A universal Key & Account Management solution for blockchain applications." \
--platform ${DOCKER_IMAGE_PLATFORM} \
--push -t ${DOCKER_IMAGE_TAG} \
.
if [ $DOCKER_IMAGE_SIGN == "true" ]; then
echo "Waiting for few seconds for image to become available..."
sleep 10
if [ $DOCKER_IMAGE_SIGN == "true" ]; then
echo "Waiting for few seconds for image to become available..."
sleep 10
echo "Pulling docker image ${DOCKER_IMAGE_TAG}..."
docker pull "${DOCKER_IMAGE_TAG}"
echo "Pulling docker image ${DOCKER_IMAGE_TAG}..."
docker pull "${DOCKER_IMAGE_TAG}"
echo "Signing docker image ${DOCKER_IMAGE_TAG}..."
docker trust sign --local "${DOCKER_IMAGE_TAG}"
echo "Signing docker image ${DOCKER_IMAGE_TAG}..."
docker trust sign --local "${DOCKER_IMAGE_TAG}"
echo "Pushing docker image ${DOCKER_IMAGE_TAG}..."
docker push "${DOCKER_IMAGE_TAG}"
fi
done
echo "Pushing docker image ${DOCKER_IMAGE_TAG}..."
docker push "${DOCKER_IMAGE_TAG}"
fi
# defines the qa deployment
# Will update the existing TLS secret of the QKM with fresh PKI data
Expand Down Expand Up @@ -509,7 +506,7 @@ workflows:
- dockerhub-opsquorum-dct
- cloudsmith-tanuki-rw
docker-image-tag: "quorum-key-manager:${CIRCLE_SHA1:0:7}"
docker-image-platforms: linux/amd64
docker-image-platform: linux/amd64
docker-distroless-version: debug-nonroot
docker-image-registry: ${CLOUDSMITH_DEV_REPO}
filters:
Expand Down Expand Up @@ -552,7 +549,7 @@ workflows:
- dockerhub-opsquorum-dct
- cloudsmith-tanuki-rw
docker-image-tag: "quorum-key-manager:develop"
docker-image-platforms: linux/amd64
docker-image-platform: linux/amd64
docker-distroless-version: debug-nonroot
docker-image-registry: ${CLOUDSMITH_DEV_REPO}
filters:
Expand All @@ -564,8 +561,8 @@ workflows:
# Is a pipeline blocker that requires a human decision and action
- wait-for-approval:
type: approval
requires:
- e2e
# requires:
# - e2e
filters:
tags:
only: /^v.*/
Expand All @@ -580,10 +577,11 @@ workflows:
context:
- dockerhub-quorumengineering-rw
- dockerhub-opsquorum-dct
- cloudsmith-tanuki-rw
matrix:
parameters:
docker-image-tag: ["quorum-key-manager:${CIRCLE_TAG}", "quorum-key-manager:latest"]
docker-image-platforms: "linux/amd64 linux/arm64"
docker-image-platform: ["linux/amd64", "linux/arm64"]
docker-image-registry: consensys
docker-image-sign: true
filters:
Expand All @@ -593,34 +591,16 @@ workflows:
ignore: /.*/
requires:
- wait-for-approval
# Will build and push a prod-debug image for each `/^v.*/` git tag
# requires an approval
- build-docker-image:
name: release-debug-tag
context:
- dockerhub-quorumengineering-rw
- dockerhub-opsquorum-dct
docker-image-platforms: linux/amd64
docker-distroless-version: debug-nonroot
docker-image-tag: "quorum-key-manager:${CIRCLE_TAG}-debug"
docker-image-registry: consensys
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
requires:
- wait-for-approval
# Will deploy the staging env
# requires a successful release image (latest tag) pushed
- deploy-staging:
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
requires:
- release-tag-quorum-key-manager:latest
# - deploy-staging:
# filters:
# tags:
# only: /^v.*/
# branches:
# ignore: /.*/
# requires:
# - release-tag-quorum-key-manager:latest

# --------------------------
# End of workflows definition definitions
Expand Down

0 comments on commit 998f3f7

Please sign in to comment.