Skip to content

Commit 7ae4ef2

Browse files
authored
Merge pull request #34347 from def-/pr-cut-release-macos
release cut: Fix code for macOS
2 parents f1e5a40 + 978a80a commit 7ae4ef2

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

misc/python/materialize/release/cut_release.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import argparse
1313
import os
14+
import pathlib
1415
import re
1516
import shutil
1617
import subprocess
@@ -108,21 +109,23 @@ def main():
108109
"--sbom",
109110
]
110111
)
111-
spawn.runv(
112-
[
113-
"sed",
114-
"-i",
115-
f"s#FROM materialize/console:.* AS console#FROM {console_image} AS console#",
116-
"misc/images/materialized-base/Dockerfile",
117-
]
112+
dockerfile = pathlib.Path("misc/images/materialized-base/Dockerfile")
113+
dockerfile_text = dockerfile.read_text()
114+
dockerfile.write_text(
115+
re.sub(
116+
r"FROM materialize/console:.*? AS console",
117+
f"FROM {console_image} AS console",
118+
dockerfile_text,
119+
)
118120
)
119-
spawn.runv(
120-
[
121-
"sed",
122-
"-i",
123-
f's#"--console-image-tag-default=.*"#"--console-image-tag-default={console_version}"#',
124-
"misc/helm-charts/operator/templates/deployment.yaml",
125-
]
121+
deployment = pathlib.Path("misc/helm-charts/operator/templates/deployment.yaml")
122+
deployment_text = deployment.read_text()
123+
deployment.write_text(
124+
re.sub(
125+
r'"--console-image-tag-default=[^"]*"',
126+
f'"--console-image-tag-default={console_version}"',
127+
deployment_text,
128+
)
126129
)
127130
# Commit here instead of in bump-version so we have access to the correct git author
128131
spawn.runv(["git", "commit", "-am", f"release: bump to version {version}"])

0 commit comments

Comments
 (0)