I have a single repo which contains multiple build targets/variants, and I'm working on the release/deployment process for the images right now. I want to allow manual triggering of deployments for each image, from each commit to master. Each one needs to separately go through test, staging, and production deployment environments. The problem is that each manual step requires all previous steps in the pipeline to pass,, which means a pipeline like this doesn't work:
- step: *build-target-a
- step: *build-target-b
- step: *deploy-a-test
- step: *deploy-b-test
- step: *deploy-a-staging
- step: *deploy-b-staging
- step: *deploy-a-production
- step: *deploy-b-production
This won't work because all the deploy steps are manually triggered, and i can't deploy-b-staging until I run deploy-a-test. This gets worse as I go down the chain - e.g. I can't deploy-b-production until I deploy-a-production, when I might not want to deploy-a-production at all.
So, I tried splitting them into separate pipelines (sorry for formatting):
pipelines:
branches:
master:
- step: *build-target-a
- step: *deploy-a-test
- step: *deploy-a-staging
- step: *deploy-a-production
master:
- step: *build-target-b
...
But, this configuration is invalid because the 'master' key is repeated twice.
I also know that you can't trigger manual steps in parallel - not that that would've really helped here anyway.
I COULD make a custom deploy step where you go to the commit, and run the "deploy-target-a" pipeline. But, I want to use the BITBUCKET_BUILD_NUMBER as part of my build. I might end up with out of order build numbers if i do this - e.g. if I ran "deploy-target-a" on the latest commit, then I went back to a previous commit and ran "deploy-target-a", the later commit would have an earlier build number.
My question is: what do you think is a working or good solution, or is there even one out there?