Skip to content

Commit 7698e44

Browse files
authored
fix: Processing URL and namespace replacement (#428)
1 parent 5b4167c commit 7698e44

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

.scripts/update_refs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ echo "$MESSAGE"
8080
# shellcheck disable=SC2016 # We intentionally don't want to expand the variable.
8181
find demos stacks -type f \
8282
-exec grep --color=always -l githubusercontent {} \; \
83-
-exec sed -i -E 's#(stackabletech/demos)/main/#\1/\${UPDATE_BRANCH_REF}/#' {} \; \
83+
-exec sed -i -E 's#(stackabletech/demos)/(refs/heads/)?main/#\1/\${UPDATE_BRANCH_REF}/#' {} \; \
8484
| prepend "\t"
8585

8686
# Now, for all modified files, we can use envsubst

demos/signal-processing/create-nifi-ingestion-job.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,14 @@ data:
8787
service_login(username=USERNAME, password=PASSWORD)
8888
print("Logged in")
8989
90-
# This file path needs adjustment for versioned demos on release branch
91-
response = requests.get("https://raw.githubusercontent.com/stackabletech/demos/refs/heads/main/demos/signal-processing/DownloadAndWriteToDB.json")
90+
# At release time, .scripts/update_refs.sh rewrites the branch in this URL to the release
91+
# branch. Keep the URL in a form its regex matches, or release-branch installs will
92+
# download this file from main (see the 26.3 regression).
93+
response = requests.get("https://raw.githubusercontent.com/stackabletech/demos/main/demos/signal-processing/DownloadAndWriteToDB.json")
9294
9395
filename = "/tmp/DownloadAndWriteToDB.json"
94-
with open(filename, "wb") as f:
95-
f.write(response.content)
96+
with open(filename, "w") as f:
97+
f.write(response.text.replace("{{ NAMESPACE }}", os.environ["NAMESPACE"]))
9698
9799
pg_id = get_root_pg_id()
98100

0 commit comments

Comments
 (0)