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

Support of the on-cancel task in the plugin #389

Open
asavchkov opened this issue Mar 14, 2023 · 1 comment
Open

Support of the on-cancel task in the plugin #389

asavchkov opened this issue Mar 14, 2023 · 1 comment

Comments

@asavchkov
Copy link

GoCD pipeline model has a special task which can be run when a stage is cancelled:

https://docs.gocd.org/current/advanced_usage/dev_clean_up_when_cancel.html

I have created a test pipeline containing such an on-cancel task and when I export it in the Groovy format to see how it would look like in the original source file there is nothing related to this task in the resulted export file, only regular tasks are present. Is it a bug or this kind of task is not supported in the plugin?
In my case it is critical to cleanup after the cancellation of a stage, otherwise next pipelines will fail. And also I can only use the Groovy plugin since I configure parallel matrix jobs in an .each loop which a YAML/JSON plugin wouldn't be able to describe.

Groovy Configuration plugin version: 2.1.3-475

@chadlwilson
Copy link
Contributor

It doesn't seem to be supported by this particular plugin right now.

You can possibly achieve something similar with a wrapping shell script and a trap clause, as long as the cleanup doesn't take too long.

@chadlwilson chadlwilson changed the title Support of the on-cansel task in the plugin Support of the on-cancel task in the plugin Mar 14, 2023
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

No branches or pull requests

2 participants