-
Notifications
You must be signed in to change notification settings - Fork 116
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
Push a git tag after a VERSION change #1209
Conversation
Deploy preview for chef-workstation ready! Built with commit b575936 |
c7ee3e4
to
f7e420e
Compare
Normally expeditor does a 'git tag' for us when we use 'built_in:bump_version' but in this case we are doing the version bump on our own since sometimes we do a major/minor bump based on the the date. Signed-off-by: Bryan McLellan <btm@loftninjas.org>
f7e420e
to
f876d0a
Compare
.expeditor/config.yml
Outdated
@@ -44,6 +44,9 @@ merge_actions: | |||
- "Expeditor: Skip Omnibus" | |||
- "Expeditor: Skip All" | |||
only_if: bash:.expeditor/determine_version.sh | |||
- bash:.expeditor/push-git-tag.sh: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the tag is on the remote when the omnibus build occurs, we'll want to run this prior to triggering the omnibus build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm presuming the post_commit: true
here is redundant?
@@ -39,6 +39,8 @@ merge_actions: | |||
ignore_labels: | |||
- "Expeditor: Skip Changelog" | |||
- "Expeditor: Skip All" | |||
- bash:.expeditor/push-git-tag.sh: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The order in the config is the order the commands will be executed in, correct? I tried to confirm that in https://expeditor.chef.io/docs/getting-started/action-sets/ but I didn't see it.
If my understanding is correct, looks like BTM got this updated to run before the release.
However, the bash
action is pre-commit by default (https://expeditor.chef.io/docs/reference/actions/#bash) so I think we need post_commit: true
added back
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I actually had it here originally, but with the post-commit: true
and expeditor had errored saying that the actions had to be listed in the order they would be executed, which had caused me to move it to the end.
It seems unlikely that the trigger_pipeline:omnibus/release
action would be firing before a commit was finished, but it doesn't have a post-commit property on it.
I'm starting to get confused about what commit we're actually referring to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be before trigger_pipeline
, and specified with a post_commit: true
. I'll see if I can find out why it was giving you an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put your exact scenario into my spec tests and everything came up golden. Let's try your config with the following merge_actions
:
- bash:.expeditor/determine_version.sh:
ignore_labels:
- "Expeditor: Skip Version Bump"
- "Expeditor: Skip All"
- built_in:update_changelog:
ignore_labels:
- "Expeditor: Skip Changelog"
- "Expeditor: Skip All"
- bash:.expeditor/push-git-tag.sh:
only_if: bash:.expeditor/determine_version.sh
post_commit: true
- trigger_pipeline:omnibus/release:
ignore_labels:
- "Expeditor: Skip Omnibus"
- "Expeditor: Skip All"
only_if: bash:.expeditor/determine_version.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for "what commit we're actually referring to", there is an implicit commit between the pre-commit and post-commit phases. That's likely what we're referring to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I probably had it between bash:.expeditor/determine_version.sh:
and built_in:update_changelog:
before.
Signed-off-by: Bryan McLellan <btm@loftninjas.org>
b363dd0
to
b575936
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
looks correct, thanks folks.
|
Thanks @btm! |
Normally expeditor does a 'git tag' for us when we use
'built_in:bump_version' but in this case we are doing the version bump
on our own since sometimes we do a major/minor bump based on the the
date.
Aha! Link: https://chef.aha.io/features/SH-1946