Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build both platforms and generate manifest as well #78

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,21 @@ steps:
- '-c'
- |
export DOCKER_CLI_EXPERIMENTAL=enabled \
&& gcloud auth configure-docker \
&& docker buildx create --use --name multiarchimage-builder \
&& docker buildx build --push -t gcr.io/k8s-staging-csi/csi-node-driver-registrar:latest --platform=linux/amd64,linux/s390x -f Dockerfile.multiarch .
&& docker buildx build --load -t gcr.io/$_STAGING_PROJECT/csi-node-driver-registrar:amd64-$_GIT_TAG --platform=linux/amd64 -f Dockerfile.multiarch . \
&& docker push gcr.io/$_STAGING_PROJECT/csi-node-driver-registrar:amd64-$_GIT_TAG \
&& docker buildx build --load -t gcr.io/$_STAGING_PROJECT/csi-node-driver-registrar:s390x-$_GIT_TAG --platform=linux/s390x -f Dockerfile.multiarch . \
&& docker push gcr.io/$_STAGING_PROJECT/csi-node-driver-registrar:s390x-$_GIT_TAG \
&& docker manifest create --amend gcr.io/$_STAGING_PROJECT/csi-node-driver-registrar:$_GIT_TAG \
gcr.io/$_STAGING_PROJECT/csi-node-driver-registrar:amd64-$_GIT_TAG \
gcr.io/$_STAGING_PROJECT/csi-node-driver-registrar:s390x-$_GIT_TAG \
&& docker manifest push -p gcr.io/$_STAGING_PROJECT/csi-node-driver-registrar:$_GIT_TAG
substitutions:
# _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and
# can be used as a substitution
_GIT_TAG: '12345'
# _PULL_BASE_REF will contain the ref that was pushed to to trigger this build -
# a branch like 'master' or 'release-0.2', or a tag like 'v0.2'.
_PULL_BASE_REF: 'master'

_STAGING_PROJECT: 'k8s-staging-csi'