-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GHA writes images to us-docker.pkg.dev/k8ssandra/images
Tests and defaults refer to artifacts.k8ssandra.io/k8ssandra/images Makefile updates for new repository locations
- Loading branch information
1 parent
ccaee9d
commit 7601e11
Showing
15 changed files
with
114 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,11 +56,22 @@ jobs: | |
runs-on: ubuntu-latest | ||
needs: testing | ||
if: github.ref == 'refs/heads/master' | ||
# Add "id-token" with the intended permissions. | ||
permissions: | ||
contents: 'read' | ||
id-token: 'write' | ||
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- id: 'auth' | ||
uses: 'google-github-actions/auth@v0' | ||
with: | ||
workload_identity_provider: 'projects/945064329182/locations/global/workloadIdentityPools/github-pool/providers/github' | ||
service_account: '[email protected]' | ||
- name: 'Set up Cloud SDK' | ||
uses: 'google-github-actions/setup-gcloud@v0' | ||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
|
@@ -73,20 +84,33 @@ jobs: | |
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | ||
# Log in to Google Cloud Artifact Registry | ||
- name: Login to GCP Artifact Registry | ||
uses: 'docker/login-action@v1' | ||
with: | ||
registry: 'us-docker.pkg.dev' | ||
username: 'oauth2accesstoken' | ||
password: '${{ steps.auth.outputs.access_token }}' | ||
- name: Set git parsed values | ||
id: vars | ||
run: | | ||
echo ::set-output name=sha_short::$(git rev-parse --short=8 ${{ github.sha }}) | ||
echo ::set-output name=tag_name::${GITHUB_REF#refs/tags/} | ||
echo ::set-output name=version::$(make version) | ||
- name: Build and push | ||
- name: Build and Push - Cass Operator | ||
id: docker_build_cass_operator | ||
uses: docker/build-push-action@v2 | ||
with: | ||
file: Dockerfile | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: k8ssandra/cass-operator:${{ steps.vars.outputs.sha_short }}, k8ssandra/cass-operator:latest, k8ssandra/cass-operator:${{ steps.vars.outputs.version }} | ||
tags: | | ||
k8ssandra/cass-operator:${{ steps.vars.outputs.sha_short }} | ||
k8ssandra/cass-operator:latest | ||
k8ssandra/cass-operator:${{ steps.vars.outputs.version }} | ||
us-docker.pkg.dev/k8ssandra/images/cass-operator:${{ steps.vars.outputs.sha_short }} | ||
us-docker.pkg.dev/k8ssandra/images/cass-operator:latest | ||
us-docker.pkg.dev/k8ssandra/images/cass-operator:${{ steps.vars.outputs.version }} | ||
platforms: linux/amd64 | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
|
@@ -96,13 +120,17 @@ jobs: | |
with: | ||
file: logger.Dockerfile | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: k8ssandra/system-logger:${{ steps.vars.outputs.sha_short }}, k8ssandra/system-logger:latest | ||
tags: | | ||
k8ssandra/system-logger:${{ steps.vars.outputs.sha_short }} | ||
k8ssandra/system-logger:latest | ||
us-docker.pkg.dev/k8ssandra/images/system-logger:${{ steps.vars.outputs.sha_short }} | ||
us-docker.pkg.dev/k8ssandra/images/system-logger:latest | ||
platforms: linux/amd64 | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
- name: Create bundle | ||
run: | | ||
make IMG=k8ssandra/cass-operator:${{ steps.vars.outputs.version }} VERSION=${{ steps.vars.outputs.version }} CHANNEL=dev bundle | ||
make VERSION=${{ steps.vars.outputs.version }} CHANNEL=dev bundle | ||
- name: Build and push cass-operator-bundle | ||
id: docker_build_cass-operator_bundle | ||
uses: docker/build-push-action@v2 | ||
|
@@ -112,7 +140,9 @@ jobs: | |
VERSION=${{ steps.vars.outputs.version }} | ||
context: . | ||
push: ${{ !env.ACT }} | ||
tags: k8ssandra/cass-operator-bundle:v${{ steps.vars.outputs.version }} | ||
tags: | | ||
k8ssandra/cass-operator-bundle:v${{ steps.vars.outputs.version }} | ||
us-docker.pkg.dev/k8ssandra/images/cass-operator-bundle:v${{ steps.vars.outputs.version }} | ||
platforms: linux/amd64 | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,13 @@ jobs: | |
go-version: 1.18 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- id: 'auth' | ||
uses: 'google-github-actions/auth@v0' | ||
with: | ||
workload_identity_provider: 'projects/945064329182/locations/global/workloadIdentityPools/github-pool/providers/github' | ||
service_account: '[email protected]' | ||
- name: 'Set up Cloud SDK' | ||
uses: 'google-github-actions/setup-gcloud@v0' | ||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
if: ${{ !env.ACT }} | ||
|
@@ -34,6 +41,13 @@ jobs: | |
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | ||
# Log in to Google Cloud Artifact Registry | ||
- name: Login to GCP Artifact Registry | ||
uses: 'docker/login-action@v1' | ||
with: | ||
registry: 'us-docker.pkg.dev' | ||
username: 'oauth2accesstoken' | ||
password: '${{ steps.auth.outputs.access_token }}' | ||
- name: Set git parsed values | ||
id: vars | ||
shell: bash | ||
|
@@ -50,7 +64,9 @@ jobs: | |
VERSION=${{ env.TARGET_VERSION }} | ||
context: . | ||
load: true | ||
tags: k8ssandra/system-logger:${{ steps.vars.outputs.tag_name}} | ||
tags: | | ||
k8ssandra/system-logger:${{ steps.vars.outputs.tag_name}} | ||
us-docker.pkg.dev/k8ssandra/images/system-logger:${{ steps.vars.outputs.tag_name}} | ||
platforms: linux/amd64 | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
|
@@ -63,7 +79,9 @@ jobs: | |
VERSION=${{ env.TARGET_VERSION }} | ||
context: . | ||
load: true | ||
tags: k8ssandra/cass-operator:${{ steps.vars.outputs.tag_name}} | ||
tags: | | ||
k8ssandra/cass-operator:${{ steps.vars.outputs.tag_name}} | ||
us-docker.pkg.dev/k8ssandra/images/cass-operator:${{ steps.vars.outputs.tag_name}} | ||
platforms: linux/amd64 | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
|
@@ -76,7 +94,9 @@ jobs: | |
VERSION=${{ env.TARGET_VERSION }} | ||
context: . | ||
push: ${{ !env.ACT }} | ||
tags: k8ssandra/system-logger:${{ steps.vars.outputs.tag_name}} | ||
tags: | | ||
k8ssandra/system-logger:${{ steps.vars.outputs.tag_name}} | ||
us-docker.pkg.dev/k8ssandra/images/system-logger:${{ steps.vars.outputs.tag_name}} | ||
platforms: linux/amd64 | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
|
@@ -89,7 +109,9 @@ jobs: | |
VERSION=${{ env.TARGET_VERSION }} | ||
context: . | ||
push: ${{ !env.ACT }} | ||
tags: k8ssandra/cass-operator:${{ steps.vars.outputs.tag_name}} | ||
tags: | | ||
k8ssandra/cass-operator:${{ steps.vars.outputs.tag_name}} | ||
us-docker.pkg.dev/k8ssandra/images/cass-operator:${{ steps.vars.outputs.tag_name}} | ||
platforms: linux/amd64 | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
|
@@ -98,8 +120,8 @@ jobs: | |
if: ${{ !env.ACT }} | ||
# The double docker login is a workaround for RH's odd login issues | ||
run: | | ||
docker tag k8ssandra/cass-operator:${{ steps.vars.outputs.tag_name}} scan.connect.redhat.com/ospid-18783bca-8f79-459c-aa0b-bda4e71c6ec3/cass-operator:${{ steps.vars.outputs.tag_name}} | ||
docker tag k8ssandra/system-logger:${{ steps.vars.outputs.tag_name}} scan.connect.redhat.com/ospid-6138f998fb33d420b79f0af9/system-logger:${{ steps.vars.outputs.tag_name}} | ||
docker tag us-docker.pkg.dev/k8ssandra/images/cass-operator:${{ steps.vars.outputs.tag_name}} scan.connect.redhat.com/ospid-18783bca-8f79-459c-aa0b-bda4e71c6ec3/cass-operator:${{ steps.vars.outputs.tag_name}} | ||
docker tag us-docker.pkg.dev/k8ssandra/images/system-logger:${{ steps.vars.outputs.tag_name}} scan.connect.redhat.com/ospid-6138f998fb33d420b79f0af9/system-logger:${{ steps.vars.outputs.tag_name}} | ||
docker login -u unused scan.connect.redhat.com -p ${{ secrets.CASS_OPERATOR_CONNECT_SECRET }} | ||
docker push scan.connect.redhat.com/ospid-18783bca-8f79-459c-aa0b-bda4e71c6ec3/cass-operator:${{ steps.vars.outputs.tag_name}} | ||
docker login -u unused scan.connect.redhat.com -p ${{ secrets.SYSTEM_LOGGER_CONNECT_SECRET }} | ||
|
@@ -126,7 +148,7 @@ jobs: | |
shell: bash | ||
if: ${{ !env.ACT }} # Act does not have yq | ||
run: | | ||
make IMG=k8ssandra/cass-operator:${{ steps.vars.outputs.tag_name}} VERSION=${{ env.TARGET_VERSION }} bundle | ||
make VERSION=${{ env.TARGET_VERSION }} bundle | ||
- name: Build and push cass-operator-bundle | ||
id: docker_build_cass-operator_bundle | ||
if: ${{ !env.ACT }} | ||
|
@@ -138,7 +160,9 @@ jobs: | |
context: . | ||
load: true | ||
push: ${{ !env.ACT }} | ||
tags: k8ssandra/cass-operator-bundle:${{ steps.vars.outputs.tag_name}} | ||
tags: | | ||
k8ssandra/cass-operator-bundle:${{ steps.vars.outputs.tag_name}} | ||
us-docker.pkg.dev/k8ssandra/images/cass-operator-bundle:${{ steps.vars.outputs.tag_name}} | ||
platforms: linux/amd64 | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.