Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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

How to write multiple steps or parallels in bitbucket-pipelines.yml file for a self-hosted runner

I have created a self-hosted runner to run the bitbucket pipeline. There I want to run multiple steps or parallel on the same runner.

But only the step which has 'runs-on' tag with the label 'self.hosted' is running on the runner, other steps are running on Atlassian's infrastructure.

I don't want to add a repetitive 'runs-on' tag for each step.

Below is my current bitbucket-pipeline.yml file structure:

pipelines:
default:
- step:
runs-on:
- 'self.hosted'
- step:
name: Upload app
script:
- chmod +x appUpload.sh
- ./appUpload.sh
- parallel:
- step:
name: Build and Test
caches:
- maven
script:
- mvn clean
- mvn -B verify --file pom.xml test
after-script:
- pipe: atlassian/checkstyle-report:0.2.0
- step:
name: Security Scan
script:
- pipe: atlassian/git-secrets-scan:0.4.3

 

1 answer

0 votes

Hi @Ashish Srivastava,

Steps that will run on a runner must have the runs-on parameter and this parameter must contain a self.hosted label. It is not possible at the moment to specify that all steps will run on a runner, without adding this parameter for every step.

A runner can run one step at a time. It allocates the resources you provided to run your build, so when you have multiple steps or parallel steps it is queued up because the resources are currently used by one of the other steps.

If you wish to run parallel steps together you'll have to create a runner for every single step and make use of labels to label the runner according to your steps. It is possible to host multiple runners on a single host as long as the host has the necessary resources to run all the builds otherwise the build will fail.

We have a feature request in our issue tracker for the ability to specify that all steps will run on a certain runner without repeating the runs-on parameter for every step:

And additionally for the ability to run parallel steps on a single runner:

If you'd be interested in these features, I would suggest adding your vote in the features requests (by selecting the Vote for this issue link) as the number of votes helps the development team and product managers better understand the demand for new features. You are more than welcome to leave any feedback, and you can also add yourself as a watcher (by selecting the Start watching this issue link) if you'd like to get notified via email on updates.

Implementation of new features is done as per our policy here and any updates will be posted in the feature requests.

Please feel free to let me know if you have any questions.

Kind regards,
Theodora

Suggest an answer

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

⭐ Calling all Bitbucket and DevOps experts: Special showcase opportunity ⭐

Hi, Bitbucket community! Are you a DevOps practitioner (or know one in your network)? Do you have DevOps tips, tricks, or learnings you'd like to share with the community? If so, we'd love to hea...

1,487 views 4 8
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