Skip to content
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
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ endif
GIT_COMMIT_SHORT := $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")

# Container image configuration.
IMAGE_REGISTRY ?= ghcr.io/oxidecomputer
IMAGE_REGISTRY ?= localhost
IMAGE_NAME ?= oxide-cloud-controller-manager
IMAGE_TAG ?= $(patsubst v%,%,$(VERSION))-$(GIT_COMMIT_SHORT)
IMAGE_FULL ?= $(if $(IMAGE_REGISTRY),$(IMAGE_REGISTRY)/)$(IMAGE_NAME):$(IMAGE_TAG)
Expand All @@ -18,20 +18,24 @@ IMAGE_FULL ?= $(if $(IMAGE_REGISTRY),$(IMAGE_REGISTRY)/)$(IMAGE_NAME):$(IMAGE_TA
test:
@echo "Running tests in container..."
$(CONTAINER_RUNTIME) build \
--file Containerfile \
--build-arg GO_CONTAINER_IMAGE=$(GO_CONTAINER_IMAGE) \
--build-arg VERSION=$(VERSION) \
--target builder \
-t $(IMAGE_NAME)-builder:$(IMAGE_TAG) \
--tag $(if $(IMAGE_REGISTRY),$(IMAGE_REGISTRY)/)$(IMAGE_NAME)-builder:$(IMAGE_TAG) \
.
$(CONTAINER_RUNTIME) run --rm $(IMAGE_NAME)-builder:$(IMAGE_TAG) go test -v ./...

.PHONY: build
build:
@echo "Building container image: $(IMAGE_FULL)"
$(CONTAINER_RUNTIME) build \
--file Containerfile \
--build-arg GO_CONTAINER_IMAGE=$(GO_CONTAINER_IMAGE) \
--build-arg VERSION=$(VERSION) \
-t $(IMAGE_FULL) \
--annotation org.opencontainers.image.description='Oxide Cloud Controller Manager' \
--annotation org.opencontainers.image.source=https://github.com/oxidecomputer/oxide-cloud-controller-manager \
--tag $(IMAGE_FULL) \
.

.PHONY: push
Expand Down
22 changes: 22 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,25 @@ podman run \
--cloud-provider oxide \
--kubeconfig /tmp/kubeconfig.yaml
----

== Release Process

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.
+
[source,shell]
----
IMAGE_REGISTRY=ghcr.io/oxidecomputer IMAGE_TAG=0.1.0 make build
----

. Push the container image using to correct image registry.
+
[source,shell]
----
IMAGE_REGISTRY=ghcr.io/oxidecomputer IMAGE_TAG=0.1.0 make push
----

. Bump the `VERSION` within the `Makefile` to the next version.