Configure your runner in bitbucket-pipelines.yml

To use your runner in Pipelines, add a runs-on parameter to a step in the bitbucket.pipelines.yml file. The runner will run on the next available runner that has all the required labels.

  • If all matching runners are busy, your step will wait until one becomes available again.

  • If you don’t have any online runners in your repository that match all labels, the step will fail.

bitbucket_pipelines.yml

1 2 3 4 5 6 7 8 9 10 11 12 13 14 pipelines: custom: customPipelineWithRunnerStep: - step: name: Step 1 runs-on: - 'self.hosted' - 'my.custom.label' script: - echo "This step will run on a self hosted runner."; - step: name: Step 2 script: - echo "This step will run on Atlassian's infrastructure as usual.";

Large step size

A runs-on parameter must contain a self.hosted label.

You can allocate additional memory to a step that runs on a self-hosted runner.
At this time, valid sizes are 1x, 2x, 4x, and 8x. The corresponding memory available is 4GB, 8GB, 16GB, and 32GB.

Example: Increasing memory for a step that runs on a self-hosted runner

1 2 3 4 5 6 7 8 9 pipelines: default: - step: runs-on: - 'self.hosted' - 'my.custom.label' size: 8x script: - echo "This step will run on a self hosted runner with 32 GB of memory."

Custom docker-in-docker image

The minimum runner version with support for this feature is 1.179.

A runs-on parameter must contain a self.hosted label.

With runners, you have more control over the docker-in-docker daemon. Now you can specify a custom image for the docker service, but it only can be used if the step runs on a self-hosted runner.

Example: Using a custom docker image for a step that runs on a self-hosted runner

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 definitions: services: docker: # can only be used with a self-hosted runner image: docker:dind pipelines: default: - step: runs-on: - 'self.hosted' - 'my.custom.label' services: - docker script: - docker info

Define multiple docker services

Add a type parameter with the docker value to your service definition to use multiple docker services. It allows you to use a custom docker image on a self-hosted runner and a default docker service for steps that run in the cloud.

Example: Using multiple docker services

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 definitions: services: docker: # default docker service memory: 512 docker-custom: type: docker image: docker:dind pipelines: default: - step: name: Step 1 runs-on: - 'self.hosted' - 'my.custom.label' services: - docker-custom script: - docker info - step: name: Step 2 services: - docker script: - docker info - echo "This step will use the defult docker service defenition.";

Skip SSL on git clone

A runs-on parameter must contain a self.hosted label.

Add a skip-ssl-verify parameter to disable SSL verification during git clone and allow using a self-signed certificate.

Example

1 2 3 4 5 6 7 8 9 pipelines: default: - step: runs-on: - 'self.hosted' clone: skip-ssl-verify: true script: - echo "Use git with a self-signed certificate"
Last modified on Aug 9, 2021
Cached at 3:42 PM on Sep 25, 2021 |

Additional Help