I want to build & push two docker images in parallel, like so:
pipelines:
branches:
develop:
- parallel:
steps:
- step:
# build and push dockerfile 1
- step:
# build and push dockerfile 2
But I need the dev deployment variables on both steps. How can I achieve this?
Hi Ian and welcome to the community!
You can use a stage for the steps that you want to use the same deployment environment and then use the deployment keyword in the stage (instead of in each step). You can see an example on the following page, section Use Stages for deployments:
https://support.atlassian.com/bitbucket-cloud/docs/stage-options/
Please keep in mind that stages do not support parallel steps at the moment, so you would need to remove the parallelization to make use of this feature.
We have a feature request for supporting parallel steps in stages that you can vote for to express your interest:
Please feel free to reach out if you have any questions.
Kind regards,
Theodora
pipelines:
branches:
develop:
- parallel:
steps:
- step:
name: Build and Push Dockerfile 1
script:
- export DEV_VARIABLE=your_value_1
# Use $DEV_VARIABLE in your Docker build and push commands
- step:
name: Build and Push Dockerfile 2
script:
- export DEV_VARIABLE=your_value_2
# Use $DEV_VARIABLE in your Docker build and push commands
use this code
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But the values are coming from the Deployment named dev, I can't set the variables like that.
What I need is for the deployment variables be available in all the parallel steps
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.