Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do Pipelines handle services in parallel steps?

Victor Furtado April 25, 2019

I have the following bitbucket-pipelines.yaml configured in my repository:

pipelines:
default:
- parallel:
- step:
name: Test API v1
caches:
- pip
script:
- make test-api-v1
services:
- mysql
- postgres
- redis
- step:
name: Test API v2
caches:
- pip
script:
- make test-api-v2
services:
- mysql
- postgres
- redis

definitions:
services:
mysql:
image: mysql:5.6
environment:
MYSQL_DATABASE: 'test'
MYSQL_USER: 'test'
MYSQL_PASSWORD: 'test'
MYSQL_ROOT_PASSWORD: 'test'
postgres:
image: postgres:9.5
environment:
POSTGRES_DB: 'test'
POSTGRES_USER: 'test'
POSTGRES_PASSWORD: 'test'
redis:
image: redis

I want to know what is the behavior of the services at each parallel step. Will each step get its own instances of these services? Or will they share the access to the same services instances?

Thanks

1 answer

1 accepted

0 votes
Answer accepted
Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 30, 2019

Hi @Victor Furtado

Thank you for sharing the bitbucket-pipelines.yml file.

Each service will have its own container. Services from the same step are linked to the build container for that step, therefore having the same scope of ports.

In your case, the services are in different steps which means that the second step will not use the same services as the first one.

I hope that answers your question. 
Let me know if you need more clarification.

Victor Furtado May 13, 2019

Thanks @Daniel Santos 

Like Daniel Santos likes this
Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 14, 2019

You are welcome! =]

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events