Skip to content

Commit a059a51

Browse files
pleshakovDean-Coakley
authored andcommitted
Add release scripts
1 parent 3d0b5d1 commit a059a51

File tree

3 files changed

+86
-0
lines changed

3 files changed

+86
-0
lines changed

hack/changelog-template.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
### %%IC_VERSION%%
3+
4+
CHANGES:
5+
* Update NGINX version to X.Y.Z.
6+
* Update NGINX Plus version to RX.
7+
8+
HELM CHART:
9+
* The version of the Helm chart is now %%HELM_CHART_VERSION%%.
10+
11+
UPGRADE:
12+
* For NGINX, use the %%IC_VERSION%% image from our DockerHub: `nginx/nginx-ingress:%%IC_VERSION%%` or `nginx/nginx-ingress:%%IC_VERSION%%-alpine`
13+
* For NGINX Plus, please build your own image using the %%IC_VERSION%% source code.
14+
* For Helm, use version %%HELM_CHART_VERSION%% of the chart.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
3+
# Updates the files required for a new minor release. Run this script in the master branch.
4+
#
5+
# Usage:
6+
# hack/prepare-minor-release-in-master.sh ic-version helm-chart-version
7+
#
8+
# Example:
9+
# hack/prepare-minor-release-in-master.sh 1.5.5 0.3.5
10+
11+
if [ $# != 2 ];
12+
then
13+
echo "Invalid number of arguments" 1>&2
14+
echo "Usage: $0 ic-version helm-chart-version" 1>&2
15+
exit 1
16+
fi
17+
18+
ic_version=$1
19+
helm_chart_version=$2
20+
21+
prev_ic_version=$(echo $ic_version | awk -F. '{ printf("%s.%s.%d", $1, $2, $3-1) }')
22+
prev_helm_chart_version=$(echo $helm_chart_version | awk -F. '{ printf("%s.%s.%d", $1, $2, $3-1) }')
23+
24+
sed -i "" "s/$prev_ic_version/$ic_version/g" README.md
25+
26+
sed -i "" "1r hack/changelog-template.txt" CHANGELOG.md
27+
sed -i "" -e "s/%%IC_VERSION%%/$ic_version/g" -e "s/%%HELM_CHART_VERSION%%/$helm_chart_version/g" CHANGELOG.md

hack/prepare-minor-release.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env bash
2+
3+
# Updates the files required for a new minor release. Run this script in the release branch.
4+
#
5+
# Usage:
6+
# hack/prepare-minor-release.sh ic-version helm-chart-version
7+
#
8+
# Example:
9+
# hack/prepare-minor-release.sh 1.5.5 0.3.5
10+
11+
FILES_TO_UPDATE_IC_VERSION=(
12+
Makefile
13+
README.md
14+
build/README.md
15+
deployments/daemon-set/nginx-ingress.yaml
16+
deployments/daemon-set/nginx-plus-ingress.yaml
17+
deployments/deployment/nginx-ingress.yaml
18+
deployments/deployment/nginx-plus-ingress.yaml
19+
deployments/helm-chart/Chart.yaml
20+
deployments/helm-chart/README.md
21+
deployments/helm-chart/values-icp.yaml
22+
deployments/helm-chart/values-plus.yaml
23+
deployments/helm-chart/values.yaml
24+
)
25+
26+
FILE_TO_UPDATE_HELM_CHART_VERSION=( deployments/helm-chart/Chart.yaml )
27+
28+
if [ $# != 2 ];
29+
then
30+
echo "Invalid number of arguments" 1>&2
31+
echo "Usage: $0 ic-version helm-chart-version" 1>&2
32+
exit 1
33+
fi
34+
35+
ic_version=$1
36+
helm_chart_version=$2
37+
38+
prev_ic_version=$(echo $ic_version | awk -F. '{ printf("%s.%s.%d", $1, $2, $3-1) }')
39+
prev_helm_chart_version=$(echo $helm_chart_version | awk -F. '{ printf("%s.%s.%d", $1, $2, $3-1) }')
40+
41+
sed -i "" "s/$prev_ic_version/$ic_version/g" ${FILES_TO_UPDATE_IC_VERSION[*]}
42+
sed -i "" "s/$prev_helm_chart_version/$helm_chart_version/g" ${FILE_TO_UPDATE_HELM_CHART_VERSION[*]}
43+
44+
sed -i "" "1r hack/changelog-template.txt" CHANGELOG.md
45+
sed -i "" -e "s/%%IC_VERSION%%/$ic_version/g" -e "s/%%HELM_CHART_VERSION%%/$helm_chart_version/g" CHANGELOG.md

0 commit comments

Comments
 (0)