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

(#174) Don't always push latest tag to docker #183

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

corbob
Copy link
Member

@corbob corbob commented Feb 3, 2025

Description Of Changes

Update Docker build to only set latest tag when it is the latest build.

Motivation and Context

Previously we would set the latest tag on every tagged build which means that pre-release and support builds would get tagged as latest. This corrects that.

Testing

  1. Copied the files to chocolatey/choco repository on the develop branch.
  2. Editted the docker.cake file to remove lines 47-50 (call to DockerBuild) as my VM does not have docker installed on it.
  3. Run .\build.bat --target=docker --verbosity=diagnostic
  4. Ensure that the output for DockerTagAsLatest is: Skipping task: Skipping because this isn't a tagged full release build.
  5. Run git checkout master
  6. Run .\build.bat --target=docker --verbosity=diagnostic
  7. Ensure that the output for DockerTagAsLatest is: Skipping task: Skipping because Docker Credentials were not provided. (This indicates that the tag on the master branch was correctly detected and the task was skipped for the next criteria)
  8. Run git checkout support
  9. Run .\build.bat --target=docker --verbosity=diagnostic
  10. Ensure that the output for DockerTagAsLatest is: Skipping task: Skipping because this isn't a tagged full release build.

As for the DockerManifest task, the testing was done by debugging the script and stepping through it to ensure it did not output things.

Operating Systems Testing

Windows 11

Change Types Made

  • Bug fix (non-breaking change).
  • Feature / Enhancement (non-breaking change).
  • Breaking change (fix or feature that could cause existing functionality to change).
  • Documentation changes.
  • PowerShell code changes.

Change Checklist

  • Requires a change to the documentation.
  • Documentation has been updated.
  • Tests to cover my changes, have been added.
  • All new and existing tests passed?
  • PowerShell code changes: PowerShell v3 compatibility checked?

Related Issue

@corbob corbob requested review from gep13 and AdmiringWorm February 3, 2025 22:38
Update Docker build to only set latest tag when it is the latest build.
Previously we would set the latest tag on every tagged build which means
that pre-release and support builds would get tagged as latest. This
corrects that.
@gep13 gep13 force-pushed the 174-docker-latest branch from 3d4cf50 to 92be168 Compare February 4, 2025 07:26
Copy link
Member

@gep13 gep13 left a comment

Choose a reason for hiding this comment

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

LGTM!

@gep13
Copy link
Member

gep13 commented Feb 4, 2025

@corbob I have just taken this for a spin, and this appears to be working as expected. Thanks for getting this done!

@gep13 gep13 merged commit a2d7965 into chocolatey:develop Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't push Docker latest tag for support releases
2 participants