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

Add cloudbuild-nightly.yaml + release-staging-nightly target #1215

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
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
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,26 @@ RELEASE_ALIAS_TAG=$(PULL_BASE_REF)
release-alias-tag: # Adds the tag to the last build tag.
gcloud container images add-tag $(CONTROLLER_IMG):$(TAG) $(CONTROLLER_IMG):$(RELEASE_ALIAS_TAG)

.PHONY: release-staging-nightly
release-staging-nightly:
# Tags and pushes nightly container images to the staging bucket.
# Invoked via cloudbuild-nightly.yaml by image-builder launched via the configured nightly periodic job.
$(eval NEW_RELEASE_ALIAS_TAG := nightly_$(RELEASE_ALIAS_TAG)_$(shell date +'%Y%m%d'))
echo $(NEW_RELEASE_ALIAS_TAG)
$(MAKE) release-alias-tag TAG=$(RELEASE_ALIAS_TAG) RELEASE_ALIAS_TAG=$(NEW_RELEASE_ALIAS_TAG)
$(MAKE) set-manifest-image MANIFEST_IMG=$(CONTROLLER_IMG) MANIFEST_TAG=$(NEW_RELEASE_ALIAS_TAG)
$(MAKE) set-manifest-pull-policy PULL_POLICY=IfNotPresent
$(MAKE) release-manifests
$(MAKE) release-metadata
$(MAKE) release-templates
$(MAKE) upload-staging-artifacts RELEASE_ALIAS_TAG=$(NEW_RELEASE_ALIAS_TAG)

.PHONY: upload-staging-artifacts
upload-staging-artifacts: ## Upload release artifacts to the staging bucket
# Example manifest location: https://storage.googleapis.com/k8s-staging-cluster-api-aws/components/nightly_main_20240425/infrastructure-components.yaml
# Please note that these files are deleted after a certain period, at the time of this writing 60 days after file creation.
gsutil cp $(RELEASE_DIR)/* gs://$(BUCKET)/components/$(RELEASE_ALIAS_TAG)

.PHONY: release-notes
release-notes: $(RELEASE_NOTES)
$(RELEASE_NOTES)
Expand Down
18 changes: 18 additions & 0 deletions cloudbuild-nightly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# See https://cloud.google.com/cloud-build/docs/build-config
timeout: 3600s
options:
substitution_option: ALLOW_LOOSE
steps:
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20240210-29014a6e3a'
entrypoint: make
env:
- DOCKER_CLI_EXPERIMENTAL=enabled
- TAG=$_GIT_TAG
- PULL_BASE_REF=$_PULL_BASE_REF
args:
- release-staging-nightly
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: 'dev'
2 changes: 1 addition & 1 deletion cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ timeout: 3600s
options:
substitution_option: ALLOW_LOOSE
steps:
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20220609-2e4c91eb7e'
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20240210-29014a6e3a'
entrypoint: make
env:
- DOCKER_CLI_EXPERIMENTAL=enabled
Expand Down
Loading