他の CI 環境での Gradle のリモート キャッシュの構成
Bitrise Build Cache では Bitrise CI を使用する必要はありません。他の CI/CD サービスを使用しても、リモート キャッシュを活用して Gradle のビルド時間を短縮できます。
これを行うには、ビルド中に Bitrise Build Cache CLI をダウンロードし、CLI を実行して Bitrise Build Cache を有効にするように CI 環境を構成する必要があります。
-
Select your Bitrise workspace and go to Build Cache.
-
Click New connection.
-
Select Other CI provider and then select your build tool from the dropdown menu.

-
Click .

-
Enter a name and set it to never expire.
-
Copy the variables and add them to your CI configuration as Environment Variables.
-
高速化するステップの前に、次のスクリプトを CI 構成に追加します。
環境
高速化したい Gradle コマンドと同じ環境でスクリプトを実行してください。たとえば、ビルド全体で複数の Docker コンテナを使用する場合は、Bitrise Build Cache CLI が Gradle コマンドと同じ Docker コンテナで実行されていることを確認してください。
#!/usr/bin/env bash set -euxo pipefail # download Bitrise Build Cache CLI curl -sSfL 'https://raw.githubusercontent.com/bitrise-io/bitrise-build-cache-cli/main/install/installer.sh' | sh -s -- -b /tmp/bin -d # run the CLI to enable Bitrise build cache for Gradle /tmp/bin/bitrise-build-cache activate gradle --cache --cache-push