From e3303cf7c30cea604aadc3edc9f618ad3b8d1f29 Mon Sep 17 00:00:00 2001 From: Kingdon Barrett Date: Tue, 27 Jun 2023 12:15:39 -0400 Subject: [PATCH 1/3] add release machinery to Makefile Signed-off-by: Kingdon Barrett --- Makefile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Makefile b/Makefile index fb16d46..393599c 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,4 @@ +.PHONY: version-set prerel release git-status .PHONY: foreman lib clean test all docker .PHONY: base gems gem-cache clean-cache gems-base @@ -8,9 +9,33 @@ GEMS_TAG:=gems GEM_CACHE_TAG:=gem-cache PLATFORM:=linux/arm64 OUTIMAGE:=kingdonb/opernator +VERSION:=$(shell rake app:version | awk '{ print $$3 }') all: clean lib test +release: git-status + git tag $(VERSION) + git push origin $(VERSION) + +prerel: set-version + +# https://kgolding.co.uk/snippets/makefile-check-git-status/ +git-status: + @status=$$(git status --porcelain); \ + if [ ! -z "$${status}" ]; \ + then \ + echo "Error - working directory is dirty. Commit those changes!"; \ + exit 1; \ + fi + +set-version: + rake app:render + @next="$$(rake app:version | awk '{ print $$3 }')" && \ + current="$(VERSION)" && \ + rake app:version && \ + /usr/bin/sed -i '' "s/newTag: $$current/newTag: $$next/g" deploy/overlays/production/kustomization.yaml && \ + echo "Version $$next set in code and manifests" + docker: # docker pull --platform $(PLATFORM) $(IMAGE):$(BASE_TAG) # docker pull --platform $(PLATFORM) $(IMAGE):$(GEMS_TAG) From f12e6c858400b471af3654814dc3df8b20a09267 Mon Sep 17 00:00:00 2001 From: Kingdon Barrett Date: Tue, 27 Jun 2023 12:36:07 -0400 Subject: [PATCH 2/3] echo current version during 'make prerel' Signed-off-by: Kingdon Barrett --- Makefile | 1 + config/version.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 393599c..002e1a7 100644 --- a/Makefile +++ b/Makefile @@ -32,6 +32,7 @@ set-version: rake app:render @next="$$(rake app:version | awk '{ print $$3 }')" && \ current="$(VERSION)" && \ + echo "Replacing current version strings: $$current" && \ rake app:version && \ /usr/bin/sed -i '' "s/newTag: $$current/newTag: $$next/g" deploy/overlays/production/kustomization.yaml && \ echo "Version $$next set in code and manifests" diff --git a/config/version.yml b/config/version.yml index dee0c8a..730f958 100644 --- a/config/version.yml +++ b/config/version.yml @@ -8,7 +8,7 @@ minor: 0 patch: 3 # meta: rc.1 # milestone: 4 -build: 219 +build: 226 committer: Kingdon Barrett build_date: 2023-06-27 From d67561b43a0a3e3e103bf1f6fa34be2a96c5787e Mon Sep 17 00:00:00 2001 From: Kingdon Barrett Date: Tue, 27 Jun 2023 12:36:41 -0400 Subject: [PATCH 3/3] Release 0.1.0 make prerel Signed-off-by: Kingdon Barrett --- config/version.yml | 6 +++--- deploy/overlays/production/kustomization.yaml | 2 +- lib/templates/version.yml.erb | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/version.yml b/config/version.yml index 730f958..5b56b20 100644 --- a/config/version.yml +++ b/config/version.yml @@ -4,11 +4,11 @@ # instead edit the file application/lib/templates/version.yml.erb major: 0 -minor: 0 -patch: 3 +minor: 1 +patch: 0 # meta: rc.1 # milestone: 4 -build: 226 +build: 227 committer: Kingdon Barrett build_date: 2023-06-27 diff --git a/deploy/overlays/production/kustomization.yaml b/deploy/overlays/production/kustomization.yaml index 6753515..13a96ea 100644 --- a/deploy/overlays/production/kustomization.yaml +++ b/deploy/overlays/production/kustomization.yaml @@ -10,4 +10,4 @@ resources: images: - name: ghcr.io/kingdonb/stats-tracker-ghcr newName: ghcr.io/kingdonb/stats-tracker-ghcr - newTag: 0.0.3 + newTag: 0.1.0 diff --git a/lib/templates/version.yml.erb b/lib/templates/version.yml.erb index c50a9c7..35f6399 100644 --- a/lib/templates/version.yml.erb +++ b/lib/templates/version.yml.erb @@ -4,8 +4,8 @@ # instead edit the file application/lib/templates/version.yml.erb major: 0 -minor: 0 -patch: 3 +minor: 1 +patch: 0 # meta: rc.1 # milestone: 4 build: <%= `git rev-list HEAD|wc -l`.strip %>