-
Notifications
You must be signed in to change notification settings - Fork 2
/
build
executable file
·63 lines (48 loc) · 1.94 KB
/
build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env bash
set -euo pipefail
if [[ "${1-}" == "-h" || ${1-} == "--help" ]];then
echo "Using speedmgmt, build the helm chart for the latest version of Speedscale."
exit 0
fi
# always run from this dir
cd "$(dirname "$0")"
VERSION=$(speedmgmt version | awk '{printf $3}')
VERSION=${VERSION:1}
# generate the helm chart
echo "generating chart..."
speedmgmt generate helm "$VERSION" > /dev/null
if [[ -z "$VERSION" ]];then
echo "It looks like you're missing a required binary. This script is intended for Speedscale engineers. Use the helm command to interact with charts."
exit 1
fi
mv "${VERSION}" "charts/${VERSION}"
# ensure we support the image tag
IMAGE_TAG=$(yq .image.tag "charts/${VERSION}/values.yaml")
echo "verifying image tag ${IMAGE_TAG}..."
# checking for the image version install script is a hacky way
# to ensure we have released this version
curl -sf "https://downloads.speedscale.com/speedctl/${IMAGE_TAG}/install" > /dev/null
# use the chart's README as this repo's README
cp "charts/${VERSION}/README.md" .
# add a sample values file for the user to copy
cp "charts/${VERSION}/values.yaml" .
# bundle it up
echo "packaging chart..."
helm package "charts/${VERSION}" -d charts
# update index yaml
helm repo index . --merge index.yaml --url https://speedscale.github.io/operator-helm/
echo "
Excellent, you've built the helm chart from the latest version of speedmgmt.
Now we need to update speedscale/partner-charts and submit a PR to the upstream
rancher/partner-charts.
Update the fork branch of speedscale/partner-charts with 'git pull https://github.com/rancher/partner-charts main-source'
Details at https://github.com/rancher/partner-charts/tree/main-source.
The commands should look something like this:
$ vim packages/speedscale-operator/package.yaml # to bump the URL and packageVersion
$ PACKAGE=speedscale-operator make prepare
$ make validate
$ # git commit and push one or more times
$ make validate
$ make clean
$ submit PR
"