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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.