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

(docker plugin) Additional tag alias support #2232

Merged
merged 2 commits into from Jul 24, 2022
Merged

Conversation

ejhayes
Copy link
Contributor

@ejhayes ejhayes commented Jul 19, 2022

What Changed

Thanks for creating this plugin! This PR does not change any existing behavior but does add some new functionality:

  • All plugin configuration can now be passed in via environment variables
    • IMAGE, REGISTRY, TAG_LATEST, TAG_PRERELEASE_ALIASES, TAG_PULL_REQUEST_ALIASES
  • README updates
  • Added support for the following tag aliases
    • prereleases: pushes to any prerelease branch creates a branch tag in both git and docker (e.g. myimage:<branchName> docker tag and <branchName> git tag). Branch/Tag mapping can be configured via new prereleaseAliasMappings option
    • canary: creates pr-<prNumber> docker tag and pr-<prNumber> git tag
    • release: also creates a latest git tag (not just a latest docker tag)

Why

This provides the following benefits:

  • Alias tags (e.g. pr-<prNumber>, latest, next, etc) are only created AFTER docker image is pushed
  • Simplifies cases where you want to reference the shortcut version rather than the explicit version (for example if you are publishing new docker images of your service to DockerHub but your customers only care about latest, next, etc)

This functionality may not be desired for all use cases and hence is disabled by default.

Todo:

  • Add tests
  • Add docs

Change Type

Indicate the type of change your pull request is:

  • documentation
  • patch
  • minor
  • major

… (with mapping to specific aliases per branch), and latest. All docker alias tags are also pushed to git
@ejhayes
Copy link
Contributor Author

ejhayes commented Jul 19, 2022

Hey @hipstersmoothie it looks like there might be an issue with the circleci builds.

Error: GitHub token not found!\n' +
    at Auto.loadConfig (/home/circleci/auto/packages/core/src/auto.ts:642:13)\n' +
    at processTicksAndRejections (internal/process/task_queues.js:97:5)\n' +
    at execute (/home/circleci/auto/packages/cli/src/run.ts:36:5)\n' +
    at Object.runCli (/home/circleci/auto/packages/cli/src/run.ts:144:3)\n',

Tests run fine locally for me.

@hipstersmoothie
Copy link
Collaborator

Updated the key

@hipstersmoothie
Copy link
Collaborator

Tag me again when ready to merge

@ejhayes
Copy link
Contributor Author

ejhayes commented Jul 20, 2022

Looks to be failing with the same error @hipstersmoothie

@hipstersmoothie
Copy link
Collaborator

Verified this all works locally. don't know what's up with CI

@hipstersmoothie hipstersmoothie merged commit a3d1c54 into intuit:main Jul 24, 2022
@hipstersmoothie
Copy link
Collaborator

🚀 PR was released in v10.37.3 🚀

@hipstersmoothie hipstersmoothie added the released This issue/pull request has been released. label Jul 24, 2022
@ejhayes
Copy link
Contributor Author

ejhayes commented Jul 24, 2022

Thanks @hipstersmoothie!

ejhayes added a commit to ejhayes/auto that referenced this pull request Sep 14, 2022
ejhayes added a commit to ejhayes/auto that referenced this pull request Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants