Skip to content
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

Don't add GIT_COMMIT_SHA build to the label at the beginning of the build #1424

Merged
merged 1 commit into from May 6, 2021

Conversation

alastair
Copy link
Collaborator

@alastair alastair commented May 4, 2021

Problem

This causes all build to invalidate the entire cache as the
GIT_COMMIT_SHA changes every time that we make a new image.

Solution

Add the version label at the end after all other items have changed

Action

Copy link
Contributor

@MonkeyDo MonkeyDo left a comment

Choose a reason for hiding this comment

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

LGTM.
As discussed IRL, might be worth setting the version label to blank at the beginning to avoid wrongly labeled intermediary build layers

@alastair
Copy link
Collaborator Author

alastair commented May 6, 2021

I set the vcs hash to empty at the beginning to override the base image version, and also added an additional ARG command necessary for setting the version in the based-on-image label

Copy link
Contributor

@MonkeyDo MonkeyDo left a comment

Choose a reason for hiding this comment

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

Reapproved!

…uild

This causes all build to invalidate the entire cache as the
GIT_COMMIT_SHA changes every time that we make a new image. Add it at
the end after all other items have changed

Also fix a bug around consuming ARGs that have a default value in
LABELS. Now the org.metabrainz.based-on-image label correctly contains
the version of the base image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants