-
Notifications
You must be signed in to change notification settings - Fork 719
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
(before|after)_deploy should be run only once before and after all deployment providers #2570
Comments
I noticed this while refactoring the code, and remember saying something about it, but for some reason I ended up making it run once per provider still. I think it might be because this is documented behaviour? |
There is one mention of the current behavior at the end of http://blog.travis-ci.com/2013-10-02-continuous-deployment-pypi-npm-and-more/. |
I was the initial reporter on this one - I actually think the behavior as it is makes sense. Really the only part that’s confusing is that there’s no logging to indicate that the before_deploy section (in my case) was failing, so it's difficult to debug what's going on. Perhaps just changing the logging setup for this step would be enough? |
I don't really understand why you would want before_deploy to run twice for two providers, without a way to identify which provider you are preparing to deploy for. |
I just realized that it's run for every provider. I zipped the build in This should be only run once, or give a way to run |
Same issue here. Anyone have a clean work around for this? |
You can create an empty file ( |
Same problem here. The way the logs are displayed in the UI is really misleading too. Currently they are not displayed in a chronological manner but rather aggregated for all providers so that when the second deployment trigger, the previously displayed Having before/after/deploy sections per provider would be really appreciated, currently you have to look at raw logs to understand what's going on.
Agreed, if not possible to run only once, having an env var that tracks which deployment provider is running would be great.
Or create an env var that keeps track of that. e.g. before_deploy:
- >
if ! [ "$BEFORE_DEPLOY_RUN" ]; then
export BEFORE_DEPLOY_RUN=1;
my_cmd 1;
my_cmd 2;
...
fi |
Just got hit by this, it took me a while to realize what's going on from the build log |
I wonder how changing this behavior would affect existing builds. |
I say half of the users don't notice this behaviour and the I'd keep the possibility to run something before each deploy and not change. Make the documentation better and visibly mention this. Same for after_deploy |
I just ran into this issue and I won't rehash what's been said by many but I will vote up what @vvondra and @rolebi said about clear visible documentation about the behavior and intent. This subtle behavior will lead to insidious bugs for sure. Regarding #2570 by @BanzaiMan, perhaps the default behavior stays as-is and a property is added to change that behavior to only run "once for all providers" (e.g. |
I just ran across this myself. In my case I'm using travis to automatically increment build numbers in the repository. The builds were increment by two because I had two deploy providers. +1 for at least providing clearer logging. However, I agree with @vilmosioo that it makes more sense for before_deploy to be ran once rather than for each provider. |
+1 for either running before_deploy once for all providers or a per-provider before_deploy option. |
Moves the open_ssl command back to before_install, otherwise it runs more than once (as there is more than one deploy provider). Related Travis issue here: travis-ci/travis-ci#2570 This behaviour was reverted in GOV.UK elements here: alphagov/govuk_elements#415 Before deploying, also check that the build has passed successfully.
+1 any update on this? |
+1 any update on this? |
This is still an issue |
This is required because before_deploy is ran twice if multiple providers exist, see travis-ci/travis-ci#2570
This is required because before_deploy is ran twice if multiple providers exist, see travis-ci/travis-ci#2570
Also tweak debug output
This fixes a couple of bugs in the build process and works around a few 3rd party service bugs and undocumented "features". Most notably: * beta tag was missing from signing API call * Add git credentials to updates repo * AMO API library needs us to create destination folder before signing * Workaround Travis workflow bug travis-ci/travis-ci#2570 * Workaround Travis subdirectory bug travis-ci/travis-ci#9338
(and after_deploy) I was not aware of this from the documentation and found out via travis-ci/travis-ci#2570
* Mention before_deploy can run multiple times (and after_deploy) I was not aware of this from the documentation and found out via travis-ci/travis-ci#2570 * Clarification on multiple before_deploy
Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues |
^ Ping to keep this open, as it's still an issue. |
Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue in 24 hours. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues |
unstale |
It might be too difficult and disruptive to change |
+1 any update on this? |
@harvey-woo Sorry, no updates. |
How about adding |
@BanzaiMan Ok, i'll follow @rolebi 's solution |
Also running into this issue. Also do not understand why 'before' and 'after' would run for each provider. The goal is to create a single binary and deploy it to multiple targets, in my case Github and Bintray. By running for each provider there is a chance the created binaries are not equal and that is not what you want I think. Reading through this issue, it is apparently not possible or wanted to change the current behaviour because it exists for so long already. Instead of creating new phases I propose to add a boolean property to allow running the before/after for all or per provider. E.g. Default value should be |
To avoid re-running the install and build, until travis-ci/travis-ci#2570 is resolved.
At least we need a method to detect which provider the {before,after}_deploy script for. |
In my case I am running a script to notarize my macOS .pkg. It takes a long time and running it twice is completely unnecessary and very very time consuming. Are the deployments guaranteed to always be executed in the same order? I'd prefer to notarize just before the deployment to GitHub releases rather than the other deployment which is of documentation to gh_pages. With all the traffic here, why is this still not fixed? An excellent and compatible solution has been suggested by @diversit . What is the issue preventing it being fixed? |
Right now, these sections fire for each deployment provider. If a command is not idempotent (say,
git fetch --unshallow
), having multiple providers lead to reproducible error.The text was updated successfully, but these errors were encountered: