### Run npm install command with npm Step Source: https://docs.bitrise.io/en/bitrise-ci/getting-started/quick-start-guides/getting-started-with-web-ci This snippet shows how to configure the npm Step to install project dependencies. The 'command' input specifies the npm command to run, with 'install -g' being a common global installation command. ```yaml - npm: inputs: - command: install -g ``` ```yaml - npm: inputs: - command: install -g ``` -------------------------------- ### Configuring Key-Based Caching with Script Steps Source: https://docs.bitrise.io/en/bitrise-ci/getting-started/quick-start-guides/getting-started-with-web-ci This outlines the use of Bitrise Script Steps to configure key-based caching. It provides full control over the caching setup for dependencies and build artifacts, overriding the automatic configuration of dedicated caching steps. ```shell # Example of a Bitrise Script Step for custom key-based caching setup # This is a conceptual example; actual commands depend on the caching strategy. # For instance, you might use cache-related commands here. echo "Configuring custom cache keys..." ``` -------------------------------- ### Configure Gradle task and wrapper path with gradle-runner Step Source: https://docs.bitrise.io/en/bitrise-ci/getting-started/quick-start-guides/getting-started-with-web-ci This snippet shows how to use the gradle-runner Step to execute Gradle tasks for dependency installation. It requires specifying the path to the Gradle Wrapper ('gradlew_path') and the Gradle task to run ('gradle_task'). ```yaml - gradle-runner: inputs: - gradlew_path: ./cool_project/ - gradle_task: install ``` ```yaml - gradle-runner: inputs: - gradlew_path: ./cool_project/ - gradle_task: install ``` -------------------------------- ### Installing Node.js with ASDF in Bitrise Source: https://docs.bitrise.io/en/bitrise-ci/getting-started/quick-start-guides/getting-started-with-web-ci This code installs Node.js using ASDF in a Bitrise environment. It configures ASDF to use the latest installed version and manages the Node.js project directory. This is typically used within a Script Step. ```shell set -euxo pipefail export ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY=latest_installed envman add --key ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY --value latest_installed pushd "${NODEJS_PROJECT_DIR:-.}" > /dev/null asdf install nodejs popd > /dev/null ``` -------------------------------- ### Install Flutter SDK using flutter-installer Step Source: https://docs.bitrise.io/en/bitrise-ci/testing/testing-flutter-apps/running-the-dart-analyzer-on-bitrise Configures the flutter-installer step to set up the Flutter SDK. It handles initial setup and installation of missing components. The 'version' input allows specifying the SDK version, defaulting to 'stable'. ```yaml primary: description: | Builds project and runs tests. steps: - activate-ssh-key: {} - git-clone: {} - flutter-installer: inputs: ``` ```yaml - flutter-installer: inputs: - version: 3.7.7 ``` -------------------------------- ### Testing Java Projects with Maven Wrapper Source: https://docs.bitrise.io/en/bitrise-ci/getting-started/quick-start-guides/getting-started-with-web-ci This snippet demonstrates how to execute tests for Java projects using the Maven Wrapper. It relies on the `./mvnw test` command within a Bitrise Script Step. Custom Maven configurations can be applied. ```shell # Example of a Bitrise Script Step for Maven tests ./mvnw test ``` -------------------------------- ### Configure yarn command and arguments with yarn Step Source: https://docs.bitrise.io/en/bitrise-ci/getting-started/quick-start-guides/getting-started-with-web-ci This snippet demonstrates configuring the yarn Step to manage project dependencies. The 'command' input is used to specify the yarn command, and 'args' allows for additional command-line arguments. ```yaml - yarn: inputs: - command: ``` ```yaml - yarn: inputs: - command: ``` ```yaml - yarn: inputs: - args: "-dev" ``` ```yaml - yarn: inputs: - args: "-dev" ``` -------------------------------- ### Install Flutter SDK from Bundle URL - YAML Source: https://docs.bitrise.io/en/bitrise-ci/testing/testing-flutter-apps/running-the-dart-analyzer-on-bitrise Installs the Flutter SDK from a specified installation bundle URL. The `version` input is ignored when using this method. The URL must start with 'https://storage.googleapis.com/flutter_infra'. ```yaml - flutter-installer: inputs: - installation_bundle_url: https://storage.googleapis.com/flutter_infra/releases/beta/macos/flutter_macos_v1.6.3-beta.zip ``` -------------------------------- ### Running npm Lint and Test Commands in Bitrise Source: https://docs.bitrise.io/en/bitrise-ci/getting-started/quick-start-guides/getting-started-with-web-ci This demonstrates running linting and testing commands for Node.js projects using npm within Bitrise. The `npm run lint` command is used for code analysis, and `npm run test` executes defined tests from `package.json`. ```shell # Example of Bitrise Steps for npm linting and testing # Linting npm run lint # Testing npm run test ``` -------------------------------- ### Building a Docker Image with Docker Build & Push Step Source: https://docs.bitrise.io/en/bitrise-ci/getting-started/quick-start-guides/getting-started-with-web-ci This describes the configuration for the Docker Build & Push Step in Bitrise, used to build and push Docker images. It supports specifying image tags, build context, and Dockerfile path, along with built-in key-based caching for Docker images. ```shell # Conceptual example for Docker Build & Push Step configuration in Bitrise yml # docker-buildx@x.y.z: # title: "Build and push Docker image" # inputs: # - tag_list: "latest,v1.0.0" # - dockerfile_path: "Dockerfile" # - build_context: "." # - cache: "true" # Example for enabling cache ``` -------------------------------- ### Initialize Bitrise Project Locally with `bitrise init` Source: https://docs.bitrise.io/en/bitrise-ci/bitrise-cli/initializing-a-bitrise-project-locally This command initiates the Bitrise project setup process on your local machine. It scans your project to detect its type and generates the necessary configuration files. Ensure the Bitrise CLI is installed and accessible in your system's PATH. ```bash bitrise init ``` -------------------------------- ### App Setup API Source: https://docs.bitrise.io/en/bitrise-ci/api/api-reference Endpoints related to the application setup process, including registering new apps, uploading configuration files, and completing the registration. ```APIDOC ## POST /apps/register ### Description Add a new app. ### Method POST ### Endpoint /apps/register ### Parameters #### Request Body - **app_name** (string) - Required - The name of the new app - **provider** (string) - Required - The source code repository provider (e.g., github, gitlab) - **repository_url** (string) - Required - The URL of the repository - **owner** (string) - Optional - The owner of the repository ### Request Example ```json { "app_name": "New Mobile App", "provider": "github", "repository_url": "https://github.com/user/new-mobile-app.git", "owner": "user" } ``` ### Response #### Success Response (201) - **slug** (string) - Unique identifier for the newly created app - **status** (string) - Status of the app registration ### Response Example ```json { "slug": "new_app_slug_123", "status": "pending-configuration" } ``` ``` ```APIDOC ## POST /apps/{app-slug}/bitrise.yml ### Description Upload a new bitrise.yml for your application. ### Method POST ### Endpoint /apps/{app-slug}/bitrise.yml ### Parameters #### Path Parameters - **app-slug** (string) - Required - The unique identifier of the app #### Request Body - **yml** (string) - Required - The content of the bitrise.yml file - **commit_hash** (string) - Optional - The commit hash associated with this configuration ### Request Example ```json { "yml": "format_version: 1.0.0\ndefault_branch: main\nworkflows:\n deploy:\n steps:\n - git-clone@6:\n title: Git Clone\n - build-android@2:\n title: Build Android\n", "commit_hash": "abcdef123456" } ``` ### Response #### Success Response (200) - **status** (string) - Status of the upload operation ### Response Example ```json { "status": "success" } ``` ``` ```APIDOC ## GET /apps/{app-slug}/bitrise.yml/config ### Description Getting the location of the application's bitrise.yaml. ### Method GET ### Endpoint /apps/{app-slug}/bitrise.yml/config ### Parameters #### Path Parameters - **app-slug** (string) - Required - The unique identifier of the app ### Response #### Success Response (200) - **config_path** (string) - The path to the bitrise.yaml file ### Response Example ```json { "config_path": ".bitrise.yml" } ``` ``` ```APIDOC ## PUT /apps/{app-slug}/bitrise.yml/config ### Description Changing the location of the application's bitrise.yaml. ### Method PUT ### Endpoint /apps/{app-slug}/bitrise.yml/config ### Parameters #### Path Parameters - **app-slug** (string) - Required - The unique identifier of the app #### Request Body - **config_path** (string) - Required - The new path for the bitrise.yaml file ### Request Example ```json { "config_path": "bitrise/config.yml" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message ### Response Example ```json { "message": "Configuration path updated successfully." } ``` ``` ```APIDOC ## POST /apps/{app-slug}/finish ### Description Save the application at the end of the app registration process. ### Method POST ### Endpoint /apps/{app-slug}/finish ### Parameters #### Path Parameters - **app-slug** (string) - Required - The unique identifier of the app ### Response #### Success Response (200) - **status** (string) - Status indicating the app registration is complete ### Response Example ```json { "status": "registered" } ``` ``` ```APIDOC ## POST /apps/{app-slug}/register-ssh-key ### Description Add an SSH-key to a specific app. ### Method POST ### Endpoint /apps/{app-slug}/register-ssh-key ### Parameters #### Path Parameters - **app-slug** (string) - Required - The unique identifier of the app #### Request Body - **ssh_key** (string) - Required - The SSH private key content - **is_protected** (boolean) - Optional - Whether the SSH key is protected by a passphrase - **passphrase** (string) - Optional - The passphrase for the SSH key if protected ### Request Example ```json { "ssh_key": "-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----", "is_protected": false } ``` ### Response #### Success Response (200) - **status** (string) - Status of the SSH key registration ### Response Example ```json { "status": "registered" } ``` ``` ```APIDOC ## POST /apps/{app-slug}/register-webhook ### Description Register an incoming webhook for a specific application. ### Method POST ### Endpoint /apps/{app-slug}/register-webhook ### Parameters #### Path Parameters - **app-slug** (string) - Required - The unique identifier of the app #### Request Body - **url** (string) - Required - The URL to send webhook events to - **events** (array) - Required - List of events to trigger the webhook (e.g., 'build', 'deployment') - **event_type** (string) - The type of event ### Request Example ```json { "url": "https://example.com/webhook", "events": [ {"event_type": "build"}, {"event_type": "deployment"} ] } ``` ### Response #### Success Response (200) - **webhook_registration_id** (string) - The unique identifier for the webhook registration - **status** (string) - Status of the webhook registration ### Response Example ```json { "webhook_registration_id": "wh_abc123", "status": "registered" } ``` ``` -------------------------------- ### Configure Go Version in Bitrise Source: https://docs.bitrise.io/en/bitrise-ci/configure-builds/configuring-build-settings/configuring-tool-versions YAML example for installing a specific Go version in Bitrise. This configuration ensures the correct Go runtime is available for your builds. ```yaml tools: golang: 1.24.0 ``` -------------------------------- ### Send QR Code to Slack for App Builds (bitrise.yml) Source: https://docs.bitrise.io/en/bitrise-ci/workflows-and-pipelines/workflows/generic-workflow-recipes This Bitrise workflow sends a QR code linking to an app's installation page on bitrise.io to a Slack channel. It requires Slack webhook setup and uses the public install page URL as a thumbnail for the Slack message. ```yaml - deploy-to-bitrise-io@2: {} - create-install-page-qr-code@1: {} - slack@3: inputs: - channel: "#build-notifications" - thumb_url: $BITRISE_PUBLIC_INSTALL_PAGE_QR_CODE_IMAGE_URL - webhook_url: $SLACK_WEBHOOK - deploy-to-bitrise-io@2: {} - create-install-page-qr-code@1: {} - slack@3: inputs: - channel: "#build-notifications" - thumb_url: $BITRISE_PUBLIC_INSTALL_PAGE_QR_CODE_IMAGE_URL - webhook_url: $SLACK_WEBHOOK ``` -------------------------------- ### Android Build for UI Testing Step Configuration Example (YAML) Source: https://docs.bitrise.io/en/bitrise-ci/testing/device-testing-with-firebase/device-testing-for-android This YAML configuration shows a more detailed setup for the 'android-build-for-ui-testing' step. It includes inputs for module, variant, project location, and additional arguments and APK path patterns, essential for customizing the build process. ```yaml my-workflow: steps: - git-clone: {} - android-build-for-ui-testing: inputs: - module: module - variant: variant - apk_path_pattern: '*/build/outputs/apk/*.apk' - arguments: arg - project_location: $BITRISE_SOURCE_DIR ``` -------------------------------- ### App Setup API Source: https://docs.bitrise.io/en/api/api-reference Endpoints related to the initial setup and registration of applications on Bitrise, including adding new apps, uploading configuration files, and registering SSH keys or webhooks. ```APIDOC ## App Setup API ### Description Endpoints related to the initial setup and registration of applications on Bitrise. ### Endpoints #### POST /apps/register **Description:** Add a new app. **Method:** POST **Endpoint:** `/apps/register` #### POST /apps/{app-slug}/bitrise.yml **Description:** Upload a new bitrise.yml for your application. **Method:** POST **Endpoint:** `/apps/{app-slug}/bitrise.yml` #### GET /apps/{app-slug}/bitrise.yml/config **Description:** Getting the location of the application's bitrise.yaml. **Method:** GET **Endpoint:** `/apps/{app-slug}/bitrise.yml/config` #### PUT /apps/{app-slug}/bitrise.yml/config **Description:** Changing the location of the application's bitrise.yaml. **Method:** PUT **Endpoint:** `/apps/{app-slug}/bitrise.yml/config` #### POST /apps/{app-slug}/finish **Description:** Save the application at the end of the app registration process. **Method:** POST **Endpoint:** `/apps/{app-slug}/finish` #### POST /apps/{app-slug}/register-ssh-key **Description:** Add an SSH-key to a specific app. **Method:** POST **Endpoint:** `/apps/{app-slug}/register-ssh-key` #### POST /apps/{app-slug}/register-webhook **Description:** Register an incoming webhook for a specific application. **Method:** POST **Endpoint:** `/apps/{app-slug}/register-webhook` ``` -------------------------------- ### Render and Install VPN Configuration Files Source: https://docs.bitrise.io/ja/bitrise-platform/integrations/connecting-to-a-vpn-during-a-build This snippet outlines the process of downloading VPN configuration templates (ipsec.conf, ipsec.secrets, server.crt), rendering them using environment variables, and then copying the finalized configuration files to the appropriate system directory. It also starts the strongSwan IPsec service. ```bash # Method for rendering a template string file (when run, returns the input string with $VARIABLES replaced from env) render_template() { eval "echo \"$(cat $1)\"" } # Create a temporary directory to hold files temp_dir=/tmp/vpn-config mkdir $temp_dir # IPsec config file, see examples at https://wiki.strongswan.org/projects/strongswan/wiki/IKEv1Examples and https://wiki.strongswan.org/projects/strongswan/wiki/IKEv2Examples echo "Downloading ipsec.conf..." wget https://www.example.com/ipsec.conf.template -O $temp_dir/ipsec.conf.template # IPsec credentials file, see documentation at https://wiki.strongswan.org/projects/strongswan/wiki/IpsecSecrets echo "Downloading ipsec.secrets..." wget https://www.example.com/ipsec.secrets.template -O $temp_dir/ipsec.secrets.template # In some cases you might need to download the certificate, or certificate chain, of your other VPN endpoint echo "Downloading server.crt..." wget https://www.example.com/server.crt -O $temp_dir/server.crt echo "Rendering config templates" render_template $temp_dir/ipsec.conf.template > $temp_dir/ipsec.conf render_template $temp_dir/ipsec.secrets.template > $temp_dir/ipsec.secrets echo "Installing configuration" $etc_sudo cp $temp_dir/ipsec.conf $etc_dir/ipsec.conf $etc_sudo cp $temp_dir/ipsec.secrets $etc_dir/ipsec.secrets $etc_sudo cp $temp_dir/server.crt $etc_dir/ipsec.d/ocspcerts/server.crt # Start the ipsec service echo "Starting ipsec" sudo ipsec start # We're sleeping between commands, mostly since Mac OS seems to have some problems otherwise sleep 1 # Output some helpful status to the log echo "Status ipsec" sudo ipsec statusall sleep 1 ``` -------------------------------- ### Install Bitrise Annotations Plugin Source: https://docs.bitrise.io/en/bitrise-ci/run-and-analyze-builds/build-annotations Installs the Bitrise Annotations plugin from a GitHub repository. This plugin is essential for creating build annotations. ```bash bitrise plugin install https://github.com/bitrise-io/bitrise-plugins-annotations.git ``` -------------------------------- ### Configure Strongswan VPN Connection (Linux/macOS) | Bitrise Source: https://docs.bitrise.io/ja/bitrise-platform/integrations/connecting-to-a-vpn-during-a-build This bash script automates the setup and connection to a Strongswan VPN for both Linux and macOS environments. It installs necessary packages, downloads configuration templates, and starts the VPN service. This script is intended to be used within a Bitrise build step. ```bash #!/usr/bin/env bash set -e echo "WAN IP" # This prints the servers Internet IP adress to the log, useful for debugging curl http://httpbin.org/ip case "$OSTYPE" in linux*) echo "Configuring for Linux" # Variables etc_dir=/etc etc_sudo='sudo' # Sudo is needed for Linux Strongswan configuration # Install strongswan echo "Installing Strongswan..." sudo apt-get install -y strongswan ;; darwin*) echo "Configuring for Mac OS" # Variables etc_dir=/usr/local/etc etc_sudo='' # Sudo is NOT needed for Mac OS Strongswan configuration # Install Strongswan using homebrew echo "Installing OpenSSL..." # Manually install OpenSSL first to save time, since installing Strongswan directly compiles OpenSSL from source instead brew install openssl echo "Installing Strongswan..." brew install strongswan ;; *) echo "Unknown operative system: $OSTYPE, exiting" exit 1 ;; esac # Method for rendering a template string file (when run, returns the input string with $VARIABLES replaced from env) render_template() { eval "echo \"$(cat $1)\"" } # Create a temporary directory to hold files temp_dir=/tmp/vpn-config mkdir $temp_dir # IPsec config file, see examples at https://wiki.strongswan.org/projects/strongswan/wiki/IKEv1Examples and https://wiki.strongswan.org/projects/strongswan/wiki/IKEv2Examples echo "Downloading ipsec.conf..." wget https://www.example.com/ipsec.conf.template -O $temp_dir/ipsec.conf.template # IPsec credentials file, see documentation at https://wiki.strongswan.org/projects/strongswan/wiki/IpsecSecrets echo "Downloading ipsec.secrets..." wget https://www.example.com/ipsec.secrets.template -O $temp_dir/ipsec.secrets.template # In some cases you might need to download the certificate, or certificate chain, of your other VPN endpoint echo "Downloading server.crt..." wget https://www.example.com/server.crt -O $temp_dir/server.crt echo "Rendering config templates" render_template $temp_dir/ipsec.conf.template > $temp_dir/ipsec.conf render_template $temp_dir/ipsec.secrets.template > $temp_dir/ipsec.secrets echo "Installing configuration" $etc_sudo cp $temp_dir/ipsec.conf $etc_dir/ipsec.conf $etc_sudo cp $temp_dir/ipsec.secrets $etc_dir/ipsec.secrets $etc_sudo cp $temp_dir/server.crt $etc_dir/ipsec.d/ocspcerts/server.crt # Start the ipsec service echo "Starting ipsec" sudo ipsec start ``` -------------------------------- ### Install Global npm Packages (Bash) Source: https://docs.bitrise.io/en/bitrise-ci/testing/testing-react-native-apps/running-detox-tests-on-bitrise Installs the Detox CLI and React Native CLI globally using npm. These commands are typically run in a script or a setup step within a CI/CD environment. ```bash install -g detox-cli install -g react-native-cli ``` -------------------------------- ### Install Carthage Dependencies using Bitrise Workflow Source: https://docs.bitrise.io/en/bitrise-ci/dependencies-and-caching/ios-dependencies/managing-dependencies-with-carthage This YAML snippet demonstrates how to add the Carthage step to a Bitrise workflow. It should be placed after cloning the repository and restoring any relevant caches, and before saving caches. This basic setup assumes the default 'bootstrap' command for Carthage. ```yaml my-workflow: steps: - activate-ssh-key: {} - git-clone: {} - restore-carthage-cache: {} - carthage: {} - save-carthage-cache: {} ``` -------------------------------- ### POST /apps/{app-slug}/finish Source: https://docs.bitrise.io/en/api/adding-and-managing-apps Finalize the application setup process. Call this after registering the app and optionally adding an SSH key. ```APIDOC ## POST /apps/{app-slug}/finish ### Description Completes the application registration process on Bitrise. This endpoint should be called after all initial setup steps, such as registering the app and adding an SSH key if necessary. ### Method POST ### Endpoint /apps/{app-slug}/finish ### Parameters #### Path Parameters - **app-slug** (string) - Required - The unique identifier (slug) of the application. ### Request Example (No request body required) ### Response #### Success Response (200) - **status** (string) - The status of the operation. #### Response Example ```json { "status": "ok" } ``` ``` -------------------------------- ### Example Option Chain Configuration Source: https://docs.bitrise.io/en/bitrise-ci/workflows-and-pipelines/developing-your-own-bitrise-step/creating-your-own-bitrise-project-scanner Illustrates a JSON structure for configuring an option chain, specifically for a 'Scheme' input. This example shows how the 'value_map' allows for branching logic, leading to different subsequent options or terminal configurations based on the selected value. ```json { "title": "Scheme", "env_key": "scheme", "value_map": { "SchemeWithTest": { "title": "Simulator name", "env_key": "simulator_name", "value_map": { "-": { "config": "bitrise_config_with_test" } } }, "SchemeWithoutTest": { "title": "Export method", "env_key": "export_method", "value_map": { "development": { "config": "bitrise_config_without_test" }, "app-store": { "config": "bitrise_config_without_test" }, "ad-hoc": { "config": "bitrise_config_without_test" } } } } } ``` -------------------------------- ### iOS CI Workflow for Main Branch Commits Source: https://docs.bitrise.io/en/bitrise-ci/workflows-and-pipelines/workflows/workflow-recipes-for-ios-projects An example CI workflow for iOS applications triggered by commits to the main branch. It includes dependency installation (Cocoapods, Carthage), running tests, archiving, deploying to Bitrise.io, sending Slack notifications, and managing cache. ```yaml format_version: '11' default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: ios workflows: ci: steps: - activate-ssh-key@4: run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}' - git-clone@6: {} - cache-pull@2: {} - cocoapods-install@2: {} - carthage@3: inputs: - carthage_options: "--use-xcframeworks --platform iOS" - recreate-user-schemes@1: inputs: - project_path: "$BITRISE_PROJECT_PATH" - xcode-test@4: inputs: - log_formatter: xcodebuild - xcodebuild_options: "-enableCodeCoverage YES" - xcode-archive@4: inputs: - project_path: "$BITRISE_PROJECT_PATH" - scheme: "$BITRISE_SCHEME" - automatic_code_signing: apple-id - distribution_method: development - deploy-to-bitrise-io@2: {} - slack@3: inputs: - channel: "#build-notifications" - webhook_url: "$SLACK_WEBHOOK" - cache-push@2: {} app: envs: - opts: is_expand: false BITRISE_PROJECT_PATH: BitriseTest.xcworkspace - opts: is_expand: false BITRISE_SCHEME: BitriseTest - opts: is_expand: false BITRISE_DISTRIBUTION_METHOD: development trigger_map: - push_branch: main workflow: ci ``` -------------------------------- ### Flutter: Install Specific SDK Version Source: https://docs.bitrise.io/en/bitrise-ci/workflows-and-pipelines/workflows/workflow-recipes-for-cross-platform-projects Installs a specific version of the Flutter SDK using a provided installation bundle URL. This is recommended for consistent builds. The configuration requires the `installation_bundle_url` input. ```yaml --- - flutter-installer@0: inputs: - installation_bundle_url: https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_2.5.3-stable.zip --- ``` ```yaml --- - flutter-installer@0: inputs: - installation_bundle_url: https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_2.5.3-stable.zip --- ``` -------------------------------- ### POST /apps/{app-slug}/finish Source: https://docs.bitrise.io/en/bitrise-ci/api/adding-and-managing-apps Completes the application registration process after initial setup. ```APIDOC ## POST /apps/{app-slug}/finish ### Description Finalizes the application registration process. This endpoint should be called after all necessary initial configurations, like SSH key registration, are completed. ### Method POST ### Endpoint `/apps/{app-slug}/finish` ### Parameters #### Path Parameters - **app-slug** (string) - Required - The unique identifier (slug) of the application. #### Query Parameters N/A #### Request Body (Request body structure not provided in source text.) ### Request Example (No example provided in source text) ### Response #### Success Response (200) Confirmation that the application setup is finished (structure not provided in source text). #### Response Example (No example provided in source text) ``` -------------------------------- ### Setup and Run Detox Tests (Bash) Source: https://docs.bitrise.io/en/bitrise-ci/testing/testing-react-native-apps/running-detox-tests-on-bitrise A bash script to set up necessary tools like `applesimutils` using Homebrew, then build and run Detox tests for a release configuration. It includes commands for installing `applesimutils` and executing Detox build and test commands. ```bash #!/bin/bash # applesimutils is a collection of utils for Apple simulators brew tap wix/brew brew install applesimutils # we are building and testing a release device configuration detox build --configuration ios.sim.release detox test --configuration ios.sim.release --cleanup ``` -------------------------------- ### Flutter: Install Latest Beta SDK Source: https://docs.bitrise.io/en/bitrise-ci/workflows-and-pipelines/workflows/workflow-recipes-for-cross-platform-projects Installs the latest beta version of the Flutter SDK. This is achieved by setting the 'version' input to 'beta' in the Flutter Install step. ```yaml - flutter-installer@0: inputs: - version: beta ``` ```yaml - flutter-installer@0: inputs: - version: beta ``` -------------------------------- ### Launch Offline Workflow Editor Session Source: https://docs.bitrise.io/ja/bitrise-ci/bitrise-cli/installing-and-upgrading-the-offline-workflow-editor Navigate to your project directory containing 'bitrise.yml' and then run this command to start an offline session with the workflow editor. This allows you to edit your workflows locally without an internet connection to bitrise.io. ```bash cd /path/to/your/project bitrise :workflow-editor ``` -------------------------------- ### Install StrongSwan VPN on Linux and macOS Source: https://docs.bitrise.io/en/bitrise-platform/integrations/connecting-to-a-vpn-during-a-build This snippet installs the StrongSwan VPN client, adapting the installation method based on the operating system. It uses `apt-get` for Linux and `brew` for macOS. Dependencies like OpenSSL are also handled for macOS. ```bash #!/usr/bin/env bash set -e echo "WAN IP" # This prints the servers Internet IP adress to the log, useful for debugging curl http://httpbin.org/ip case "$OSTYPE" in linux*) echo "Configuring for Linux" # Variables etc_dir=/etc etc_sudo='sudo' # Sudo is needed for Linux Strongswan configuration # Install strongswan echo "Installing Strongswan..." sudo apt-get install -y strongswan ;; darwin*) echo "Configuring for Mac OS" # Variables etc_dir=/usr/local/etc etc_sudo='' # Sudo is NOT needed for Mac OS Strongswan configuration # Install Strongswan using homebrew echo "Installing OpenSSL..." # Manually install OpenSSL first to save time, since installing Strongswan directly compiles OpenSSL from source instead brew install openssl echo "Installing Strongswan..." brew install strongswan ;; *) echo "Unknown operative system: $OSTYPE, exiting" exit 1 ;; esac ``` -------------------------------- ### Run a Bitrise Workflow Source: https://docs.bitrise.io/en/bitrise-ci/references/workflows-reference Command-line examples for executing specific workflows defined in a bitrise.yml file. This demonstrates how to trigger a single workflow or a chain of workflows. ```bash bitrise run send-notifications bitrise run setup bitrise run test bitrise run ci bitrise run deploy ``` -------------------------------- ### GitHub Pull Request Build QR Code Comment (bitrise.yml) Source: https://docs.bitrise.io/ja/bitrise-ci/workflows-and-pipelines/workflows/generic-workflow-recipes Bitrise workflow steps to deploy an app, create a QR code for the installation page, and comment on a GitHub pull request with the QR code and installation URL. Requires a GitHub personal access token. ```yaml - deploy-to-bitrise-io@2: {} - create-install-page-qr-code@1: {} - comment-on-github-pull-request@0: inputs: - body: |- ![QR code]($BITRISE_PUBLIC_INSTALL_PAGE_QR_CODE_IMAGE_URL) $BITRISE_PUBLIC_INSTALL_PAGE_URL - personal_access_token: "$GITHUB_ACCESS_TOKEN" - deploy-to-bitrise-io@2: {} - create-install-page-qr-code@1: {} - comment-on-github-pull-request@0: inputs: - body: |- ![QR code]($BITRISE_PUBLIC_INSTALL_PAGE_QR_CODE_IMAGE_URL) $BITRISE_PUBLIC_INSTALL_PAGE_URL - personal_access_token: "$GITHUB_ACCESS_TOKEN" ``` -------------------------------- ### Minimal Bitrise.yml Configuration Source: https://docs.bitrise.io/en/bitrise-ci/references/basics-of-bitrise-yml This is the most basic valid bitrise.yml file. It declares the format version but does not include any executable steps. It's a starting point for defining build configurations. ```yaml format_version: 11 ``` -------------------------------- ### Install pyenv and uv (Shell) Source: https://docs.bitrise.io/en/bitrise-platform/ai/bitrise-mcp Installs pyenv for Python version management and uv, a fast Python package installer, using curl commands. This is a prerequisite for setting up the Bitrise MCP. ```shell curl -fsSL https://pyenv.run | bash pyenv install 3.12.6 # Install uv curl -LsSf https://astral.sh/uv/install.sh | sh ``` -------------------------------- ### Install Project Dependencies and Expo CLI Source: https://docs.bitrise.io/en/bitrise-ci/workflows-and-pipelines/workflows/workflow-recipes-for-cross-platform-projects This snippet outlines the steps to install project dependencies using npm and global packages like `turtle-cli` and `expo-cli`. It ensures that the necessary command-line tools are available for subsequent build steps. Node.js and Fastlane versions are also checked. ```yaml steps: - script@1: title: Install dependencies inputs: - content: |- #!/usr/bin/env bash set -ex node --version fastlane --version npm install -g turtle-cli turtle --version npm install -g expo-cli expo --version - npm@1: title: Install project dependencies inputs: - command: install ``` -------------------------------- ### Example: Iterating Through Registered Apps Source: https://docs.bitrise.io/en/bitrise-ci/api/pagination-of-api-calls A step-by-step example demonstrating how to retrieve all registered applications using pagination. ```APIDOC ## Example: Iterating Through All Registered Apps ### Description This example illustrates the practical steps to fetch all applications registered with your Bitrise account using the pagination mechanism. ### Steps: 1. **Initial Call**: Make a GET request to the endpoint without any pagination parameters: ``` GET https://api.bitrise.io/v0.1/me/apps ``` 2. **Process Response and Check Paging**: Analyze the response. The `data` property will contain the list of apps for the current page. Inspect the `paging` object at the root level. *Example Response Snippet:* ```json { "data": [ { "slug": "app-slug-1", "name": "App One" }, { "slug": "app-slug-2", "name": "App Two" } ], "paging": { "total_item_count": 3, "page_item_limit": 2, "next": "518e869d56f2adfd" } } ``` In this example, `paging.next` has a value, indicating more apps are available. 3. **Fetch Next Page (if available)**: If the `paging` object contains a `next` property, construct the URL for the next page by appending the `next` query parameter with the value obtained from the response. In the example above, the `next` value is `518e869d56f2adfd`. ``` GET https://api.bitrise.io/v0.1/me/apps?next=518e869d56f2adfd ``` 4. **Repeat Until Last Page**: Continue this process of making calls with the `next` parameter and examining the `paging` object. The iteration stops when a response is received where the `paging` object does not contain a `next` property. This signifies that the last page of results has been retrieved. ``` -------------------------------- ### Install StrongSwan on Linux Source: https://docs.bitrise.io/ja/bitrise-platform/integrations/connecting-to-a-vpn-during-a-build This section configures the environment for Linux by setting relevant variables and installing the strongSwan package using `apt-get`. It is designed for Debian-based Linux distributions and requires root privileges for installation. ```bash case "$OSTYPE" in linux*) echo "Configuring for Linux" # Variables etc_dir=/etc etc_sudo='sudo' # Sudo is needed for Linux Strongswan configuration # Install strongswan echo "Installing Strongswan..." sudo apt-get install -y strongswan ;; darwin*) echo "Configuring for Mac OS" # Variables etc_dir=/usr/local/etc etc_sudo='' # Sudo is NOT needed for Mac OS Strongswan configuration # Install Strongswan using homebrew echo "Installing OpenSSL..." # Manually install OpenSSL first to save time, since installing Strongswan directly compiles OpenSSL from source instead brew install openssl echo "Installing Strongswan..." brew install strongswan ;; *) echo "Unknown operative system: $OSTYPE, exiting" exit 1 ;; esac ``` -------------------------------- ### Flutter Install Step Configuration Source: https://docs.bitrise.io/en/bitrise-ci/testing/testing-flutter-apps/running-unit-and-ui-tests-on-flutter-apps Configures the flutter-installer step to set up the Flutter SDK. It supports specifying a particular SDK version or using the default 'stable' version. ```yaml primary: description: | Builds project and runs tests. steps: - activate-ssh-key: {} - git-clone: {} - flutter-installer: inputs: ``` ```yaml # Installing version 3.7.7 of the Flutter SDK - flutter-installer: inputs: - version: 3.7.7 ``` -------------------------------- ### Flutter: Install Latest Stable SDK Source: https://docs.bitrise.io/en/bitrise-ci/workflows-and-pipelines/workflows/workflow-recipes-for-cross-platform-projects Installs the latest stable version of the Flutter SDK. This is the default behavior of the Flutter Install step if no specific version or bundle URL is provided. ```yaml - flutter-installer@0: {} ``` ```yaml - flutter-installer@0: {} ``` -------------------------------- ### Install and Configure Bitrise DEN Agent (Linux) Source: https://docs.bitrise.io/en/bitrise-platform/infrastructure/running-bitrise-builds-on-premise Installs the Bitrise DEN agent on Debian-based Linux systems using apt and then configures it with a provided runner pool token. Ensure apt update is run prior to installation. ```bash sudo apt update sudo apt install bitrise-den-agent /opt/bitrise/releases/bitrise-den-agent-configure.sh $TOKEN --enable-agent-self-update ``` -------------------------------- ### Install Native Dependencies with CocoaPods Source: https://docs.bitrise.io/ja/bitrise-ci/dependencies-and-caching/react-native-dependencies This example shows how to install native dependencies for a React Native app, specifically CocoaPods, within a Bitrise workflow. It includes running npm install, then executing the 'Run CocoaPods install' Step. ```yaml deploy: steps: - npm: run: "install" # ... other steps ... - activate-archive: # This step is used to activate the correct Xcode version if needed - cocoapods-install: # This step installs CocoaPods dependencies defined in the Podfile ``` -------------------------------- ### Install StrongSwan on macOS Source: https://docs.bitrise.io/ja/bitrise-platform/integrations/connecting-to-a-vpn-during-a-build This section configures the environment for macOS. It sets environment variables and uses Homebrew to install OpenSSL and strongSwan. It explicitly notes that `sudo` is not required for these Homebrew installations on macOS. ```bash case "$OSTYPE" in linux*) echo "Configuring for Linux" # Variables etc_dir=/etc etc_sudo='sudo' # Sudo is needed for Linux Strongswan configuration # Install strongswan echo "Installing Strongswan..." sudo apt-get install -y strongswan ;; darwin*) echo "Configuring for Mac OS" # Variables etc_dir=/usr/local/etc etc_sudo='' # Sudo is NOT needed for Mac OS Strongswan configuration # Install Strongswan using homebrew echo "Installing OpenSSL..." # Manually install OpenSSL first to save time, since installing Strongswan directly compiles OpenSSL from source instead brew install openssl echo "Installing Strongswan..." brew install strongswan ;; *) echo "Unknown operative system: $OSTYPE, exiting" exit 1 ;; esac ``` -------------------------------- ### Install pyenv, Python, and uv Source: https://docs.bitrise.io/en/bitrise-platform/ai/bitrise-mcp These commands install pyenv for Python version management, Python 3.12.6, and uv, a fast Python package installer and dependency resolver. Ensure these tools are available before configuring the MCP server. ```bash curl -fsSL https://pyenv.run | bash pyenv install 3.12.6 curl -LsSf https://astral.sh/uv/install.sh | sh ``` -------------------------------- ### Start and Wait for Bitrise Builds Source: https://docs.bitrise.io/en/bitrise-ci/workflows-and-pipelines/workflows/generic-workflow-recipes This configuration demonstrates how to use the 'Bitrise Start Build' step to trigger multiple workflows and the 'Bitrise Wait for Build' step to await their completion within a parent workflow. It requires a Bitrise API key for authentication and specifies the workflows to be executed. It's designed for starting builds for different apps. ```yaml parent-workflow: steps: - build-router-start@0: inputs: - workflows: |- workflow-1 workflow-2 - access_token: "$BITRISE_API_KEY" - script@1: inputs: - content: echo "Doing something else..." - build-router-wait@0: inputs: - access_token: "$BITRISE_API_KEY" ``` -------------------------------- ### Bitrise YAML Configuration for a Local Build Source: https://docs.bitrise.io/en/bitrise-ci/bitrise-cli/running-your-first-local-build-with-the-cli This is a sample `bitrise.yml` file that defines environment variables and a 'test' workflow. This configuration is used to run a basic 'Hello World' script locally with the Bitrise CLI. It specifies the format version and the default step library source. ```yaml format_version: 11 default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git app: envs: - MY_NAME: My Name workflows: test: steps: - script@1.1.3: inputs: - content: echo "Hello ${MY_NAME}!" ``` -------------------------------- ### Install Bitrise Agent using Homebrew (macOS/Linux) Source: https://docs.bitrise.io/en/bitrise-platform/infrastructure/running-bitrise-builds-on-premise These commands use Homebrew to tap the Bitrise agent repository and install the latest version of the `bitrise-den-agent`. This is a prerequisite for running Bitrise builds on-premise. ```shell brew tap bitrise-io/den-agent brew install bitrise-den-agent ``` -------------------------------- ### Configure google-play-deploy Step with Deployment Track Source: https://docs.bitrise.io/en/bitrise-ci/getting-started/quick-start-guides/getting-started-with-android-projects This snippet shows the complete configuration for the google-play-deploy Step, including the service account key path, package name, and the target deployment track (e.g., 'alpha'). ```yaml deploy-workflow: steps: - google-play-deploy: inputs: - service_account_json_key_path: "$BITRISEIO_SERVICE_ACCOUNT_JSON_KEY_URL" - package_name: myApp - track: alpha ``` -------------------------------- ### Configure Tuist Version in Bitrise Source: https://docs.bitrise.io/en/bitrise-ci/configure-builds/configuring-build-settings/configuring-tool-versions YAML example for installing a specific Tuist version in Bitrise. This ensures the correct version of the Tuist dependency manager is used for your builds. ```yaml tools: tuist: 4.54.0 ``` -------------------------------- ### Configure Java Version in Bitrise Source: https://docs.bitrise.io/en/bitrise-ci/configure-builds/configuring-build-settings/configuring-tool-versions YAML example for installing a specific Java version (OpenJDK) in Bitrise. This ensures the correct Java Development Kit is available for your project. ```yaml tools: java: openjdk-25.0.0 ``` -------------------------------- ### Deploy Android App to Google Play with Signed APK/AAB Source: https://docs.bitrise.io/en/bitrise-ci/deploying/android-deployment/deploying-android-apps-to-bitrise-and-google-play This example shows the configuration for deploying an Android application to Google Play using the `Google Play Deploy` step. It requires a signed APK or AAB file and a service account JSON key. The JSON key can be uploaded to Bitrise or provided via a direct URL (local or remote). ```yaml workflows: example-workflow: steps: - activate-archive@1: inputs: - archive_path: "$BITRISE_SIGNED_APK_PATH" - google-play-deploy@1: inputs: - service_account_json_key_path: "$BITRISEIO_SERVICE_ACCOUNT_JSON_KEY_URL" - package_name: "your.package.name" - track: "production" ``` -------------------------------- ### Default Flutter Installer and Tester Workflow Source: https://docs.bitrise.io/en/bitrise-ci/testing/testing-flutter-apps/running-unit-and-ui-tests-on-flutter-apps A standard Bitrise workflow configuration for Flutter projects, including installing the SDK, restoring Dart cache, and running tests. ```yaml primary: description: | Builds project and runs tests. steps: - activate-ssh-key: {} - git-clone: {} - flutter-installer: inputs: - version: stable - is_update: false - restore-dart-cache: {} - flutter-test: inputs: ``` -------------------------------- ### Install Bitrise Build Cache CLI for Gradle Source: https://docs.bitrise.io/en/bitrise-build-cache/build-cache-for-gradle/configuring-the-build-cache-for-gradle-in-local-builds This command downloads and installs the Bitrise Build Cache CLI to a specified temporary location. It's used to manage build cache configurations. The script retries the download up to 5 times and ensures a safe and clean installation. ```bash curl --retry 5 -sSfL 'https://raw.githubusercontent.com/bitrise-io/bitrise-build-cache-cli/main/install/installer.sh' | sh -s -- -b /tmp/bin -d ``` -------------------------------- ### Switch Tool Version Manager in Bitrise Source: https://docs.bitrise.io/en/bitrise-ci/configure-builds/configuring-build-settings/configuring-tool-versions Example of how to switch the primary tool version manager used by Bitrise from 'mise' to 'asdf'. This configuration affects how tools are installed and managed at runtime. ```yaml tool_config: provider: asdf ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.