Use the Bitrise step
With the Bitrise plugin step (also called the Bitrise step), you can use Bitrise Workflow Steps in your Harness CI pipelines. For more information about plugins in CI pipelines, go to Explore plugins.
Currently, the Bitrise plugin step is supported for Harness Cloud build infrastructure only. For other build infrastructures, you can run Bitrise Workflow Steps in a Run step or write a custom plugin.
Bitrise step usage example
In the following YAML example, a Harness Bitrise step runs the Android Build Bitrise step. It calls the source repo (bitrise-steplib/bitrise-step-android-build) and provides configuration parameters as described in the Android Build README.
- 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
- YAML editor
- Visual editor
Add a Bitrise
step to your pipeline, for example:
- 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 asgithub.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 asbuild_type: 'apk'
. For more information, go to Settings.env:
If required by the Bitrise Step, provide a mapping of environment variables to pass in. For more information, go to Environment Variables.
If you already configured Bitrise Steps elsewhere, you can transfer Bitrise Steps into Harness CI.
You can use expressions in the with
and env
settings. For example, credentials: <+stage.variables.[TOKEN_SECRET]>
uses an expression referencing a stage variable.
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.
Name
Enter a name summarizing the step's purpose. Harness automatically assigns an Id (Entity Identifier Reference) based on the Name. You can change the Id.
The Description is optional.
Uses
Specify the repo of the Bitrise Step that you want to use, for example github.com/bitrise-steplib/bitrise-step-android-build.git
.
Settings
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.
- Settings keys can be supplied as fixed values or runtime input, and values can be supplied as fixed values, runtime input, or expressions. For more information, go to Fixed values, runtime inputs, and expressions.
- 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 enterbuild_type
in the key field andapk
in the value field.
Environment Variables
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're passing to the Bitrise Workflow Step. These are separate from outgoing environment variables that might be produced by the Bitrise Step you're 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.
- You can use fixed values, runtime inputs, or expressions for environment variable values. For example,
<+stage.variables.[TOKEN_SECRET]>
is a variable expression stage variable. - 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 enterGITHUB_TOKEN
in the key field and<+secrets.getValue("github_pat")>
in the value field.
Empty environment variables
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 to enable the feature.
If your Bitrise Step requires an empty environment variable, you must contact Harness Support to enable an early access feature that allows empty environment variables in CI pipelines.
Timeout
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:
Transfer Bitrise Steps into Harness CI
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 |
|
|