Skip to content

Commit 0ca7c25

Browse files
committed
Set version with make
1 parent eb0ad32 commit 0ca7c25

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

Makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#
33
# The release version is controlled from pkg/version
44

5+
TAG?=latest
56
NAME:=podinfo
67
DOCKER_REPOSITORY:=stefanprodan
78
DOCKER_IMAGE_NAME:=$(DOCKER_REPOSITORY)/$(NAME)
@@ -28,4 +29,14 @@ build-container:
2829
push-container:
2930
docker push $(DOCKER_IMAGE_NAME):$(VERSION)
3031
docker tag $(DOCKER_IMAGE_NAME):$(VERSION) quay.io/$(DOCKER_IMAGE_NAME):$(VERSION)
31-
docker push quay.io/$(DOCKER_IMAGE_NAME):$(VERSION)
32+
docker push quay.io/$(DOCKER_IMAGE_NAME):$(VERSION)
33+
34+
version-set:
35+
@next="$(TAG)" && \
36+
current="$(VERSION)" && \
37+
sed -i '' "s/$$current/$$next/g" pkg/version/version.go && \
38+
sed -i '' "s/tag: $$current/tag: $$next/g" charts/podinfo/values.yaml && \
39+
sed -i '' "s/appVersion: $$current/appVersion: $$next/g" charts/podinfo/Chart.yaml && \
40+
sed -i '' "s/version: $$current/version: $$next/g" charts/podinfo/Chart.yaml && \
41+
sed -i '' "s/podinfo:$$current/podinfo:$$next/g" kustomize/deployment.yaml && \
42+
echo "Version $$next set in code, deployment, chart and kustomize"

charts/podinfo/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v1
2-
version: 1.7.0
3-
appVersion: 1.7.1
2+
version: 2.0.0-beta.1
3+
appVersion: 2.0.0-beta.1
44
name: podinfo
55
engine: gotpl
66
description: Podinfo Helm chart for Kubernetes

charts/podinfo/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ faults:
1212

1313
image:
1414
repository: quay.io/stefanprodan/podinfo
15-
tag: 1.7.1
15+
tag: 2.0.0-beta.1
1616
pullPolicy: IfNotPresent
1717

1818
service:

pkg/version/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
package version
22

3-
var VERSION = "2.0.0-alpha.1"
3+
var VERSION = "2.0.0-beta.1"
44
var REVISION = "unknown"

0 commit comments

Comments
 (0)