It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Sharing environment across steps

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

0 votes

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

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,038 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you