-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Deployment Task on Fail #4489
Comments
We don't currently have a way of doing this - I think maybe your CI pipeline would be a better place to put such a failure message, given that any point in the Dokku deploy may exit non-zero. The alternative might be to have a wrapper function at Can you tell me a bit more about your particular use case? That will help me figure out the best way to handle this sort of request :) |
@josegonzalez thanks for letting me know. The use case is that my deploys to dokku take quite a bit of time. I'm using Rails 5/6 with webpacker, and precompiling assets for my apps take awhile (sometimes 3-4 minutes) even on relatively fast server with multiple cores. It seems that a lot of the webpacker dependencies don't take advantage of multiple cores and rely on single-threaded performance. One of the issues I've run into in the past is my deploy might fail somewhere along the way—like during a migration, when a config variable is not set properly, installing dependencies, etc.—and not having an automated way to know that was the case. So I'll run a deploy, step away from my computer for a few minutes, and come back to see that it failed 30 seconds into the deploy. From the docs on deployment tasks, I've been able to set up a slack notification upon successful deployment of an app, using the different phases in I can see that perhaps with a more sophisticated CI pipeline, I could find a solution with a different method. But it seems intuitive that the phases in |
That makes sense. I think the best way around this would be like...
Such a binary would also be a great place to add global logging (so ship all log output to a file), but might take a bit of work to figure out. Seems reasonable to me. |
If a deploy fails, what image should we use for that failure task? Which |
I'd recommend using the Is there a use case for using the previous deploy's version? |
Which image would be the one we use for the deployment task? All deployment tasks must be run from an image. We could use the |
I see. If we're using the Would the keys be something like It seems if we're using the Would something like this be able to work?
|
No we wouldn't have access to the repository files. It would be hard to say they would be useful. For instance, what would happen if the files depend on app dependencies but those dependencies failed to install? |
I see. Would we have access to env vars? |
Yeah we could do that for sure. Basically it would be the same as any other deploy task except with a specific image. We could even have a special arg for that image, so that users could ensure a specific environment for the failure task to run in. |
Ok, in that case |
Regarding this file: https://github.com/dokku/dokku/blob/master/docs/advanced-usage/deployment-tasks.md
I'm working on using the postdeploy task to notify a slack channel of a successful deploy. Is there a way to know that dokku failed to deploy, and therefore notify slack of a failed deploy?
The text was updated successfully, but these errors were encountered: