Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

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:

- step:
- 'self.hosted'
- step:
name: Upload app
- chmod +x
- ./
- parallel:
- step:
name: Build and Test
- maven
- mvn clean
- mvn -B verify --file pom.xml test
- pipe: atlassian/checkstyle-report:0.2.0
- step:
name: Security Scan
- 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,

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events