The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Sharing environment across steps

Yogesh Mongar
February 9, 2020

Question: Is it possible to share docker environment used in step 1 with other steps?

 

I have a huge number of test files and instead of running all in a single step, I would like to break and run these in multiple steps. However, all of these steps would need a common environment setup. Instead of setting up the initial environment like bundler and other app dependencies on every step, will it be possible to run the initial setup in one step, and use that in other steps?

 

Thanks

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Alexander Zhukov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 12, 2020

Hi @Yogesh Mongar , one approach you could use is to build the custom docker image with all dependencies in the initial step and use this image to run the rest of the steps. Here is an example:

pipelines:
branches:
master:
- step:
name: Build the environment
services:
- docker
script:
- echo ${DOCKERHUB_PASSWORD} | docker login --username "$DOCKERHUB_USERNAME" --password-stdin
- docker build -t dockerhub-username/image-name .
- docker push dockerhub-username/image-name
- step:
name: Test
image: dockerhub-username/image-name
script:
- echo Running tests
TAGS
AUG Leaders

Atlassian Community Events