Skip to content

Commit d149160

Browse files
authored
chore(release): Handle updates for demos (#91)
* refactor(release)!: Rename "both" option to "all" to accomodate the upcoming demo release handling * chore(release): Handle updates for demos
1 parent dd4d64b commit d149160

File tree

6 files changed

+54
-25
lines changed

6 files changed

+54
-25
lines changed

release/README.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ This is the recommended release flow in a nutshell for the release 24.7:
1010
# create and push the release tag
1111
./release/create-release-tag.sh -t 24.7.0 -w products # Only add the -p flag after testing locally first
1212

13-
# monitor the GH action that builds ~80 images for success
13+
# monitor the GH action that builds ~80 images for success.
14+
# build failures alerts will appear in the #notifications-container-images channel.
1415

1516
# continue with the operators ...
1617
# create and push the release branch
@@ -20,6 +21,11 @@ This is the recommended release flow in a nutshell for the release 24.7:
2021
./release/create-release-tag.sh -t 24.7.0 -w operators # Only add the -p flag after testing locally first
2122

2223
# monitor the GH actions that build the operator images for success
24+
# build failures are not yet sent to the #notifications-container-images channel yet.
25+
26+
# continue with the demos ...
27+
# create and push the release branch
28+
./release/create-release-branch.sh -b 24.7 -w demos # Only add the -p flag after testing locally first
2329

2430
# finally patch the changelog file in the main branch
2531
# create PRs for all operators
@@ -54,7 +60,7 @@ A set of scripts that automates some release steps. The release process has mult
5460
### Install requirements
5561

5662
> [!NOTE]
57-
> Nix users will not need to install anything, just enter the `nix-shell` in this repository (if not done automatically via `direnv`).
63+
> Nix users will not need to install anything, just enter the `nix-shell` in this repository (if not done automatically via `direnv`).
5864
> The dependencies will install automatically.
5965
> A nix-shell will be entered for each operator during certain commands, so operator dependencies will be covered too.
6066
@@ -84,20 +90,20 @@ You have to be logged in when running the `post-release.sh` script. The easiest
8490
To create release branches use the `create-release-branch.sh` script, called from the repository root folder. The syntax is given below:
8591

8692
```
87-
./release/create-release-branch.sh -b <release> [-p] [-c] [-w products|operators|both]
93+
./release/create-release-branch.sh -b <release> [-p] [-c] [-w products|operators|demos|all]
8894
```
8995

9096
- `-b <release>`: the release number (mandatory). This must be a semver-compatible value (i.e. without leading zeros) such as `23.1`, `23.10` etc. and will be used to create a branch with the name `release-<release>` e.g. `release-23.1`
9197
- `-p`: push flag (optional, default is "false"). If provided, the created branches plus any changes made as part of this process will be pushed to the origin.
9298
- `-c`: cleanup flag (optional, default is "false"). If provided, the repository folders will be torn down on completion.
93-
- `-w`: where to create the branch. It can be "products", "operators", "both".
99+
- `-w`: where to create the branch. It can be "products", "operators", "demos", "all".
94100

95101
N.B. the flags cannot be combined (e.g. `-p -c` but not `-pc)
96102

97103
e.g.
98104

99105
```shell
100-
./release/create-release-branch.sh -b 23.1 -p -c -w both
106+
./release/create-release-branch.sh -b 23.1 -p -c -w all
101107
```
102108

103109
##### What this script does
@@ -121,20 +127,20 @@ e.g.
121127
To create release tags use the `create-release-tag.sh` script, called from the repository root folder. The syntax is given below:
122128

123129
```
124-
./release/create-release-tag.sh -t <release-tag> [-p] [-c] [-w products|operators|both]
130+
./release/create-release-tag.sh -t <release-tag> [-p] [-c] [-w products|operators|all]
125131
```
126132

127133
- `-t <release-tag>`: the release tag (mandatory). This must be a semver-compatible value (i.e. major/minor/path, without leading zeros) such as `23.1.0`, `23.10.3` etc. and will be used to create a tag with the name
128134
- `-p`: push flag (optional, default is "false"). If provided, the created commits and tags made as part of this process will be pushed to the origin.
129135
- `-c`: cleanup flag (optional, default is "false"). If provided, the repository folders will be torn down on completion.
130-
- `-w`: where to create the tag and update versions in code. It can be "products", "operators", "both".
136+
- `-w`: where to create the tag and update versions in code. It can be "products", "operators", "all".
131137

132138
N.B. the flags cannot be combined (e.g. `-p -c` but not `-pc)
133139

134140
e.g.
135141

136142
```shell
137-
./release/create-release-tag.sh -t 23.1.0 -p -c -w both
143+
./release/create-release-tag.sh -t 23.1.0 -p -c -w all
138144
```
139145

140146
##### What this script does
@@ -226,21 +232,21 @@ Once the release is complete and all steps above have been verified, the documen
226232
To create release tags for bugfix/patch releases use the `create-bugfix-tag.sh` script, called from the repository root folder. The syntax is given below:
227233

228234
```
229-
./release/create-bugfix-tag.sh -t <release-tag> [-p] [-c] [-w products|operators|both] [-i]
235+
./release/create-bugfix-tag.sh -t <release-tag> [-p] [-c] [-w products|operators|all] [-i]
230236
```
231237
232238
- `-t <release-tag>`: the release tag (mandatory). This must be a semver-compatible value (i.e. major/minor/path, without leading zeros) such as `23.1.0`, `23.10.3` etc. and will be used to create a tag with the name
233239
- `-p`: push flag (optional, default is "false"). If provided, the created commits and tags made as part of this process will be pushed to the origin.
234240
- `-c`: cleanup flag (optional, default is "false"). If provided, the repository folders will be torn down on completion.
235-
- `-w`: where to create the tag and update versions in code. It can be "products", "operators", "both".
241+
- `-w`: where to create the tag and update versions in code. It can be "products", "operators", "all".
236242
- `-i`: product image versioning flag (optional, default is "false"). If provided, updates test definitions with product image versions from this release version (i.e. assumes products have been released/tagged, too).
237243
238244
N.B. the flags cannot be combined (e.g. `-p -c` but not `-pc)
239245
240246
e.g.
241247
242248
```shell
243-
./release/create-bugfix-tag.sh -t 23.1.0 -p -c -w both -i
249+
./release/create-bugfix-tag.sh -t 23.1.0 -p -c -w all -i
244250
```
245251

246252
##### What this script does

release/config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
demos-repo: demos
23
images-repo: docker-images
34
operators:
45
- airflow-operator
@@ -16,4 +17,4 @@ operators:
1617
- spark-k8s-operator
1718
- superset-operator
1819
- trino-operator
19-
- zookeeper-operator
20+
- zookeeper-operator

release/create-bugfix-tag.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@ tag_operators() {
4444
#-----------------------------------------------------------
4545
"$TEMP_RELEASE_FOLDER/${operator}"/scripts/docs_templating.sh
4646

47-
git commit -sam "release $RELEASE_TAG"
47+
git commit -sam "release $RELEASE_TAG"
4848
git tag -sm "release $RELEASE_TAG" "$RELEASE_TAG"
4949
push_branch
5050
done < <(yq '... comments="" | .operators[] ' "$INITIAL_DIR"/release/config.yaml)
5151
}
5252

5353
tag_repos() {
54-
if [ "products" == "$WHAT" ] || [ "both" == "$WHAT" ]; then
54+
if [ "products" == "$WHAT" ] || [ "all" == "$WHAT" ]; then
5555
tag_products
5656
fi
57-
if [ "operators" == "$WHAT" ] || [ "both" == "$WHAT" ]; then
57+
if [ "operators" == "$WHAT" ] || [ "all" == "$WHAT" ]; then
5858
tag_operators
5959
fi
6060
}
@@ -116,10 +116,10 @@ check_operators() {
116116
}
117117

118118
checks() {
119-
if [ "products" == "$WHAT" ] || [ "both" == "$WHAT" ]; then
119+
if [ "products" == "$WHAT" ] || [ "all" == "$WHAT" ]; then
120120
check_products
121121
fi
122-
if [ "operators" == "$WHAT" ] || [ "both" == "$WHAT" ]; then
122+
if [ "operators" == "$WHAT" ] || [ "all" == "$WHAT" ]; then
123123
check_operators
124124
fi
125125
}

release/create-release-branch.sh

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,35 @@ update_operators() {
4242
done < <(yq '... comments="" | .operators[] ' "$INITIAL_DIR"/release/config.yaml)
4343
}
4444

45+
update_demos() {
46+
if [ -d "$BASE_DIR/$DEMOS_REPO" ]; then
47+
cd "$BASE_DIR/$DEMOS_REPO"
48+
git pull && git switch "${RELEASE_BRANCH}"
49+
else
50+
git clone --branch main --depth 1 "git@github.com:stackabletech/${DEMOS_REPO}.git" "$BASE_DIR/$DEMOS_REPO"
51+
cd "$BASE_DIR/$DEMOS_REPO"
52+
git switch "${RELEASE_BRANCH}" || git switch -c "${RELEASE_BRANCH}" "${REPOSITORY}/${BASE_BRANCH}"
53+
fi
54+
55+
# Search and replace known references to stackableRelease, container images, branch references.
56+
# https://github.com/stackabletech/demos/blob/main/.scripts/update_refs.sh
57+
.scripts/update_refs.sh commit
58+
59+
push_branch "$DEMOS_REPO"
60+
}
61+
4562
update_repos() {
4663
local BASE_DIR="$1";
4764

48-
if [ "products" == "$WHAT" ] || [ "both" == "$WHAT" ]; then
65+
if [ "products" == "$WHAT" ] || [ "all" == "$WHAT" ]; then
4966
update_products
5067
fi
51-
if [ "operators" == "$WHAT" ] || [ "both" == "$WHAT" ]; then
68+
if [ "operators" == "$WHAT" ] || [ "all" == "$WHAT" ]; then
5269
update_operators
5370
fi
71+
if [ "demos" == "$WHAT" ] || [ "all" == "$WHAT" ]; then
72+
update_demos
73+
fi
5474
}
5575

5676
push_branch() {
@@ -98,6 +118,7 @@ parse_inputs() {
98118

99119
INITIAL_DIR="$PWD"
100120
DOCKER_IMAGES_REPO=$(yq '... comments="" | .images-repo ' "$INITIAL_DIR"/release/config.yaml)
121+
DEMOS_REPO=$(yq '... comments="" | .demos-repo ' "$INITIAL_DIR"/release/config.yaml)
101122
TEMP_RELEASE_FOLDER="/tmp/stackable-$RELEASE_BRANCH"
102123

103124
echo "Settings: ${RELEASE_BRANCH}: Push: $PUSH: Cleanup: $CLEANUP"
@@ -109,7 +130,7 @@ main() {
109130
# check if tag argument provided
110131
#-----------------------------------------------------------
111132
if [ -z "${RELEASE}" ]; then
112-
echo "Usage: create-release-branch.sh -b <branch> [-p] [-c] [-w both|products|operators]"
133+
echo "Usage: create-release-branch.sh -b <branch> [-p] [-c] [-w products|operators|demos|all]"
113134
exit 1
114135
fi
115136
#-----------------------------------------------------------

release/create-release-tag.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ tag_operators() {
5959
}
6060

6161
tag_repos() {
62-
if [ "products" == "$WHAT" ] || [ "both" == "$WHAT" ]; then
62+
if [ "products" == "$WHAT" ] || [ "all" == "$WHAT" ]; then
6363
tag_products
6464
fi
65-
if [ "operators" == "$WHAT" ] || [ "both" == "$WHAT" ]; then
65+
if [ "operators" == "$WHAT" ] || [ "all" == "$WHAT" ]; then
6666
tag_operators
6767
fi
6868
}
@@ -116,10 +116,10 @@ check_operators() {
116116
}
117117

118118
checks() {
119-
if [ "products" == "$WHAT" ] || [ "both" == "$WHAT" ]; then
119+
if [ "products" == "$WHAT" ] || [ "all" == "$WHAT" ]; then
120120
check_products
121121
fi
122-
if [ "operators" == "$WHAT" ] || [ "both" == "$WHAT" ]; then
122+
if [ "operators" == "$WHAT" ] || [ "all" == "$WHAT" ]; then
123123
check_operators
124124
fi
125125
}
@@ -235,7 +235,7 @@ main() {
235235
# check if tag argument provided
236236
#-----------------------------------------------------------
237237
if [ -z "${RELEASE_TAG}" ]; then
238-
echo "Usage: create-release-tag.sh -t <tag> [-p] [-c] [-w both|products|operators]"
238+
echo "Usage: create-release-tag.sh -t <tag> [-p] [-c] [-w products|operators|all]"
239239
exit 1
240240
fi
241241
#-----------------------------------------------------------

shell.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
pkgs.mkShell {
33
nativeBuildInputs = with pkgs; [
44
cargo-edit
5+
gettext # envsubst
56
gh
67
yq-go
78
];

0 commit comments

Comments
 (0)