diff --git a/Makefile b/Makefile index fb16d46..002e1a7 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,34 @@ 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)" && \ + 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" + docker: # docker pull --platform $(PLATFORM) $(IMAGE):$(BASE_TAG) # docker pull --platform $(PLATFORM) $(IMAGE):$(GEMS_TAG) diff --git a/config/version.yml b/config/version.yml index dee0c8a..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: 219 +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 %>