Skip to content

Commit

Permalink
Update Release section in Makefile
Browse files Browse the repository at this point in the history
This commit applies some conventions to the targets and documentation
in the release section. Mostly documenting all the tools we use to
perform releases.
  • Loading branch information
rhmdnd committed Oct 18, 2022
1 parent e8d4a42 commit be8c67a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -614,12 +614,12 @@ must-gather: must-gather-image must-gather-push ## Build and push the must-gath
##@ Release

.PHONY: package-version-to-tag
package-version-to-tag: check-operator-version
package-version-to-tag: check-operator-version ## Explicitly override $TAG with $VERSION. This is a useful utility for other release targets.
@echo "Overriding default tag '$(TAG)' with release tag '$(VERSION)'"
$(eval TAG = $(VERSION))

.PHONY: git-release
git-release: fetch-git-tags package-version-to-tag changelog
git-release: fetch-git-tags package-version-to-tag changelog ## Update project files with new version information.
git checkout -b "release-v$(TAG)"
sed -i "s/\(.*Version = \"\).*/\1$(TAG)\"/" version/version.go
sed -i "s/\(.*VERSION?=\).*/\1$(TAG)/" version.Makefile
Expand All @@ -628,15 +628,15 @@ git-release: fetch-git-tags package-version-to-tag changelog
git restore config/manager/kustomization.yaml

.PHONY: fetch-git-tags
fetch-git-tags:
fetch-git-tags: ## Fetch tags for the repository. This is a useful utility for other release targets.
# Make sure we are caught up with tags
git fetch -t

.PHONY: prepare-release
prepare-release: package-version-to-tag images git-release
prepare-release: package-version-to-tag images git-release ## Make local changes to release a new version of the operator. Changes are staged locally for review.

.PHONY: push-release
push-release: package-version-to-tag ## Do an official release (Requires permissions)
push-release: package-version-to-tag ## Create a commit for the release change, tag the new version, and push the change for review using a dedicated release branch. Requires a ComplianceAsCode/compliance-operator maintainer.
git commit -m "Release v$(TAG)"
git tag "v$(TAG)"
git push $(GIT_REMOTE) "v$(TAG)"
Expand All @@ -646,7 +646,7 @@ push-release: package-version-to-tag ## Do an official release (Requires permiss
git push $(GIT_REMOTE) ocp-0.1

.PHONY: release-images
release-images: package-version-to-tag push catalog
release-images: package-version-to-tag push catalog ## Build container images, bundle images, and catalog images and push them to an image registry (default: quay.io/compliance-operator).
$(RUNTIME) image tag $(OPERATOR_IMAGE) $(OPERATOR_TAG_BASE):latest
$(RUNTIME) image tag $(BUNDLE_IMG) $(BUNDLE_TAG_BASE):latest
$(RUNTIME) image tag $(CATALOG_IMG) $(CATALOG_TAG_BASE):latest
Expand All @@ -655,5 +655,5 @@ release-images: package-version-to-tag push catalog
$(MAKE) catalog-push TAG=latest

.PHONY: changelog
changelog:
changelog: ## Move all unreleased notes in the CHANGELOG to a section dedicated to $TAG. This is a useful utility for other release targets.
@utils/update_changelog.sh "$(TAG)"

0 comments on commit be8c67a

Please sign in to comment.