Use the Bitrise step
With the Bitrise plugin step (also called the Bitrise step), you can use Bitrise Integrations 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.
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 Integration to use, Bitrise Integration inputs, and environment variables that you want to pass to the Integration. These are configured according to the Integration's usage specifications.
uses:
Specify the Bitrise Integration's source repo, such asgithub.com/bitrise-steplib/bitrise-step-android-build.git
.with:
If required by the Integration, provide a mapping of key-value pairs representing Integration inputs, such asbuild_type: 'apk'
. For more information, go to Settings.env:
If required by the Integration, provide a mapping of environment variables to pass to the Integration. For more information, go to Environment Variables.
If you already configured Bitrise Integrations elsewhere, you can transfer Bitrise Integrations 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 Integration'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 Integration that you want to use, for example github.com/bitrise-steplib/bitrise-step-android-build.git
.
Settings
If required by the Integration, add key-value pairs representing Integration inputs, such as build_type: 'apk'
. Refer to the Integration's usage specifications for details about specific inputs available for the Integration 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 Integration, add key-value pairs representing environment variables that you want to pass to the Integration, such as GITHUB_TOKEN: <+secrets.getValue("github_pat")>
. Note that these are incoming environment variables that you're passing to the Bitrise Integration, which are separate from outgoing environment variables that are output by the Integration.Refer to the Integration's usage specifications for details about specific environment variables relevant to the Integration 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.
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 Integrations into Harness CI
If you already configured Bitrise Integrations 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` |
|
|