From 998f3f7364963511d95fbc33f0e0d9d909faf0b9 Mon Sep 17 00:00:00 2001 From: ggarri Date: Wed, 16 Feb 2022 17:32:02 +0100 Subject: [PATCH] provisional fix for CI pipeline --- .circleci/config.yml | 124 ++++++++++++++++++------------------------- 1 file changed, 52 insertions(+), 72 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ef031050..3ce3b0fe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: @@ -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 @@ -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: @@ -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: @@ -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.*/ @@ -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: @@ -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