diff --git a/Makefile b/Makefile index 6a50384..42d6ba6 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ VERSION ?= v0.1.0 GO_CONTAINER_IMAGE ?= docker.io/golang:1.25.3 +# Set this to non-empty when building and pushing a release. +RELEASE ?= + CONTAINER_RUNTIME ?= $(shell command -v podman 2>/dev/null || command -v docker 2>/dev/null) ifeq ($(CONTAINER_RUNTIME),) $(error No container runtime found. Please install podman or docker) @@ -9,9 +12,9 @@ endif GIT_COMMIT_SHORT := $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown") # Container image configuration. -IMAGE_REGISTRY ?= localhost +IMAGE_REGISTRY ?= ghcr.io/oxidecomputer IMAGE_NAME ?= oxide-cloud-controller-manager -IMAGE_TAG ?= $(patsubst v%,%,$(VERSION))-$(GIT_COMMIT_SHORT) +IMAGE_TAG ?= $(patsubst v%,%,$(VERSION))$(if $(RELEASE),,-$(GIT_COMMIT_SHORT)) IMAGE_FULL ?= $(if $(IMAGE_REGISTRY),$(IMAGE_REGISTRY)/)$(IMAGE_NAME):$(IMAGE_TAG) .PHONY: test @@ -40,10 +43,5 @@ build: .PHONY: push push: - @if [ -z "$(IMAGE_REGISTRY)" ]; then \ - echo "Error: IMAGE_REGISTRY must be set to push images"; \ - echo "Example: make image-push IMAGE_REGISTRY=ghcr.io/oxidecomputer"; \ - exit 1; \ - fi @echo "Pushing container image: $(IMAGE_FULL)" $(CONTAINER_RUNTIME) push $(IMAGE_FULL) diff --git a/README.adoc b/README.adoc index 32a37cf..f802a24 100644 --- a/README.adoc +++ b/README.adoc @@ -109,18 +109,28 @@ The release process is manual and runs from a developer's workstation for now. . Check out the revision to be released. Ensure the working copy is clean. -. Build the container image using the correct image registry and tag. +. Build the container image. + [source,shell] ---- -IMAGE_REGISTRY=ghcr.io/oxidecomputer IMAGE_TAG=0.1.0 make build +RELEASE=true make build ---- -. Push the container image using to correct image registry. +. Push the container image. + [source,shell] ---- -IMAGE_REGISTRY=ghcr.io/oxidecomputer IMAGE_TAG=0.1.0 make push +RELEASE=true make push ---- -. Bump the `VERSION` within the `Makefile` to the next version. +. Create a GitHub release. + +.. Create and push a Git tag with the v-prefixed `VERSION` (e.g., v0.1.0). + +.. Create the GitHub release for the newly pushed tag. Automatically generate the release notes. + +. Open a pull request with the following changes. + +.. Update the `VERSION` within the `Makefile` to the next version. + +.. Update the image tag within `manifests/oxide-cloud-controller-manager.yaml`. diff --git a/manifests/oxide-cloud-controller-manager.yaml b/manifests/oxide-cloud-controller-manager.yaml index 13f3401..ed07927 100644 --- a/manifests/oxide-cloud-controller-manager.yaml +++ b/manifests/oxide-cloud-controller-manager.yaml @@ -27,7 +27,7 @@ spec: - key: "node-role.kubernetes.io/control-plane" effect: NoSchedule containers: - - image: docker.io/sudomateo/oxide-cloud-controller-manager:latest + - image: ghcr.io/oxidecomputer/oxide-cloud-controller-manager:0.1.0 name: oxide-cloud-controller-manager command: - "/usr/bin/oxide-cloud-controller-manager"