Issue #18012 open
Sebastien Delisle
created an issue

After-script where introduced recently and they are really good, but for cleanup it would be even better to have an "after-step" and by that i mean a final step or set of steps that would run no matter what happened previously in a pipeline.

I'll give an example that back this proposal.

Let say i have a step with an image that can creates an aws infra. Then i want another step with a python image that can run tests against the infra created in the first step. And at the end, i want to be able to destroy the infra in a third step, using the same image as the step one, no matter if the step 2 was successful or not.
With the after-script, the only thing i can do is run a script in my step 2 which dont have what it needs to destroy my aws infra.

Comments (2)

  1. Aneita Yang staff
    • changed status to open

    Hey @Sebastien Delisle,

    Thanks for reaching out and for the suggestion. I can see how having the ability to configure an 'after-step' might be useful.

    Given our current priorities, this is unlikely to be something we support in the short term. In the meantime however, I'll open this ticket to gauge the interest of other users on seeing the same thing.

    As mentioned in Nicholas's comment on issue #13317, a possible workaround is to build a Docker image that has the dependencies required by both steps, so the steps can be merged into the single one. That way, the after-script can run at the end of the new, combined step.


  2. Sebastien Delisle reporter

    Great thanks!

    I'm already using all those workarounds and it works ok, but it's not clean and goes against the Docker philosophy of having one responsibility per container. And since Bitbucket Pipelines relies heavily on containers, i thought it would be nice for it to enforce that philosophy.

  3. Log in to comment