diff --git a/Makefile b/Makefile index eaf2cf09..d4def774 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # ============= # This file is automatically generated from the templates in stackabletech/operator-templating -# DON'T MANUALLY EDIT THIS FILE +# DO NOT MANUALLY EDIT THIS FILE # ============= # This script requires https://github.com/mikefarah/yq (not to be confused with https://github.com/kislyuk/yq) @@ -10,7 +10,12 @@ TAG := $(shell git rev-parse --short HEAD) -VERSION := $(shell cargo metadata --format-version 1 | jq '.packages[] | select(.name=="stackable-secret-operator") | .version') +VERSION := $(shell cargo metadata --format-version 1 | jq -r '.packages[] | select(.name=="stackable-secret-operator") | .version') +IS_NIGHTLY := $(shell echo "${VERSION}" | grep -- '-nightly$$') +# When rendering docs we want to simplify the version number slightly, only rendering "nightly" for nightly branches +# (since we only render nightlies for the active development trunk anyway) and chopping off the semver patch version otherwise +DOCS_VERSION := $(if ${IS_NIGHTLY},nightly,$(shell echo "${VERSION}" | sed 's/^\([0-9]\+\.[0-9]\+\)\..*$$/\1/')) +export VERSION IS_NIGHTLY DOCS_VERSION SHELL=/bin/bash -euo pipefail @@ -38,7 +43,8 @@ chart-clean: rm -rf deploy/helm/secret-operator/crds version: - yq eval -i '.version = ${VERSION} | .appVersion = ${VERSION}' /dev/stdin < deploy/helm/secret-operator/Chart.yaml + yq eval -i '.version = strenv(VERSION) | .appVersion = strenv(VERSION)' /dev/stdin < deploy/helm/secret-operator/Chart.yaml + yq eval -i '.version = strenv(DOCS_VERSION) | .prerelease = strenv(IS_NIGHTLY) != ""' /dev/stdin < docs/antora.yml config: if [ -d "deploy/config-spec/" ]; then\ diff --git a/deploy/helm/secret-operator/Chart.yaml b/deploy/helm/secret-operator/Chart.yaml index 49ded58c..6e5563b4 100644 --- a/deploy/helm/secret-operator/Chart.yaml +++ b/deploy/helm/secret-operator/Chart.yaml @@ -1,7 +1,7 @@ --- apiVersion: v2 name: secret-operator -version: 0.5.0-nightly +version: "0.5.0-nightly" appVersion: "0.5.0-nightly" description: The Stackable Operator for Stackable Secret Operator home: https://github.com/stackabletech/secret-operator diff --git a/docs/antora.yml b/docs/antora.yml index 12b657d1..52bd92ec 100644 --- a/docs/antora.yml +++ b/docs/antora.yml @@ -4,3 +4,4 @@ version: nightly title: Stackable Secret Operator nav: - modules/ROOT/nav.adoc +prerelease: true