diff --git a/Makefile b/Makefile index ee77a338..45a46e93 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,8 @@ TAG?=latest +VERSION?=$(shell grep 'VERSION' pkg/version/version.go | awk '{ print $$4 }' | tr -d '"') +VERSION_MINOR:=$(shell grep 'VERSION' pkg/version/version.go | awk '{ print $$4 }' | tr -d '"' | rev | cut -d'.' -f2- | rev) +PATCH:=$(shell grep 'VERSION' pkg/version/version.go | awk '{ print $$4 }' | tr -d '"' | awk -F. '{print $$NF}') + build: docker build -t stefanprodan/steerer:$(TAG) . -f Dockerfile @@ -12,7 +16,36 @@ test: verify-codegen: ./hack/verify-codegen.sh -helm: +helm-package: cd chart/ && helm package steerer/ mv chart/*.tgz docs/ helm repo index docs --url https://stefanprodan.github.io/steerer --merge ./docs/index.yaml + +helm-up: + helm upgrade --install steerer ./chart/steerer --namespace=istio-system + +version-set: + @next="$(TAG)" && \ + current="$(VERSION)" && \ + sed -i '' "s/$$current/$$next/g" pkg/version/version.go && \ + sed -i '' "s/steerer:$$current/steerer:$$next/g" artifacts/steerer/deployment.yaml && \ + sed -i '' "s/tag: $$current/tag: $$next/g" chart/steerer/values.yaml && \ + sed -i '' "s/appVersion: $$current/appVersion: $$next/g" chart/steerer/Chart.yaml && \ + echo "Version $$next set in code, deployment and chart" + +version-up: + @next="$(VERSION_MINOR).$$(($(PATCH) + 1))" && \ + current="$(VERSION)" && \ + sed -i '' "s/$$current/$$next/g" pkg/version/version.go && \ + sed -i '' "s/steerer:$$current/steerer:$$next/g" artifacts/steerer/deployment.yaml && \ + sed -i '' "s/tag: $$current/tag: $$next/g" chart/steerer/values.yaml && \ + sed -i '' "s/appVersion: $$current/appVersion: $$next/g" chart/steerer/Chart.yaml && \ + echo "Version $$next set in code, deployment and chart" + +dev-up: version-up + @echo "Starting build/push/deploy pipeline for $(VERSION)" + docker build -t stefanprodan/steerer:$(VERSION) . -f Dockerfile + docker push stefanprodan/steerer:$(VERSION) + helm upgrade --install steerer ./chart/steerer --namespace=istio-system + + diff --git a/artifacts/steerer/deployment.yaml b/artifacts/steerer/deployment.yaml index 3860d003..7d9a5a36 100644 --- a/artifacts/steerer/deployment.yaml +++ b/artifacts/steerer/deployment.yaml @@ -22,7 +22,7 @@ spec: serviceAccountName: steerer containers: - name: steerer - image: stefanprodan/steerer + image: stefanprodan/steerer:0.0.1-beta.5 imagePullPolicy: Always ports: - name: http diff --git a/chart/steerer/Chart.yaml b/chart/steerer/Chart.yaml index cd00ea52..68f6b3ac 100644 --- a/chart/steerer/Chart.yaml +++ b/chart/steerer/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v1 -appVersion: "0.0.1" -description: Steerer is a Kubernetes operator that automates the promotion of canary deployments using Istio routing for traffic shifting and Prometheus metrics for canary analysis. name: steerer version: 0.0.1 +appVersion: 0.0.1-beta.5 +description: Steerer is a Kubernetes operator that automates the promotion of canary deployments using Istio routing for traffic shifting and Prometheus metrics for canary analysis. diff --git a/chart/steerer/values.yaml b/chart/steerer/values.yaml index 6b05ccdd..9963cafa 100644 --- a/chart/steerer/values.yaml +++ b/chart/steerer/values.yaml @@ -2,7 +2,7 @@ image: repository: stefanprodan/steerer - tag: 0.0.1 + tag: 0.0.1-beta.5 pullPolicy: IfNotPresent controlLoopInterval: "10s" diff --git a/docs/index.yaml b/docs/index.yaml index 251e4359..faae78f2 100755 --- a/docs/index.yaml +++ b/docs/index.yaml @@ -2,14 +2,14 @@ apiVersion: v1 entries: steerer: - apiVersion: v1 - appVersion: 0.0.1 - created: 2018-09-26T20:25:28.806298013+03:00 + appVersion: 0.0.1-beta.5 + created: 2018-09-26T23:03:14.009673769+03:00 description: Steerer is a Kubernetes operator that automates the promotion of canary deployments using Istio routing for traffic shifting and Prometheus metrics for canary analysis. - digest: f443ad5cd5ac9ad972f241663f4a7fc19442fa2c08fc13e02c58be4c849b3956 + digest: cdbbb52ac8555af6ea0531feb9570d753c3648c940ad2b0b6e2ff9473602301a name: steerer urls: - https://stefanprodan.github.io/steerer/steerer-0.0.1.tgz version: 0.0.1 -generated: 2018-09-26T20:25:28.80532437+03:00 +generated: 2018-09-26T23:03:14.009180667+03:00 diff --git a/docs/steerer-0.0.1.tgz b/docs/steerer-0.0.1.tgz index efd75a59..a1a1cf90 100644 Binary files a/docs/steerer-0.0.1.tgz and b/docs/steerer-0.0.1.tgz differ diff --git a/pkg/version/version.go b/pkg/version/version.go index ad871ee1..dfeb4d61 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -1,4 +1,4 @@ package version -var VERSION = "unknown" +var VERSION = "0.0.1-beta.5" var REVISION = "unknown"