> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/ci-bitrise-plugin.md).

# Use the Bitrise step

Use Bitrise Workflow Steps in your Harness CI pipelines.

With the **Bitrise plugin** step (also called the **Bitrise** step), you can use [Bitrise Workflow Steps](https://bitrise.io/integrations/steps) in your Harness CI pipelines. Go to [Explore plugins](https://developer.harness.io/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/explore-ci-plugins.md) to know about plugins in CI pipelines.

{% hint style="info" %}
Currently, the **Bitrise plugin** step is supported for Harness Cloud build infrastructure only. For other build infrastructures, you can run [Bitrise Workflow Steps](https://bitrise.io/integrations/steps) in a Run step or write a custom plugin.
{% endhint %}

## Bitrise step usage example <a href="#bitrise-step-usage-example" id="bitrise-step-usage-example"></a>

In the following YAML example, a Harness **Bitrise** step runs the [Android Build Bitrise step](https://bitrise.io/integrations/steps/android-build). It calls the source repo ([bitrise-steplib/bitrise-step-android-build](https://github.com/bitrise-steplib/bitrise-step-android-build)) and provides configuration parameters as described in the [Android Build README](https://github.com/bitrise-steplib/bitrise-step-android-build#android-build).

```yaml
              - step:
                  type: Bitrise
                  name: bitrise android build
                  identifier: bitrise_android_build
                  spec:
                    uses: github.com/bitrise-steplib/bitrise-step-android-build.git
                    with:
                      variant: 'debug'
                      build_type: 'apk'
```

## Bitrise step settings and specifications <a href="#bitrise-step-settings-and-specifications" id="bitrise-step-settings-and-specifications"></a>

{% tabs %}
{% tab title="YAML editor" %}
Add a `Bitrise` step to your pipeline, for example:

```yaml
              - step:
                  type: Bitrise
                  name: bitrise android build
                  identifier: bitrise_android_build
                  spec:
                    uses: github.com/bitrise-steplib/bitrise-step-android-build.git
                    with:
                      variant: 'debug'
                      build_type: 'apk'
```

The `spec` parameters define which Bitrise Step to use, the Bitrise Step inputs, and the environment variables that you want to pass in. These are configured according to the Bitrise Step's usage specifications.

* `uses:` Specify the Bitrise Steps's source repo, such as `github.com/bitrise-steplib/bitrise-step-android-build.git`.
* `with:` If required by the Bitrise Step, provide a mapping of key-value pairs representing inputs, such as `build_type: 'apk'`. Go to [Settings](#settings) to see how settings are specified.
* `env:` If required by the Bitrise Step, provide a mapping of environment variables to pass in. Go to [Environment variables](#environment-variables) to see how Harness sets these.

{% hint style="info" %}
If you already configured Bitrise Steps elsewhere, you can [transfer Bitrise Steps into Harness CI](#transfer-bitrise-steps-into-harness-ci).

You can use [expressions](https://developer.harness.io/harness-platform/use-harness-platform/variables-and-expressions/runtime-inputs.md) in the `with` and `env` settings. For example, `credentials: <+stage.variables.[TOKEN_SECRET]>` uses an expression referencing a [stage variable](https://developer.harness.io/harness-platform/use-harness-platform/pipelines/add-a-stage.md#stage-variables).
{% endhint %}
{% endtab %}

{% tab title="Visual editor" %}
In the Visual editor, add the **Bitrise plugin** step to your pipeline's **Build** stage, and then populate the settings. **Name** and **Uses** are required. Refer to each Bitrise Step's documentation for information about **Settings** and **Environment Variables**.
{% endtab %}
{% endtabs %}

### Name <a href="#name" id="name"></a>

Enter a name summarizing the step's purpose. Harness automatically assigns an **Id** ([Entity Identifier Reference](https://developer.harness.io/harness-platform/use-harness-platform/references/entity-identifier-reference.md)) based on the **Name**. You can change the **Id**.

The **Description** is optional.

### Uses <a href="#uses" id="uses"></a>

Specify the repo of the Bitrise Step that you want to use, for example `github.com/bitrise-steplib/bitrise-step-android-build.git`.

### Settings <a href="#settings" id="settings"></a>

If required by the Bitrise Step, add key-value pairs representing inputs, such as `build_type: 'apk'`. Refer to your chosen Bitrise Step's usage specifications for details about specific inputs available for the Bitrise Step that you want to use.

{% hint style="info" %}

* Settings keys can be supplied as fixed values or runtime input, and values can be supplied as fixed values, runtime input, or expressions. Go to [Fixed values, runtime inputs, and expressions](https://developer.harness.io/harness-platform/use-harness-platform/variables-and-expressions/runtime-inputs.md) to learn about these input types.
* In the Visual editor, there are separate fields for keys and values. For example, to specify `build_type: 'apk'` in the Visual editor, you would enter `build_type` in the key field and `apk` in the value field.
  {% endhint %}

### Environment variables <a href="#environment-variables" id="environment-variables"></a>

If required by the Bitrise Step, add key-value pairs representing environment variables that you want to pass to the Bitrise Step, such as `GITHUB_TOKEN: <+secrets.getValue("github_pat")>`.

These are *incoming* environment variables that you are passing to the Bitrise Workflow Step. These are separate from *outgoing* environment variables that might be produced by the Bitrise Step you are using. Refer to your chosen Bitrise Step's usage specifications for details about specific environment variables relevant to the Bitrise Step that you want to use.

{% hint style="info" %}

* You can use [fixed values, runtime inputs, or expressions](https://developer.harness.io/harness-platform/use-harness-platform/variables-and-expressions/runtime-inputs.md) for environment variable values. For example, `<+stage.variables.[TOKEN_SECRET]>` is a variable expression [stage variable](https://developer.harness.io/harness-platform/use-harness-platform/pipelines/add-a-stage.md#stage-variables).
* In the Visual editor, there are separate fields for keys and values. For example, to specify `GITHUB_TOKEN: <+secrets.getValue("github_pat")>` in the Visual editor, you would enter `GITHUB_TOKEN` in the key field and `<+secrets.getValue("github_pat")>` in the value field.
  {% endhint %}

**Empty environment variables**

{% hint style="info" %}
Currently, support for empty environment variables in CI pipelines is behind the feature flag `CI_USE_LESS_STRICT_EVALUATION_FOR_MAP_VARS`. Contact [Harness Support](mailto:support@harness.io) to enable the feature.
{% endhint %}

If your Bitrise Step requires an empty environment variable, contact [Harness Support](mailto:support@harness.io) to enable an [early access feature](https://developer.harness.io/continuous-integration/new-to-harness-ci/ci-supported-platforms.md#harness-ci-early-access-features) that allows empty environment variables in CI pipelines.

### Timeout <a href="#timeout" id="timeout"></a>

You can set the timeout limit for the step. Once the timeout limit is reached, the step fails and pipeline execution continues. To set skip conditions or failure handling for steps, go to:

* [Step Skip Condition settings](https://developer.harness.io/harness-platform/use-harness-platform/pipelines/step-skip-condition-settings.md)
* [Step Failure Strategy settings](https://developer.harness.io/harness-platform/use-harness-platform/pipelines/failure-handling/define-a-failure-strategy-on-stages-and-steps.md)

## Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

**My Bitrise Step requires an empty environment variable, and the step fails.** Support for empty environment variables is behind the feature flag `CI_USE_LESS_STRICT_EVALUATION_FOR_MAP_VARS`. Contact [Harness Support](mailto:support@harness.io) to enable the feature.

**My Bitrise Step fails on a build infrastructure other than Harness Cloud.** The Bitrise plugin step is currently supported only for Harness Cloud build infrastructure. Run the equivalent [Bitrise Workflow Steps](https://bitrise.io/integrations/steps) in a Run step, or write a custom plugin, for other build infrastructures.

## Transfer Bitrise steps into Harness CI <a href="#transfer-bitrise-steps-into-harness-ci" id="transfer-bitrise-steps-into-harness-ci"></a>

If you already configured Bitrise Workflow Steps elsewhere, the Bitrise `inputs` mapping is equivalent to the Harness Bitrise plugin step's `spec: with:` mapping. The following table compares Bitrise `inputs` specification with the equivalent Harness `with` specification.

|                                              |                                                 |
| -------------------------------------------- | ----------------------------------------------- |
| Bitrise `inputs`                             | Harness `with`                                  |
| `inputs: - variant: debug - build_type: apk` | `yaml with: variant: 'debug' build_type: 'apk'` |

## Support for Bitrise steps on VM and local runner build infrastructure <a href="#support-for-bitrise-steps-on-vm-and-local-runner-build-infrastructure" id="support-for-bitrise-steps-on-vm-and-local-runner-build-infrastructure"></a>

### Prerequisites for self-managed VM infrastructure <a href="#prerequisites-for-self-managed-vm-infrastructure" id="prerequisites-for-self-managed-vm-infrastructure"></a>

To support Bitrise steps in your self-managed VM infrastructure, your build VMs must include a few additional tools at runtime.

These tools are required for the GitHub Actions/Bitrise runners embedded within the Harness build process.

**Required tools**

Ensure that all build VMs (those provisioned by your runner) include:

* nodejs version 16 or higher
* python3 (with python pointing to python3)
* golang
* A correctly set HOME environment variable

These are prerequisites for the Bitrise step runtimes and are not automatically installed by Harness.

**Recommended: Install via user\_data script**

To automate provisioning of these tools, you can inject setup commands through the runner’s `user_data` in your `pool.yml`.

Here’s an example for Linux-based VMs:

```yaml
user_data: |
  #cloud-config
  runcmd:
    - 'sed -i "1s|^|HOME=/home/ubuntu\n|" /etc/environment'
    - 'curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -'
    - 'sudo apt install -y python3 python-is-python3 nodejs golang'
```

This script:

* Initializes the `HOME` variable for login shells
* Installs the required language runtimes and tooling
* Prepares the VM to run GitHub Actions and Bitrise step definitions reliably

{% hint style="info" %}
**MINIMUM DELEGATE VERSION**

To use Bitrise step types in Harness CI, your Harness Delegate must be version 863 or later.
{% endhint %}

Go to [user-data-example](https://developer.harness.io/continuous-integration/use-harness-ci/use-harness-ci/set-up-build-infrastructure/vm-build-infrastructure/set-up-an-aws-vm-build-infrastructure.md#user-data-example) for details.

### Prerequisites for local runner <a href="#prerequisites-for-local-runner" id="prerequisites-for-local-runner"></a>

Starting with **v0.1.19**, local runners support **Bitrise** and **GitHub Action steps**.

To use this feature, make sure:

* You are using **runner version v0.1.19 or later**.
* The **feature flag** `CI_ENABLE_PLUGIN_OUTPUT_SECRETS` is **enabled**.
* The machine has **access to github.com**, since the runner downloads additional binaries during execution.

## Next steps

* Go to [Settings](#settings) to configure inputs for your Bitrise Step.
* Go to [Explore plugins](https://developer.harness.io/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/explore-ci-plugins.md) to see other plugins you can use in CI pipelines.

{% @harness-feedback/feedback %}
