Skip to content

Commit 8bee6ed

Browse files
authored
fix(ci): Docker master builds fail while checking version (#27087)
1 parent 0950bb7 commit 8bee6ed

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

scripts/build_docker.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
BASE_PY_IMAGE = "3.9-slim-bookworm"
2929

3030

31-
def run_cmd(command: str) -> str:
31+
def run_cmd(command: str, raise_on_failure: bool = True) -> str:
3232
process = subprocess.Popen(
3333
command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True
3434
)
@@ -41,9 +41,8 @@ def run_cmd(command: str) -> str:
4141

4242
process.wait() # Wait for the subprocess to finish
4343

44-
if process.returncode != 0:
44+
if process.returncode != 0 and raise_on_failure:
4545
raise subprocess.CalledProcessError(process.returncode, command, output)
46-
4746
return output
4847

4948

@@ -73,7 +72,13 @@ def get_build_context_ref(build_context: str) -> str:
7372

7473

7574
def is_latest_release(release: str) -> bool:
76-
output = run_cmd(f"./scripts/tag_latest_release.sh {release} --dry-run") or ""
75+
output = (
76+
run_cmd(
77+
f"./scripts/tag_latest_release.sh {release} --dry-run",
78+
raise_on_failure=False,
79+
)
80+
or ""
81+
)
7782
return "SKIP_TAG::false" in output
7883

7984

0 commit comments

Comments
 (0)