diff --git a/.circleci/config.yml b/.circleci/config.yml index 9995150c82..6c6458c093 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,12 +1,29 @@ version: 2.1 - +orbs: + go: circleci/go@1.11.0 jobs: + test: + resource_class: large + executor: + name: go/default + tag: "1.22.3" + steps: + - checkout + - go/load-cache + - go/mod-download + - run: + command: make setup-envtest + - go/save-cache + - run: + command: make test + build: machine: - image: "ubuntu-2204:2022.10.2" + image: "ubuntu-2204:2024.05.1" environment: ALL_ARCH: "amd64 arm64" + REGISTRY_AZURE: gsoci.azurecr.io/giantswarm REGISTRY_QUAY: quay.io/giantswarm REGISTRY_CHINA: giantswarm-registry.cn-shanghai.cr.aliyuncs.com/giantswarm steps: @@ -15,7 +32,7 @@ jobs: - run: name: Build the CAPA docker images command: | - for registry in $REGISTRY_QUAY $REGISTRY_CHINA; do + for registry in $REGISTRY_AZURE $REGISTRY_QUAY $REGISTRY_CHINA; do make docker-build-all ALL_ARCH="$ALL_ARCH" TAG=$CIRCLE_SHA1 REGISTRY=$registry if [ -n "$CIRCLE_TAG" ]; then @@ -24,6 +41,18 @@ jobs: fi done + - run: + name: Push to Azure + command: | + docker login --username $ACR_GSOCI_USERNAME --password $ACR_GSOCI_PASSWORD "${REGISTRY_AZURE%/*}" + + make docker-push-all ALL_ARCH="$ALL_ARCH" TAG=$CIRCLE_SHA1 REGISTRY=$REGISTRY_AZURE + + if [ -n "$CIRCLE_TAG" ]; then + echo "Pushing tag $CIRCLE_TAG" + make docker-push-all ALL_ARCH="$ALL_ARCH" TAG="$CIRCLE_TAG" REGISTRY=$REGISTRY_AZURE + fi + - run: name: Push to quay command: | @@ -68,3 +97,4 @@ workflows: filters: tags: only: /^v.*/ + - test