From 3d6ed0208fc7c4d95b3f2d19f92e309c87baf3f1 Mon Sep 17 00:00:00 2001 From: Sertac Ozercan Date: Fri, 5 Jun 2020 18:20:31 +0000 Subject: [PATCH] fix manifest cache issue Signed-off-by: Sertac Ozercan --- .github/workflows/workflow.yaml | 26 +++++++++++++------------- Makefile | 30 ++++++++++++++++++++++++------ 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 4d6ab125ab1..3a2934808e8 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -22,7 +22,7 @@ env: jobs: lint: - name: 'Lint' + name: "Lint" runs-on: ubuntu-latest timeout-minutes: 5 steps: @@ -48,12 +48,12 @@ jobs: make lint build_test: - name: 'Build and Test' + name: "Build and Test" runs-on: ubuntu-latest timeout-minutes: 15 steps: - name: Set up Go 1.13 - uses: actions/setup-go@v2-beta + uses: actions/setup-go@v2 with: go-version: 1.13 id: go @@ -76,7 +76,7 @@ jobs: kubectl logs -n gatekeeper-system -l control-plane=controller-manager helm_build_test: - name: '[Helm] Build and Test' + name: "[Helm] Build and Test" runs-on: ubuntu-latest timeout-minutes: 15 steps: @@ -104,8 +104,8 @@ jobs: kubectl logs -n gatekeeper-system -l control-plane=controller-manager pre-release: - name: 'Pre Release' - runs-on: 'ubuntu-latest' + name: "Pre Release" + runs-on: "ubuntu-latest" if: github.ref == 'refs/heads/master' && github.event_name == 'push' && github.repository == 'open-policy-agent/gatekeeper' needs: [lint, build_test, helm_build_test] timeout-minutes: 30 @@ -126,16 +126,16 @@ jobs: DOCKER_USER: ${{ secrets.DOCKER_USER }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - - uses: 'marvinpinto/action-automatic-releases@v1.0.0' + - uses: "marvinpinto/action-automatic-releases@v1.0.0" with: - repo_token: '${{ secrets.GITHUB_TOKEN }}' + repo_token: "${{ secrets.GITHUB_TOKEN }}" prerelease: true automatic_release_tag: latest - title: 'Development Build' + title: "Development Build" tagged-release: - name: 'Tagged Release' - runs-on: 'ubuntu-latest' + name: "Tagged Release" + runs-on: "ubuntu-latest" if: startsWith(github.ref, 'refs/tags/v') && github.repository == 'open-policy-agent/gatekeeper' needs: [lint, build_test, helm_build_test] timeout-minutes: 30 @@ -173,7 +173,7 @@ jobs: make e2e-verify-release IMG=${{ env.IMAGE_REPO }}:${TAG} USE_LOCAL_IMG=false - name: Create GitHub release - uses: 'marvinpinto/action-automatic-releases@v1.0.0' + uses: "marvinpinto/action-automatic-releases@v1.0.0" with: - repo_token: '${{ secrets.GITHUB_TOKEN }}' + repo_token: "${{ secrets.GITHUB_TOKEN }}" prerelease: false diff --git a/Makefile b/Makefile index 703ab390120..5ae25ce9c24 100644 --- a/Makefile +++ b/Makefile @@ -195,19 +195,37 @@ docker-buildx-dev: test @if ! DOCKER_CLI_EXPERIMENTAL=enabled docker buildx ls | grep -q container-builder; then\ DOCKER_CLI_EXPERIMENTAL=enabled docker buildx create --name container-builder --use;\ fi - DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --platform "linux/amd64,linux/arm64,linux/arm/v7" \ - -t $(REPOSITORY):$(DEV_TAG) \ - -t $(REPOSITORY):dev \ + DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --platform "linux/amd64" \ + -t $(REPOSITORY):$(DEV_TAG)-linux-amd64 \ + . --push + DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --platform "linux/arm64" \ + -t $(REPOSITORY):$(DEV_TAG)-linux-arm64 \ + . --push + DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --platform "linux/arm/v7" \ + -t $(REPOSITORY):$(DEV_TAG)-linux-armv7 \ . --push + DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create $(REPOSITORY):$(DEV_TAG) $(REPOSITORY):$(DEV_TAG)-linux-amd64 $(REPOSITORY):$(DEV_TAG)-linux-arm64 $(REPOSITORY):$(DEV_TAG)-linux-armv7 + DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create $(REPOSITORY):dev $(REPOSITORY):$(DEV_TAG)-linux-amd64 $(REPOSITORY):$(DEV_TAG)-linux-arm64 $(REPOSITORY):$(DEV_TAG)-linux-armv7 + DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push $(REPOSITORY):$(DEV_TAG) + DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push $(REPOSITORY):dev docker-buildx-release: test @if ! DOCKER_CLI_EXPERIMENTAL=enabled docker buildx ls | grep -q container-builder; then\ DOCKER_CLI_EXPERIMENTAL=enabled docker buildx create --name container-builder --use;\ fi - DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --platform "linux/amd64,linux/arm64,linux/arm/v7" \ - -t $(REPOSITORY):$(VERSION) \ - -t $(REPOSITORY):latest \ + DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --platform "linux/amd64" \ + -t $(REPOSITORY):$(VERSION)-linux-amd64 \ + . --push + DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --platform "linux/arm64" \ + -t $(REPOSITORY):$(VERSION)-linux-arm64 \ + . --push + DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --platform "linux/arm/v7" \ + -t $(REPOSITORY):$(VERSION)-linux-armv7 \ . --push + DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create $(REPOSITORY):$(VERSION) $(REPOSITORY):$(VERSION)-linux-amd64 $(REPOSITORY):$(VERSION)-linux-arm64 $(REPOSITORY):$(VERSION)-linux-armv7 + DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create $(REPOSITORY):latest $(REPOSITORY):$(VERSION)-linux-amd64 $(REPOSITORY):$(VERSION)-linux-arm64 $(REPOSITORY):$(VERSION)-linux-armv7 + DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push $(REPOSITORY):$(VERSION) + DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push $(REPOSITORY):latest # Update manager_image_patch.yaml with image tag patch-image: