Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions build_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ def main():
build_command = build_command.replace("{REGION}", args.region)
build_command = build_command.replace("{REPO}", args.repo)
print(f"Running: \n{build_command}")
subprocess.call(build_command, shell=True)
if subprocess.call(build_command, shell=True) != 0:
print("Build failed, exiting.")
return

push_command = PUSH_COMMAND_TMPL
push_command = push_command.replace("{TAG_SUFFIX}", args.tag_suffix)
Expand All @@ -57,7 +59,9 @@ def main():
push_command = push_command.replace("{REGION}", args.region)
push_command = push_command.replace("{REPO}", args.repo)
print(f"Running: \n{push_command}")
subprocess.call(push_command, shell=True)
if subprocess.call(push_command, shell=True) != 0:
print("Push failed, exiting.")
return


if __name__ == "__main__":
Expand Down
12 changes: 9 additions & 3 deletions build_image_pcg_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,24 @@ def main():
build_command = build_command.replace("{REGION}", args.region)
build_command = build_command.replace("{REPO}", args.repo)
print(f"Running: \n{build_command}")
subprocess.call(build_command, shell=True)
if subprocess.call(build_command, shell=True) != 0:
print("Build failed, exiting.")
return

push_command = PUSH_COMMAND_TMPL
push_command = push_command.replace("{TAG}", args.tag)
push_command = push_command.replace("{PROJECT}", args.project)
push_command = push_command.replace("{REGION}", args.region)
push_command = push_command.replace("{REPO}", args.repo)
print(f"Running: \n{push_command}")
subprocess.call(push_command, shell=True)
if subprocess.call(push_command, shell=True) != 0:
print("Push failed, exiting.")
return

print(f"\nAdding git tag pcg_listener_{args.tag}.")
subprocess.call(f"git tag pcg_listener_{args.tag} && git push origin pcg_listener_{args.tag}", shell=True)
if subprocess.call(f"git tag pcg_listener_{args.tag} && git push origin pcg_listener_{args.tag}", shell=True) != 0:
print("Git tagging failed, exiting.")
return


if __name__ == "__main__":
Expand Down
14 changes: 10 additions & 4 deletions build_image_segment_update_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ def main():
.replace("{REPO}", args.repo)
)
print(f"Running: \n{build_command}")
subprocess.call(build_command, shell=True)
if subprocess.call(build_command, shell=True) != 0:
print("Build failed, exiting.")
return

push_command = (
PUSH_COMMAND_TMPL.replace("{TAG}", args.tag)
Expand All @@ -44,13 +46,17 @@ def main():
.replace("{REPO}", args.repo)
)
print(f"Running: \n{push_command}")
subprocess.call(push_command, shell=True)
if subprocess.call(push_command, shell=True) != 0:
print("Push failed, exiting.")
return

print(f"\nAdding git tag segment_update_worker_{args.tag}.")
subprocess.call(
if subprocess.call(
f"git tag segment_update_worker_{args.tag} && git push origin segment_update_worker_{args.tag}",
shell=True,
)
) != 0:
print("Git tagging failed, exiting.")
return


if __name__ == "__main__":
Expand Down
13 changes: 10 additions & 3 deletions build_image_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,25 @@ def main():
build_command = build_command.replace("{REGION}", args.region)
build_command = build_command.replace("{REPO}", args.repo)
print(f"Running: \n{build_command}")
subprocess.call(build_command, shell=True)
# Stop if build fails
if subprocess.call(build_command, shell=True) != 0:
print("Build failed, exiting.")
return

push_command = PUSH_COMMAND_TMPL
push_command = push_command.replace("{TAG}", args.tag)
push_command = push_command.replace("{PROJECT}", args.project)
push_command = push_command.replace("{REGION}", args.region)
push_command = push_command.replace("{REPO}", args.repo)
print(f"Running: \n{push_command}")
subprocess.call(push_command, shell=True)
if subprocess.call(push_command, shell=True) != 0:
print("Push failed, exiting.")
return

print(f"\nAdding git tag {args.tag}.")
subprocess.call(f"git tag {args.tag} && git push origin {args.tag}", shell=True)
if subprocess.call(f"git tag {args.tag} && git push origin {args.tag}", shell=True) != 0:
print("Git tagging failed, exiting.")
return


if __name__ == "__main__":
Expand Down
12 changes: 9 additions & 3 deletions build_image_web_gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,24 @@ def main():
build_command = build_command.replace("{REGION}", args.region)
build_command = build_command.replace("{REPO}", args.repo)
print(f"Running: \n{build_command}")
subprocess.call(build_command, shell=True)
if subprocess.call(build_command, shell=True) != 0:
print("Build failed, exiting.")
return

push_command = PUSH_COMMAND_TMPL
push_command = push_command.replace("{TAG}", args.tag)
push_command = push_command.replace("{PROJECT}", args.project)
push_command = push_command.replace("{REGION}", args.region)
push_command = push_command.replace("{REPO}", args.repo)
print(f"Running: \n{push_command}")
subprocess.call(push_command, shell=True)
if subprocess.call(push_command, shell=True) != 0:
print("Push failed, exiting.")
return

print(f"\nAdding git tag {args.tag}_gpu.")
subprocess.call(f"git tag {args.tag}_gpu && git push origin {args.tag}_gpu", shell=True)
if subprocess.call(f"git tag {args.tag}_gpu && git push origin {args.tag}_gpu", shell=True) != 0:
print("Git tagging failed, exiting.")
return


if __name__ == "__main__":
Expand Down
Loading