@@ -14,6 +14,7 @@ workingBranchPrefix := "chore/update-"
1414targetBranchPrefix := " release-"
1515
1616# For Cluster Stack creation
17+
1718mgmtcluster := " contextName"
1819mgmcluster_namespace := " NamespaceName"
1920
@@ -30,7 +31,7 @@ help: default
3031dependencies :
3132 #!/usr/bin/env bash
3233 set -euo pipefail
33-
34+
3435 if ! which csctl > /dev/null 2>&1 ; then
3536 echo -e " \e[33m\e[1mcsctl not found, building it from source.\e[0m"
3637 mkdir -p bin
@@ -138,7 +139,6 @@ build-version VERSION:
138139 ./hack/generate_version.py --target-version {{ replace(VERSION, " -" , " ." ) }}
139140 fi
140141
141-
142142# Build assets for a certain Kubernetes Version. Out directory needs to be present.
143143[group (' Build Assets' )]
144144build-assets-local-for VERSION : dependencies
@@ -176,7 +176,7 @@ build-assets-all-local: build-versions-all
176176
177177# Publish assets to OCI registry
178178[group (' Release' )]
179- publish-assets VERSION :
179+ publish-assets VERSION :
180180 #!/usr/bin/env bash
181181 if [[ -e providers/openstack/out/{{ replace(VERSION, " ." , " -" ) }} ]]; then
182182 if [[ -n ${OCI_REGISTRY} && \
@@ -202,11 +202,16 @@ publish-assets-all:
202202
203203# Publish new release of providers/openstack/scs
204204[group('Release')]
205+ publish-test-release: dependencies
206+ csctl create -m hash --publish --remote oci providers/openstack/scs/
207+
208+ # Publish new release of providers/openstack/scs
205209[confirm('Are you sure to publish a new stable release? (y|n)')]
210+ [group('Release')]
206211publish-release: dependencies
207212 csctl create --publish --remote oci providers/openstack/scs/
208213
209- # Remove old branches that had been merged to main
214+ # Remove old branches that had been merged to main
210215[group('git')]
211216git-clean:
212217 git branch --merged | grep -Ev "(^\*|^\+|^release/\+|main)" | xargs --no-run-if-empty git branch -d
@@ -217,17 +222,17 @@ git-chore-branch VERSION: && (gh-create-chore-pr VERSION)
217222 #!/usr/bin/env bash
218223 set -euo pipefail
219224 currentBranch=$(git branch --show-current)
220- if git show-ref -q --branches {{ workingBranchPrefix }}{{replace(VERSION, "-", ".") }}; then
225+ if git show-ref -q --branches {{ workingBranchPrefix }}{{ replace(VERSION, "-", ".") }}; then
221226 # Switch to branch if it exists
222- git switch {{ workingBranchPrefix }}{{replace(VERSION, "-", ".") }}
227+ git switch {{ workingBranchPrefix }}{{ replace(VERSION, "-", ".") }}
223228 else
224229 # Create branch and switch to it
225- git switch -c {{ workingBranchPrefix }}{{replace(VERSION, "-", ".") }}
230+ git switch -c {{ workingBranchPrefix }}{{ replace(VERSION, "-", ".") }}
226231 fi
227- cp -r providers/openstack/out/{{replace(VERSION, ".", "-") }}/* providers/openstack/scs/
232+ cp -r providers/openstack/out/{{ replace(VERSION, ".", "-") }}/* providers/openstack/scs/
228233 git add providers/openstack/scs/
229- git commit -s -m "chore(versions): Update Release for {{replace(VERSION, "-", ".") }}"
230- git push --set-upstream origin {{ workingBranchPrefix }}{{replace(VERSION, "-", ".") }}
234+ git commit -s -m "chore(versions): Update Release for {{ replace(VERSION, "-", ".") }}"
235+ git push --set-upstream origin {{ workingBranchPrefix }}{{ replace(VERSION, "-", ".") }}
231236 git switch ${currentBranch}
232237
233238# Create chore branches for all available out versions
@@ -273,9 +278,9 @@ gh-create-chore-pr VERSION: gh-login
273278 if ! which gh >/dev/null 2 >&1 ; then
274279 echo "GitHub CLI not installed."
275280 else
276- gh pr --title "chore(versions): Update Release for {{replace(VERSION, "-", ".") }}" \
277- --head {{ workingBranchPrefix }}{{replace(VERSION, "-", ".") }} \
278- --base {{ targetBranchPrefix }}{{replace(VERSION, "-", ".") }} \
281+ gh pr --title "chore(versions): Update Release for {{ replace(VERSION, "-", ".") }}" \
282+ --head {{ workingBranchPrefix }}{{ replace(VERSION, "-", ".") }} \
283+ --base {{ targetBranchPrefix }}{{ replace(VERSION, "-", ".") }} \
279284 --dry-run
280285 fi
281286
@@ -286,23 +291,23 @@ create-clusterstack PATH:
286291 set -euo pipefail
287292 # Given directory name
288293 directory_name=".release/$PATH "
289-
294+
290295 # Extract parts from the directory name
291296 IFS='/' read -ra PARTS <<<"$directory_name "
292297 IFS='-' read -ra PARTS <<<"${PARTS[1]} "
293-
298+
294299 provider="${PARTS[0]} "
295300 name="${PARTS[1]} "
296301 kubernetes_major_version="${PARTS[2]} "
297302 kubernetes_minor_version="${PARTS[3]} "
298303 version="${PARTS[4]} - ${PARTS[5]} .${PARTS[6]} "
299304 channel="custom"
300-
305+
301306 if [[ -z ${PARTS[6]} ]]; then
302307 version="${PARTS[4]} "
303308 channel="stable"
304309 fi
305-
310+
306311 Create the YAML structure
307312 clusterstack_yaml=$(cat <<-EOF
308313 ---
@@ -324,7 +329,7 @@ create-clusterstack PATH:
324329 - ${version}
325330 EOF
326331 )
327-
332+
328333 echo "$clusterstack " | kubectl apply -f -
329334
330335# UNTESTED RECIPE: Check on Cluster Stack creation
@@ -357,7 +362,7 @@ check-clusterstack NAME:
357362create-cluster VERSION CLASS:
358363 #! /usr/bin/env bash
359364 set -e uo pipefail
360- cluster_manifest=<< -EOF
365+ cluster_manifest= $( cat << -EOF
361366 ---
362367 apiVersion: cluster.x-k8s.io/v1beta1
363368 kind: Cluster
@@ -377,4 +382,5 @@ create-cluster VERSION CLASS:
377382 name: md-0
378383 replicas: 1
379384 EOF
385+ )
380386 echo "${cluster_manifest} " | kubectl apply -f -
0 commit comments