Skip to content

Commit 806be61

Browse files
committed
fix: Processing URL and namespace replacement
1 parent 5b4167c commit 806be61

2 files changed

Lines changed: 6 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: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,13 @@ 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+
# This URL must keep the "stackabletech/demos/main/" form (not "refs/heads/main") so that
91+
# .scripts/update_refs.sh can rewrite it to the release branch at release time.
92+
response = requests.get("https://raw.githubusercontent.com/stackabletech/demos/main/demos/signal-processing/DownloadAndWriteToDB.json")
9293
9394
filename = "/tmp/DownloadAndWriteToDB.json"
94-
with open(filename, "wb") as f:
95-
f.write(response.content)
95+
with open(filename, "w") as f:
96+
f.write(response.text.replace("{{ NAMESPACE }}", os.environ["NAMESPACE"]))
9697
9798
pg_id = get_root_pg_id()
9899

0 commit comments

Comments
 (0)