Skip to content

Tag latest readiness and versionhook when building on master #205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
18 changes: 17 additions & 1 deletion pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,8 +1007,24 @@ def build_image_generic(
# But since we don't run daily rebuilds on ecr image builds, we can do that step instead here.
# We only need to push manifests for multi-arch images.
create_and_push_manifest(registry_address, version, architectures=architectures)
latest_tag = "latest"
if not is_running_in_patch() and is_running_in_evg_pipeline():
logger.info(f"Tagging and pushing {registry_address}:{version} as {latest_tag}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: do you think this as an attribute and trace is useful? Consider the cross-patches query-ability.

try:
client = docker.from_env()
source_image = client.images.pull(f"{registry_address}:{version}")
source_image.tag(registry_address, latest_tag)
client.images.push(registry_address, tag=latest_tag)
logger.info(f"Successfully tagged and pushed {registry_address}:{latest_tag}")
except docker.errors.DockerException as e:
logger.error(f"Failed to tag/push {latest_tag} image: {e}")
raise
else:
logger.info(
f"Skipping tagging and pushing {registry_address}:{version} as {latest_tag} tag; is_running_in_patch={is_running_in_patch()}, is_running_in_evg_pipeline={is_running_in_evg_pipeline()}"
)

# Sign and verify the context image if on releases if requied.
# Sign and verify the context image if on releases if required.
if config.sign and config.is_release_step_executed():
sign_and_verify_context_image(registry, version)

Expand Down