I want to build a pipeline with a step structure like the following:
I've used this kind of structure previously with Azure (I didn't build it) but I can't figure out if its possible here. Am I going to have to split this out to multiple pipelines? I thought I would be able to do this when I found out about after-script, but seems I can't put a step inside it. Here's what I thought I might be able to do:
I should add that I am completely new to yaml and pipelines in general, literally started using it yesterday
pipelines:
pull-requests:
default:
- step:
name: 'Generate deployment packages'
script:
...
- parallel:
- step:
name: 'Validate Against Sandbox 1'
trigger: manual
script:
...
after-script:
- step:
name: 'Deploy to Sandbox 1'
trigger: manual
script:
if [[ BITBUCKET_EXIT_CODE -eq 1 ]]; then exit 1; fi
...
- step:
name: 'Validate Against Sandbox 2'
trigger: manual
script:
...
after-script:
- step:
name: 'Deploy to Sandbox 2'
trigger: manual
script:
if [[ BITBUCKET_EXIT_CODE -eq 1 ]]; then exit 1; fi
...
I also thought Stages might help, but you can't manually trigger stage steps :(
Thanks
Hi Steven and welcome to the community!
I'm afraid that this cannot be done with a single pipeline at the moment.
The validate jobs can be parallel and they can be executed independently. However, the after-script is not a separate step and it cannot be triggered manually, it will always run when the step finishes.
You can look into using different custom pipelines:
A custom pipeline does not run automatically, but it can be triggered manually. You can see on this page how you can run a custom pipeline manually:
You could have:
Please keep in mind that these can be triggered independently, so someone could trigger the last custom pipeline without the first one having been executed.
It is also important to take into account that custom pipelines cannot be triggered on pull requests. They can be triggered only for a branch or a specific commit.
Please feel free to reach out if you have any questions.
Kind regards,
Theodora
Thank you for the response. Since you put "at the moment" in your response, can I read into that that it might be something possible in future? This is the sort of setup I've used previously in a previous company who used Azure so it's definitely possible in other products.
Thanks again
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Steven,
This setup should be possible if we implement the following two features:
With these two features implemented, it should be possible to do the following:
You can add your vote to both feature requests (by selecting the Vote for this issue link) to express your interest. You are more than welcome to leave any feedback there, and you can also add yourself as a watcher (by selecting the Start watching this issue link) if you'd like to get notified via email on updates.
Implementation of features is done as per our policy here and any updates will be posted in the feature requests.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.