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

How to use services & caches in parallel steps?

Michael Delle March 8, 2018

I am using the bitbucket-pipelines.,yml validator, and the only way I can get it to pass is if I add the "name" and "deployment" to the last step. Or if I create an empty step at the beginning.

It would be nice to be able to put "name" and "deployment" right after "default:"

pipelines:
default:
- step:
name: Build & Test
deployment: test
script:
- Nothing
- parallel:
- step:

Parallel Documentation: https://confluence.atlassian.com/bitbucket/parallel-steps-946606807.html

 Validator: https://bitbucket-pipelines.atlassian.io/validator

 And not that it matters since I am only using the "Validator", my account is "Alpha".

pipelines:
default:
- parallel:
- step:
caches:
- composer
script:
- composer install
- step:
script:
- make database
services:
- database
- step:
script:
- make lint
- step:
name: Build & Test
deployment: test
script:
- make test

definitions:
services:
database:
image: mysql:5.5.43

 

2 answers

1 accepted

2 votes
Answer accepted
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 5, 2018

Hi Michael,

Parallel steps currently cannot export artifacts. We've currently designed it with speeding up test steps at the moment. However, you can import previous artifacts into parallel steps.

For example:

pipelines:
  default:
    - step:
        name: Build
        artifacts:
          - dist/**  # artifacts are copied to all parallel steps
        script:
          - ...
    - parallel:     # run the steps below in parallel
        - step:
            name: Unit tests
            script:
              - ...
        - step:
            name: Integration tests
            script:
              - ...

Depending on how your build works, you may be able to adjust the artifact flow to support our current model.

Feel free to open a feature request with your specific needs if you'd like to see parallel steps functionality extended: https://bitbucket.org/site/master/issues/new

Thanks,

Phil

prilutskiyinfor March 23, 2020

It would be great if you could mention this kind of thing in the public docs.

elanclarkson March 27, 2024

I'm guessing this is just an old post, but in case anyone else stumbles upon it you can in fact export artifacts from parallel steps now:

https://support.atlassian.com/bitbucket-cloud/docs/parallel-step-options/#:~:text=Parallel%20steps%20can%20produce%20and%20consume%20artifacts

0 votes
Michael Delle March 8, 2018

This way works fine except it clones a new repo each time. I'm hoping I can share the "artifact"

pipelines:
default:
- parallel:
- step:
name: Install Dependencies
caches:
- composer
script:
- composer install
- step:
name: Create Database
script:
- make database
services:
- database
- step:
name: Lint
script:
- make lint
- step:
name: Test
deployment: test
script:
- make test

definitions:
services:
database:
image: mysql:5.5.43
Philip Hodder
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 5, 2018

<Removing duplicate response>

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events