diff --git a/.scripts/update_refs.sh b/.scripts/update_refs.sh index 6b2f57b2..c17daf29 100755 --- a/.scripts/update_refs.sh +++ b/.scripts/update_refs.sh @@ -80,7 +80,7 @@ echo "$MESSAGE" # shellcheck disable=SC2016 # We intentionally don't want to expand the variable. find demos stacks -type f \ -exec grep --color=always -l githubusercontent {} \; \ - -exec sed -i -E 's#(stackabletech/demos)/main/#\1/\${UPDATE_BRANCH_REF}/#' {} \; \ + -exec sed -i -E 's#(stackabletech/demos)/(refs/heads/)?main/#\1/\${UPDATE_BRANCH_REF}/#' {} \; \ | prepend "\t" # Now, for all modified files, we can use envsubst diff --git a/demos/signal-processing/create-nifi-ingestion-job.yaml b/demos/signal-processing/create-nifi-ingestion-job.yaml index dd67cedf..45d75ff1 100644 --- a/demos/signal-processing/create-nifi-ingestion-job.yaml +++ b/demos/signal-processing/create-nifi-ingestion-job.yaml @@ -87,12 +87,14 @@ data: service_login(username=USERNAME, password=PASSWORD) print("Logged in") - # This file path needs adjustment for versioned demos on release branch - response = requests.get("https://raw.githubusercontent.com/stackabletech/demos/refs/heads/main/demos/signal-processing/DownloadAndWriteToDB.json") + # At release time, .scripts/update_refs.sh rewrites the branch in this URL to the release + # branch. Keep the URL in a form its regex matches, or release-branch installs will + # download this file from main (see the 26.3 regression). + response = requests.get("https://raw.githubusercontent.com/stackabletech/demos/main/demos/signal-processing/DownloadAndWriteToDB.json") filename = "/tmp/DownloadAndWriteToDB.json" - with open(filename, "wb") as f: - f.write(response.content) + with open(filename, "w") as f: + f.write(response.text.replace("{{ NAMESPACE }}", os.environ["NAMESPACE"])) pg_id = get_root_pg_id()