Check for existing tag in remote repo before building. #764

Merged
telackey merged 14 commits from telackey/remotetag into main 2024-02-24 03:22:51 +00:00
Showing only changes of commit 694590ed56 - Show all commits

View File

@ -115,12 +115,14 @@ def process_app_deployment_request(
shared_tag_exists = remote_image_exists(image_registry, app_image_shared_tag)
if shared_tag_exists and not force_rebuild:
# simply add our unique tag to the existing image and we are done
print(f"Using existing app image {app_image_shared_tag} for {deployment_container_unique_tag}", file=log_file)
add_tags_to_image(image_registry, app_image_shared_tag, deployment_container_unique_tag)
else:
extra_build_args = [] # TODO: pull from request
build_container_image(app, deployment_container_unique_tag, extra_build_args, log_file)
push_container_image(deployment_dir, log_file)
# The build/push commands above will use the unique deployment tag, so now we need to add the shared tag.
print(f"Updating app image tag {app_image_shared_tag} from build of {deployment_container_unique_tag}", file=log_file)
add_tags_to_image(image_registry, deployment_container_unique_tag, app_image_shared_tag)
# 7. update config (if needed)