diff --git a/.github/workflows/end2end.yml b/.github/workflows/end2end.yml index 71a9143e..dac35abd 100644 --- a/.github/workflows/end2end.yml +++ b/.github/workflows/end2end.yml @@ -57,7 +57,10 @@ jobs: run: echo "value=$(git describe --tags --abbrev=0)-commit-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - name: Install Sparrow run: | - helm upgrade -i sparrow \ + cd chart && make package + version="$(make WITH_V=0 version)" + cd .. + helm upgrade -i sparrow ./chart/sparrow-${version}.tgz \ --atomic \ --timeout 300s \ --set image.tag=${{ steps.version.outputs.value }} \ @@ -66,8 +69,7 @@ jobs: --set sparrowConfig.loader.interval=5s \ --set sparrowConfig.loader.file.path=/config/.sparrow.yaml \ --set checksConfig.health.interval=1s \ - --set checksConfig.health.timeout=1s \ - ./chart + --set checksConfig.health.timeout=1s - name: Check Pods run: | diff --git a/chart/.gitignore b/chart/.gitignore new file mode 100644 index 00000000..85ac85a2 --- /dev/null +++ b/chart/.gitignore @@ -0,0 +1 @@ +Chart.yaml diff --git a/chart/Chart.yaml b/chart/Chart.template.yaml similarity index 100% rename from chart/Chart.yaml rename to chart/Chart.template.yaml diff --git a/chart/Makefile b/chart/Makefile index 7c08d147..2d675e4f 100644 --- a/chart/Makefile +++ b/chart/Makefile @@ -2,30 +2,31 @@ WITH_V ?= 0 +BASE_VERSION = $(shell (git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") | sed 's/^v//') CHART_VERSION ?= $(shell $(MAKE) -s version) CHART_APP_VERSION ?= $(shell $(MAKE) -s WITH_V=1 version) .PHONY: package package: lint build +.PHONY: gen +gen: + @cp -f Chart.template.yaml Chart.yaml + @sed -i "/^version:.*/c\version: $(BASE_VERSION)" Chart.yaml || echo "version: $(BASE_VERSION)" >> Chart.yaml + @sed -i "/^appVersion:.*/c\appVersion: \"v$(BASE_VERSION)\"" Chart.yaml || echo "appVersion: \"v$(BASE_VERSION)\"" >> Chart.yaml + .PHONY: lint -lint: +lint: gen @helm lint . .PHONY: build -build: +build: gen @helm package . --version $(CHART_VERSION) --app-version $(CHART_APP_VERSION) .PHONY: docs -docs: - @VERSION=$$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0"); \ - VERSION=$${VERSION#v}; \ - cp -f Chart.yaml Chart.yaml.bak; \ - sed -i "s/^version:.*/version: $${VERSION}/" Chart.yaml; \ - sed -i "s/^appVersion:.*/appVersion: \"v$${VERSION}\"/" Chart.yaml; \ - echo "Generating docs for version $${VERSION} (appVersion: v$${VERSION})"; \ - helm-docs; \ - mv -f Chart.yaml.bak Chart.yaml +docs: gen + @echo "Generating docs for version $(BASE_VERSION) (appVersion: v$(BASE_VERSION))" + @helm-docs .PHONY: version version: @@ -33,7 +34,7 @@ version: if [ -n "$$TAG" ]; then \ VERSION="$$TAG"; \ else \ - VERSION="$$(git describe --tags --abbrev=0 2>/dev/null)-commit-$$(git rev-parse --short HEAD 2>/dev/null || echo "unknown")"; \ + VERSION="v$(BASE_VERSION)-commit-$$(git rev-parse --short HEAD 2>/dev/null || echo "unknown")"; \ fi; \ if [ "$(WITH_V)" = "1" ]; then \ echo "$$VERSION"; \ diff --git a/chart/README.md b/chart/README.md index 63ac8319..0e2c24f7 100644 --- a/chart/README.md +++ b/chart/README.md @@ -1,6 +1,6 @@ # sparrow -![Version: 0.5.0-rc2](https://img.shields.io/badge/Version-0.5.0--rc2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.5.0-rc2](https://img.shields.io/badge/AppVersion-v0.5.0--rc2-informational?style=flat-square) +![Version: 0.5.0-rc3](https://img.shields.io/badge/Version-0.5.0--rc3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.5.0-rc3](https://img.shields.io/badge/AppVersion-v0.5.0--rc3-informational?style=flat-square) A Helm chart to install Sparrow