Skip to content

Commit eb9dcf8

Browse files
committed
Allow custom Kube versions in Helm chart (#116)
This includes hosted kubernetes versions, like EKS and GKE, or pre-release versions. Also refactoring release code. Signed-off-by: Houston Putman <[email protected]>
1 parent 2be929c commit eb9dcf8

File tree

6 files changed

+47
-27
lines changed

6 files changed

+47
-27
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,15 @@ version:
2828

2929
clean:
3030
rm -rf ./bin
31+
rm -rf ./release-artifacts
3132

3233
mod-tidy:
3334
export GO111MODULE=on; go mod tidy
3435

35-
release: manifests helm-check
36-
VERSION=${VERSION} bash hack/setup_release.sh
36+
release: clean manifests helm-check
37+
VERSION=${VERSION} bash hack/release/update_versions.sh
38+
VERSION=${VERSION} bash hack/release/build_helm.sh
39+
VERSION=${VERSION} bash hack/release/setup_release.sh
3740

3841
###
3942
# Building

docs/charts/index.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ entries:
33
solr-operator:
44
- apiVersion: v1
55
appVersion: v0.2.5
6-
created: "2020-05-14T14:31:51.166349-04:00"
6+
created: "2020-05-20T12:28:07.211507-04:00"
77
description: The Solr Operator enables easy management of Solr resources within
88
Kubernetes.
9-
digest: cdc896541390137c0f8aaab7b51f4b944e6cde23f9d8da5ffb0486e20efa5c48
9+
digest: 8ccc461fbc1ccd6c149fc34b40f049155f41131c03d291bca1f469cddb0c09dd
1010
home: https://github.com/bloomberg/solr-operator
1111
icon: https://lucene.apache.org/theme/images/solr/identity/Solr_Logo_on_white.png
1212
keywords:
@@ -15,15 +15,14 @@ entries:
1515
- search
1616
- lucene
1717
- operator
18-
kubeVersion: '>= 1.13.0'
18+
kubeVersion: '>= 1.13.0-0'
1919
maintainers:
2020
2121
name: Houston Putman
2222
name: solr-operator
2323
sources:
2424
- https://github.com/bloomberg/solr-operator
25-
type: application
2625
urls:
2726
- https://github.com/bloomberg/solr-operator/releases/download/v0.2.5/solr-operator-0.2.5.tgz
2827
version: 0.2.5
29-
generated: "2020-05-14T14:31:51.161206-04:00"
28+
generated: "2020-05-20T12:28:07.204853-04:00"

hack/release/build_helm.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
# exit immediately when a command fails
3+
set -e
4+
# only exit with zero if all commands of the pipeline exit successfully
5+
set -o pipefail
6+
# error on unset variables
7+
set -u
8+
9+
echo "Packaging helm chart for version ${VERSION}"
10+
11+
# Package and Index the helm charts, create release artifacts to upload in GithubRelease
12+
mkdir -p release-artifacts
13+
14+
rm -rf release-artifacts/*
15+
16+
helm package helm/* --app-version "${VERSION}" --version "${VERSION#v}" -d release-artifacts/
17+
18+
helm repo index release-artifacts/ --url https://github.com/bloomberg/solr-operator/releases/download/${VERSION}/ --merge docs/charts/index.yaml
19+
20+
mv release-artifacts/index.yaml docs/charts/index.yaml

hack/release/setup_release.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
# exit immediately when a command fails
3+
set -e
4+
# only exit with zero if all commands of the pipeline exit successfully
5+
set -o pipefail
6+
# error on unset variables
7+
set -u
8+
9+
echo "Setting up Release ${VERSION}, making last commit."
10+
11+
# Package and Index the helm charts, create release artifacts to upload in GithubRelease
12+
cp config/crd/bases/* release-artifacts/.
13+
14+
git add helm config docs
15+
16+
git commit -asm "Cutting release version ${VERSION} of the Solr Operator"

hack/setup_release.sh renamed to hack/release/update_versions.sh

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,11 @@ set -o pipefail
66
# error on unset variables
77
set -u
88

9-
echo "Setting up Release ${VERSION}"
9+
echo "Updating the latest version throughout the repo to: ${VERSION}"
1010

1111
# Update default solr-operator version and the helm chart versions.
1212
gawk -i inplace '$1 == "repository:" { tag = ($2 == "bloomberg/solr-operator") }
1313
tag && $1 == "tag:"{$1 = " " $1; $2 = "'"${VERSION}"'"} 1' helm/solr-operator/values.yaml
1414

1515
gawk -i inplace '$1 == "version:"{$1 = $1; $2 = "'"${VERSION#v}"'"} 1' helm/solr-operator/Chart.yaml
1616
gawk -i inplace '$1 == "appVersion:"{$1 = $1; $2 = "'"${VERSION}"'"} 1' helm/solr-operator/Chart.yaml
17-
18-
19-
# Package and Index the helm charts, create release artifacts to upload in GithubRelease
20-
mkdir -p release-artifacts
21-
22-
rm -rf release-artifacts/*
23-
24-
helm package helm/* --app-version "${VERSION}" --version "${VERSION#v}" -d release-artifacts/
25-
26-
helm repo index release-artifacts/ --url https://github.com/bloomberg/solr-operator/releases/download/${VERSION}/ --merge docs/charts/index.yaml
27-
28-
mv release-artifacts/index.yaml docs/charts/index.yaml
29-
30-
cp config/crd/bases/* release-artifacts/.
31-
32-
git add helm config docs
33-
34-
git commit -asm "Cutting release version ${VERSION} of the Solr Operator"

helm/solr-operator/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: solr-operator
44
description: The Solr Operator enables easy management of Solr resources within Kubernetes.
55
version: 0.2.5
66
appVersion: v0.2.5
7-
kubeVersion: ">= 1.13.0"
7+
kubeVersion: ">= 1.13.0-0"
88
home: https://github.com/bloomberg/solr-operator
99
sources:
1010
- https://github.com/bloomberg/solr-operator

0 commit comments

Comments
 (0)