From 0646181523c5d25e1fee27762f884e1b3e0668f2 Mon Sep 17 00:00:00 2001 From: arpadkun Date: Thu, 22 Oct 2026 09:13:25 -0700 Subject: [PATCH 1/2] Rename Gemini CLI to Antigravity CLI in MCP client mentions Google replaced Gemini CLI with Antigravity CLI. Update the client lists on the hand-maintained AI pages, their Japanese copies, and the static onboarding-for-agents mirror. The synced install guide (install-gemini-cli) is unchanged: its steps are Gemini CLI specific and the source lives in bitrise-io/bitrise-mcp. Co-Authored-By: Claude Opus 5.5 --- docs/bitrise-platform/ai/ai-features-on-bitrise.mdx | 2 +- docs/bitrise-platform/ai/bitrise-mcp/bitrise-mcp.mdx | 2 +- docs/bitrise-platform/ai/onboarding-for-agents.mdx | 4 ++-- .../current/bitrise-platform/ai/ai-features-on-bitrise.mdx | 2 +- .../current/bitrise-platform/ai/bitrise-mcp/bitrise-mcp.mdx | 2 +- .../current/bitrise-platform/ai/onboarding-for-agents.mdx | 4 ++-- static/onboarding-for-agents.md | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/bitrise-platform/ai/ai-features-on-bitrise.mdx b/docs/bitrise-platform/ai/ai-features-on-bitrise.mdx index 86f6217a..42e60176 100644 --- a/docs/bitrise-platform/ai/ai-features-on-bitrise.mdx +++ b/docs/bitrise-platform/ai/ai-features-on-bitrise.mdx @@ -64,4 +64,4 @@ The [Bitrise Model Context Protocol (MCP) Server](/bitrise-platform/ai/bitrise-m - Optimize configurations by instructing the AI to suggest improvements. You will receive instant insights and practical suggestions. - Automate manual tasks such as handling permissions, inviting members to a project, or looking for old builds. Tell the AI agent about your requirements: it will send you the proposed steps for review and ask for permission before executing each action. You can review the results at each step of the process. -Bitrise MCP supports multiple AI clients, including Claude, Cursor, VS Code, Windsurf, Gemini CLI, and AWS Kiro. See [Bitrise MCP](/bitrise-platform/ai/bitrise-mcp) for the full list of supported clients and setup instructions. +Bitrise MCP supports multiple AI clients, including Claude, Cursor, VS Code, Windsurf, Antigravity CLI, and AWS Kiro. See [Bitrise MCP](/bitrise-platform/ai/bitrise-mcp) for the full list of supported clients and setup instructions. diff --git a/docs/bitrise-platform/ai/bitrise-mcp/bitrise-mcp.mdx b/docs/bitrise-platform/ai/bitrise-mcp/bitrise-mcp.mdx index 0441ad6e..80b56541 100644 --- a/docs/bitrise-platform/ai/bitrise-mcp/bitrise-mcp.mdx +++ b/docs/bitrise-platform/ai/bitrise-mcp/bitrise-mcp.mdx @@ -15,6 +15,6 @@ The remote MCP server is hosted at mcp.bitrise.io. Most MCP clients (Claude Code You can find [the Bitrise MCP repository on GitHub](https://github.com/bitrise-io/bitrise-mcp). Among other things, it includes: -- Install guides for specific MCP clients. The currently supported clients are: VS Code, GitHub Copilot in other IDEs, Claude Applications (Desktop and Code CLI), Cursor, Windsurf, AWS Kiro, and Gemini CLI. +- Install guides for specific MCP clients. The currently supported clients are: VS Code, GitHub Copilot in other IDEs, Claude Applications (Desktop and Code CLI), Cursor, Windsurf, AWS Kiro, and Antigravity CLI. - How to use a local MCP server instead of the remote one. - What tools are available and how you can limit their usage. diff --git a/docs/bitrise-platform/ai/onboarding-for-agents.mdx b/docs/bitrise-platform/ai/onboarding-for-agents.mdx index 71767d7a..ba3d552c 100644 --- a/docs/bitrise-platform/ai/onboarding-for-agents.mdx +++ b/docs/bitrise-platform/ai/onboarding-for-agents.mdx @@ -28,7 +28,7 @@ The MCP server uses OAuth: it tells your client that it needs authorization, and ### Step 1: Get an AI client that supports MCP -You need an AI client that supports MCP. Each step below gives the configuration for the most common clients: Claude Code, Cursor, VS Code, and Claude Desktop. Bitrise MCP also supports [Windsurf](/bitrise-platform/ai/bitrise-mcp/installing-the-bitrise-mcp-server/install-windsurf), the [Google Gemini CLI](/bitrise-platform/ai/bitrise-mcp/installing-the-bitrise-mcp-server/install-gemini-cli), [AWS Kiro](/bitrise-platform/ai/bitrise-mcp/installing-the-bitrise-mcp-server/install-kiro), and [other Copilot IDEs](/bitrise-platform/ai/bitrise-mcp/installing-the-bitrise-mcp-server/install-other-copilot-ides). See each install guide for client-specific details. +You need an AI client that supports MCP. Each step below gives the configuration for the most common clients: Claude Code, Cursor, VS Code, and Claude Desktop. Bitrise MCP also supports [Windsurf](/bitrise-platform/ai/bitrise-mcp/installing-the-bitrise-mcp-server/install-windsurf), the [Google Antigravity CLI](/bitrise-platform/ai/bitrise-mcp/installing-the-bitrise-mcp-server/install-gemini-cli), [AWS Kiro](/bitrise-platform/ai/bitrise-mcp/installing-the-bitrise-mcp-server/install-kiro), and [other Copilot IDEs](/bitrise-platform/ai/bitrise-mcp/installing-the-bitrise-mcp-server/install-other-copilot-ides). See each install guide for client-specific details. ### Step 2: Connect the MCP server @@ -147,7 +147,7 @@ Editing the config in Step 2 takes effect only after the client reloads the Bitr - **VS Code (GitHub Copilot):** Open the Command Palette (`Cmd/Ctrl+Shift+P`), run **MCP: List Servers**, select **bitrise**, and choose **Restart**, or run **Developer: Reload Window**. - **Cursor:** Open **Settings → MCP (Tools)** and toggle the **bitrise** server off and on, or click its refresh icon. Restarting Cursor also works. - **Claude Desktop:** Quit the app fully (`Cmd+Q` on macOS, or quit from the system tray on Windows) and reopen it. Closing the window alone doesn't reload it. -- **Other clients (Windsurf, Gemini CLI, AWS Kiro):** Restart the client, or its MCP connection if it exposes one. +- **Other clients (Windsurf, Antigravity CLI, AWS Kiro):** Restart the client, or its MCP connection if it exposes one. ## If something goes wrong diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/bitrise-platform/ai/ai-features-on-bitrise.mdx b/i18n/ja/docusaurus-plugin-content-docs/current/bitrise-platform/ai/ai-features-on-bitrise.mdx index 19bf9dde..588c03f5 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/bitrise-platform/ai/ai-features-on-bitrise.mdx +++ b/i18n/ja/docusaurus-plugin-content-docs/current/bitrise-platform/ai/ai-features-on-bitrise.mdx @@ -64,4 +64,4 @@ AI設定アシスタントを使用するには、各プロジェクトのVS Code(GitHub Copilot): Commandパレット(`Cmd/Ctrl+Shift+P`)を開き、MCP: List Serversを実行してbitriseを選択し、Restartを選ぶか、Developer: Reload Windowを実行してください。 - Cursor: Settings → MCP (Tools)を開き、bitriseサーバーをオフ・オンに切り替えるか、更新アイコンをクリックしてください。Cursorを再起動しても構いません。 - Claude Desktop: アプリを完全に終了し(macOSでは`Cmd+Q`、Windowsではシステムトレイから終了)、再度開いてください。ウィンドウを閉じるだけでは再読み込みされません。 -- Otherクライアント(Windsurf、Gemini CLI、AWS Kiro): クライアントを再起動するか、MCP接続が公開されている場合はそちらを再起動してください。 +- Otherクライアント(Windsurf、Antigravity CLI、AWS Kiro): クライアントを再起動するか、MCP接続が公開されている場合はそちらを再起動してください。 ## うまくいかない場合 {#if-something-goes-wrong} diff --git a/static/onboarding-for-agents.md b/static/onboarding-for-agents.md index 2b5b8f32..200f755c 100644 --- a/static/onboarding-for-agents.md +++ b/static/onboarding-for-agents.md @@ -102,7 +102,7 @@ for their client**, and ask which client they use if you don't know. The common (or click its refresh icon); restarting Cursor also works. - **Claude Desktop:** fully **quit** the app (`Cmd+Q` on macOS, or quit from the system tray on Windows) and reopen it — closing the window alone doesn't reload it. -- **Other clients (Windsurf, Gemini CLI, AWS Kiro):** restart the client, or its MCP +- **Other clients (Windsurf, Antigravity CLI, AWS Kiro):** restart the client, or its MCP connection if it exposes one. ## If something goes wrong From 8fb6ddaf8efe085e9acf06f339ce6ce5d4010d68 Mon Sep 17 00:00:00 2001 From: arpadkun Date: Thu, 22 Oct 2026 10:03:17 -0700 Subject: [PATCH 2/2] Retranslate the JA CodePush CI guide to match English The English page was restructured in 2a7170ff (Step and CLI subsections), but the JA copy kept the old layout, so ja-structure failed on any PR touching i18n/ja: 13 vs 3 code blocks, 10 vs 14 links, 3 vs 5 headings. Retranslated the whole page with scripts/ja_manual_translate.py; ja_structure.py and the JTF textlint check both pass. Co-Authored-By: Claude Opus 5.5 --- .../codepush-updates-with-bitrise-ci.mdx | 553 ++++-------------- 1 file changed, 99 insertions(+), 454 deletions(-) diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/release-management/codepush/codepush-updates-with-bitrise-ci.mdx b/i18n/ja/docusaurus-plugin-content-docs/current/release-management/codepush/codepush-updates-with-bitrise-ci.mdx index 4e40ac13..912f09d1 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/release-management/codepush/codepush-updates-with-bitrise-ci.mdx +++ b/i18n/ja/docusaurus-plugin-content-docs/current/release-management/codepush/codepush-updates-with-bitrise-ci.mdx @@ -1,482 +1,128 @@ --- -title: "Bitrise CI での CodePush アップデート" -description: "iOSとAndroidのアップデートパッケージを作成し、両方をBitriseにアップロードするBitrise CI Workflowで、CodePushアップデートをリリースします。" +title: "Bitrise CIでのCodePushアップデートのリリース" +description: "Bitrise CI Workflowから、Bitrise CodePush Publish StepまたはCodePush CLIを使って、iOSとAndroid向けのCodePushアップデートをリリースします。" sidebar_position: 5 slug: /release-management/codepush/codepush-updates-with-bitrise-ci --- -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; import GlossTerm from '@site/src/components/GlossTerm'; CodePushアップデートは、[Bitrise CI](/bitrise-ci) Workflowでリリースできます。このプロセスには次のものが必要です。 -- CodePushの認証情報の設定: アプリID、デプロイID、ターゲットバージョン、Bitrise APIトークンを保持する[Environment Variables](/bitrise-ci/configure-builds/environment-variables)と、シークレットを作成します。 -- iOSとAndroidの両方のアップデートパッケージを作成し、両方をBitriseにアップロードするWorkflowの作成。 +- CodePush認証情報の設定: アプリID、deployment name、ターゲットバージョン、Bitrise APIトークンを保持する[Environment Variables](/bitrise-ci/configure-builds/environment-variables)とシークレットを作成します。 +- Workflowの作成: iOSとAndroidの両方のアップデートパッケージを作成し、両方をBitriseにアップロードします。 ## BitriseでのCodePush認証情報の設定 {#configuring-codepush-credentials-on-bitrise} -1. [認証情報を取得します](/release-management/codepush/creating-and-releasing-codepush-updates#getting-your-codepush-credentials)。Release ManagementのアプリIDとCodePushのデプロイIDが必要です。 -1. デプロイID、接続済みアプリID、ターゲットバージョン用に[Environment Variablesを作成します](/bitrise-ci/configure-builds/environment-variables#setting-an-env-var-in-the-workflow-editor)。 +1. Release ManagementのアプリID([確認方法](/release-management/codepush/codepush-cli/using-the-codepush-cli#setting-up-a-project))と[CodePush deployments](/release-management/codepush/creating-a-codepush-deployment)の名前を取得します。 +1. 接続されたアプリID、deployment name、ターゲットバージョン用の[Environment Variablesを作成](/bitrise-ci/configure-builds/environment-variables#setting-an-env-var-in-the-workflow-editor)します。 - - `IOS_PROD_DEPLOYMENT_ID`: iOSアプリのデプロイID。 - - `ANDROID_PROD_DEPLOYMENT_ID`: AndroidアプリのデプロイID。 - `IOS_CONNECTED_APP_ID`: iOSアプリのアプリID。 - `ANDROID_CONNECTED_APP_ID`: AndroidアプリのアプリID。 - - `APP_TARGET_VERSIONS`: アップデートを受け取るアプリのバージョン。正確なバージョンまたは[範囲式](/release-management/codepush/creating-and-releasing-codepush-updates#target-versions)を使用します。例: `1.2.0`、`>=1.5.0`。 + - `CODEPUSH_DEPLOYMENT`: リリース先のデプロイの名前(例: `Staging`)。 + - `APP_TARGET_VERSIONS`: アップデートを受け取るアプリバージョン。正確なバージョンまたは[範囲式](/release-management/codepush/creating-and-releasing-codepush-updates#target-versions)を使用します(例: `1.2.0`または`>=1.5.0`)。 - Bitriseは、アップデートがアプリバージョンのネイティブコードで動作するかどうかを確認できません。どのバージョンに互換性があるかはユーザーが判断するため、リリースのたびに`APP_TARGET_VERSIONS`を自分で設定してください。 -1. APIトークン用に[シークレットを作成します](/bitrise-ci/configure-builds/secrets#setting-a-secret)。 + デプロイはアプリに属するため、iOSアプリとAndroidアプリにはそれぞれ独自のデプロイがあります。2つのデプロイには同じ名前を付けることができます(例: `Staging`)。その場合、`CODEPUSH_DEPLOYMENT`を`Staging`に設定すると、Bitriseが各アプリに対応するデプロイを見つけます。 - - `BITRISE_API_TOKEN`: パーソナルアクセストークン、またはworkspace APIトークン。 + Bitriseは、アップデートがアプリバージョンのネイティブコードで動作するかどうかを確認できません。互換性のあるバージョンはご自身で判断するため、各リリースの前に`APP_TARGET_VERSIONS`を設定してください。 +1. 個人用アクセストークンまたはworkspace APIトークンを保持する、`BITRISE_API_TOKEN`という名前の[シークレットを作成](/bitrise-ci/configure-builds/secrets#setting-a-secret)します。 ## CodePushアップデート用のWorkflowの作成 {#creating-a-workflow-for-codepush-updates} -このセクションでは、次の処理を行うCI Workflowを作成する方法を説明します。 - -- iOS用のアップデートパッケージを作成する。 -- iOSのアップデートパッケージをBitriseにアップロードする。 -- Android用のアップデートパッケージを作成する。 -- AndroidのアップデートパッケージをBitriseにアップロードする。 - - - - -1. Workflowを作成し、`git-clone` Stepの後に、`install`コマンドで`npm` Stepを追加します。 - - ```yaml - --- - format_version: '13' - default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git - project_type: react-native - workflows: - codepush_update_deploy: - description: Generates your update and pushes it to Bitrise. - steps: - - git-clone@8: {} - - npm@1: - inputs: - - command: install - ``` -1. GitHubから`release-management-recipes`リポジトリをクローンする別の`script` Stepを追加します。このリポジトリには、後で使用するアップロードスクリプトが含まれています。 - - ```yaml - - script@1: - title: Get Release Management Recipes - inputs: - - content: >- - #!/usr/bin/env bash - # fail if any commands fails - set -e - # make pipelines' return status equal the last command to exit with a - non-zero status, or zero if all commands exit successfully - set -o pipefail - # debug log - set -x - - # write your script here - git clone https://github.com/bitrise-io/release-management-recipes - ``` -1. iOSのアップデートバンドルを生成し、そこからzipアーカイブを作成します。 - - ```yaml - - script@1: - title: Generate iOS Update Bundle - inputs: - - content: >- - #!/usr/bin/env bash - # fail if any commands fails - set -e - # make pipelines' return status equal the last command to exit with a - non-zero status, or zero if all commands exit successfully - set -o pipefail - # debug log - set -x - - # remove output of earlier runs so the zip holds one platform only - rm -rf ./build update.zip - - npx react-native bundle \ - --platform ios \ - --dev false \ - --entry-file index.js \ - --bundle-output ./build/main.jsbundle \ - --assets-dest ./build - - # Create zip archive - zip -r update.zip ./build - ``` -1. `upload_code_push_package.sh`を使用して、iOSのアップデートバンドルをBitriseにアップロードします。 - - ```yaml - - script@1: - title: Upload iOS Update Bundle to Bitrise - inputs: - - content: > - #!/usr/bin/env bash - # fail if any commands fails - set -e - # make pipelines' return status equal the last command to exit with a non-zero status, or zero if all - commands exit successfully - set -o pipefail - # debug log - set -x - - cd release-management-recipes - - UPLOAD_RESPONSE=$(PACKAGE_PATH=../update.zip \ - AUTHORIZATION_TOKEN=$BITRISE_API_TOKEN \ - CONNECTED_APP_ID=$IOS_CONNECTED_APP_ID \ - DEPLOYMENT_ID=$IOS_PROD_DEPLOYMENT_ID \ - APP_VERSION=$APP_TARGET_VERSIONS /bin/bash ./api/upload_code_push_package.sh 2>&1) - EXIT_CODE=$? - - if [ $EXIT_CODE -ne 0 ]; then - \ echo \"❌ upload_code_push_package.sh failed with exit code - $EXIT_CODE\" - \ echo \"$UPLOAD_RESPONSE\" - \ exit $EXIT_CODE - fi - - # Take only the last line of the response (final/latest status JSON - object) FINAL_RESPONSE=$(echo "$UPLOAD_RESPONSE" | tail -n1) - - # Check explicitly for ERR_INTERNAL or other internal error indicators - if echo \"$UPLOAD_RESPONSE\" | grep -q \"ERR_INTERNAL\"; then - \ ERROR_MESSAGE=$(echo \"$FINAL_RESPONSE\" | jq -r '.message' || - echo \"Unknown error\") - \ echo \"❌ Server returned internal error: $ERROR_MESSAGE\" - \ exit 1 - fi - - - # Now safely parse 'status' and 'status_reason' from the final - response line PACKAGE_STATUS=$(echo "$FINAL_RESPONSE" | jq -r - '.status' || echo "null") STATUS_REASON=$(echo "$FINAL_RESPONSE" | jq - -r '.status_reason' || echo "") - - if [ "$PACKAGE_STATUS" = "processed_valid" ]; then echo "✅ Package - uploaded and processed successfully." rm -rf ../build.zip rm -rf - ../build else echo "⚠️ Package upload unexpected status: - $PACKAGE_STATUS - Reason: $STATUS_REASON" exit 1 fi cd .. - ``` -1. Androidのアップデートバンドルを生成します。 - - ```yaml - - script@1: - title: Generate Android Update Bundle - inputs: - - content: | - #!/usr/bin/env bash - # fail if any commands fails - set -e - # make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully - set -o pipefail - # debug log - set -x - - # remove output of earlier runs so the zip holds one platform only - rm -rf ./build update.zip - - npx react-native bundle \ - --platform android \ - --dev false \ - --entry-file index.js \ - --bundle-output ./build/index.android.bundle \ - --assets-dest ./build - - # Create zip archive - zip -r update.zip ./build - ``` -1. AndroidのアップデートバンドルをBitriseにアップロードします。 - - ```yaml - - script@1: - title: Upload Android Update Bundle to Bitrise - inputs: - - content: | - #!/usr/bin/env bash - # fail if any commands fails - set -e - # make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully - set -o pipefail - # debug log - set -x - - cd release-management-recipes - - UPLOAD_RESPONSE=$(PACKAGE_PATH=../update.zip \ - AUTHORIZATION_TOKEN=$BITRISE_API_TOKEN \ - CONNECTED_APP_ID=$ANDROID_CONNECTED_APP_ID \ - DEPLOYMENT_ID=$ANDROID_PROD_DEPLOYMENT_ID \ - APP_VERSION=$APP_TARGET_VERSIONS /bin/bash ./api/upload_code_push_package.sh 2>&1) - EXIT_CODE=$? - - if [ $EXIT_CODE -ne 0 ]; then - echo "❌ upload_code_push_package.sh failed with exit code $EXIT_CODE" - echo "$UPLOAD_RESPONSE" - exit $EXIT_CODE - fi - - # Take only the last line of the response (final/latest status JSON object) - FINAL_RESPONSE=$(echo "$UPLOAD_RESPONSE" | tail -n1) - - # Check explicitly for ERR_INTERNAL or other internal error indicators - if echo "$UPLOAD_RESPONSE" | grep -q "ERR_INTERNAL"; then - ERROR_MESSAGE=$(echo "$FINAL_RESPONSE" | jq -r '.message' || echo "Unknown error") - echo "❌ Server returned internal error: $ERROR_MESSAGE" - exit 1 - fi - - # Now safely parse 'status' and 'status_reason' from the final response line - PACKAGE_STATUS=$(echo "$FINAL_RESPONSE" | jq -r '.status' || echo "null") - STATUS_REASON=$(echo "$FINAL_RESPONSE" | jq -r '.status_reason' || echo "") - - if [ "$PACKAGE_STATUS" = "processed_valid" ]; then - echo "✅ Package uploaded and processed successfully." - else - echo "⚠️ Package upload unexpected status: $PACKAGE_STATUS - Reason: $STATUS_REASON" - exit 1 - fi - - cd .. - ``` - - - - -1. Workflowを作成し、`git-clone` Stepの後に、`install`コマンドで`npm` Stepを追加します。 - - ```yaml - --- - format_version: '13' - default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git - project_type: react-native - workflows: - codepush_update_deploy: - description: | - Uploads Update Bundle to Bitrise - status_report_name: Executing for - steps: - - git-clone@8: {} - - restore-npm-cache@2: {} - - npm@1: - inputs: - - command: install - ``` -1. GitHubから`release-management-recipes`リポジトリをクローンする別の`script` Stepを追加します。このリポジトリには、後で使用するアップロードスクリプトが含まれています。 - - ```yaml - - script@1: - title: Get Release Management Recipes - inputs: - - content: >- - #!/usr/bin/env bash - # fail if any commands fails - set -e - # make pipelines' return status equal the last command to exit with a - non-zero status, or zero if all commands exit successfully - set -o pipefail - # debug log - set -x - - # write your script here - git clone https://github.com/bitrise-io/release-management-recipes - ``` -1. iOSのアップデートバンドルを生成し、そこからzipアーカイブを作成します。 - - ```yaml - - script@1: - title: Generate iOS Update Bundle - inputs: - - content: |- - #!/usr/bin/env bash - # fail if any commands fails - set -e - # make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully - set -o pipefail - # debug log - set -x - - # remove output of earlier runs so the zip holds one platform only - rm -rf ./build update.zip - - npx expo export:embed \ - --entry-file index.js \ - --platform ios \ - --dev false \ - --reset-cache \ - --bundle-output ./build/main.jsbundle \ - --assets-dest ./build \ - --minify false - - # Create zip archive - zip -r update.zip ./build - ``` -1. `upload_code_push_package.sh`を使用して、iOSのアップデートバンドルをBitriseにアップロードします。 - - ```yaml - - script@1: - title: Upload iOS Update Bundle to Bitrise - inputs: - - content: > - #!/usr/bin/env bash - # fail if any commands fails - set -e - # make pipelines' return status equal the last command to exit with a non-zero status, or zero if all - commands exit successfully - set -o pipefail - # debug log - set -x - - cd release-management-recipes - - UPLOAD_RESPONSE=$(PACKAGE_PATH=../update.zip \ - AUTHORIZATION_TOKEN=$BITRISE_API_TOKEN \ - CONNECTED_APP_ID=$IOS_CONNECTED_APP_ID \ - DEPLOYMENT_ID=$IOS_PROD_DEPLOYMENT_ID \ - APP_VERSION=$APP_TARGET_VERSIONS /bin/bash ./api/upload_code_push_package.sh 2>&1) - - EXIT_CODE=$? - - if [ $EXIT_CODE -ne 0 ]; then - \ echo \"❌ upload_code_push_package.sh failed with exit code - $EXIT_CODE\" - \ echo \"$UPLOAD_RESPONSE\" - \ exit $EXIT_CODE - fi - - # Take only the last line of the response (final/latest status JSON - object) FINAL_RESPONSE=$(echo "$UPLOAD_RESPONSE" | tail -n1) - - # Check explicitly for ERR_INTERNAL or other internal error indicators - if echo \"$UPLOAD_RESPONSE\" | grep -q \"ERR_INTERNAL\"; then - \ ERROR_MESSAGE=$(echo \"$FINAL_RESPONSE\" | jq -r '.message' || - echo \"Unknown error\") - \ echo \"❌ Server returned internal error: $ERROR_MESSAGE\" - \ exit 1 - fi - - - # Now safely parse 'status' and 'status_reason' from the final - response line PACKAGE_STATUS=$(echo "$FINAL_RESPONSE" | jq -r - '.status' || echo "null") STATUS_REASON=$(echo "$FINAL_RESPONSE" | jq - -r '.status_reason' || echo "") - - if [ "$PACKAGE_STATUS" = "processed_valid" ]; then echo "✅ Package - uploaded and processed successfully." rm -rf ../build.zip rm -rf - ../build else echo "⚠️ Package upload unexpected status: - $PACKAGE_STATUS - Reason: $STATUS_REASON" exit 1 fi cd .. - ``` -1. Androidのアップデートバンドルを生成します。 - - ```yaml - - script@1: - title: Generate Android Update Bundle - inputs: - - content: | - #!/usr/bin/env bash - # fail if any commands fails - set -e - # make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully - set -o pipefail - # debug log - set -x - - # remove output of earlier runs so the zip holds one platform only - rm -rf ./build update.zip - - npx expo export:embed \ - --entry-file index.js \ - --platform android \ - --dev false \ - --reset-cache \ - --bundle-output ./build/index.android.bundle \ - --assets-dest ./build \ - --minify false - - # Create zip archive - zip -r update.zip ./build - ``` -1. AndroidのアップデートバンドルをBitriseにアップロードします。 - - ```yaml - - script@1: - title: Upload Android Update Bundle to Bitrise - inputs: - - content: | - #!/usr/bin/env bash - # fail if any commands fails - set -e - # make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully - set -o pipefail - # debug log - set -x - - cd release-management-recipes - - UPLOAD_RESPONSE=$(PACKAGE_PATH=../update.zip \ - AUTHORIZATION_TOKEN=$BITRISE_API_TOKEN \ - CONNECTED_APP_ID=$ANDROID_CONNECTED_APP_ID \ - DEPLOYMENT_ID=$ANDROID_PROD_DEPLOYMENT_ID \ - APP_VERSION=$APP_TARGET_VERSIONS /bin/bash ./api/upload_code_push_package.sh 2>&1) - EXIT_CODE=$? - - if [ $EXIT_CODE -ne 0 ]; then - echo "❌ upload_code_push_package.sh failed with exit code $EXIT_CODE" - echo "$UPLOAD_RESPONSE" - exit $EXIT_CODE - fi - - # Take only the last line of the response (final/latest status JSON object) - FINAL_RESPONSE=$(echo "$UPLOAD_RESPONSE" | tail -n1) - - # Check explicitly for ERR_INTERNAL or other internal error indicators - if echo "$UPLOAD_RESPONSE" | grep -q "ERR_INTERNAL"; then - ERROR_MESSAGE=$(echo "$FINAL_RESPONSE" | jq -r '.message' || echo "Unknown error") - echo "❌ Server returned internal error: $ERROR_MESSAGE" - exit 1 - fi - - # Now safely parse 'status' and 'status_reason' from the final response line - PACKAGE_STATUS=$(echo "$FINAL_RESPONSE" | jq -r '.status' || echo "null") - STATUS_REASON=$(echo "$FINAL_RESPONSE" | jq -r '.status_reason' || echo "") - - if [ "$PACKAGE_STATUS" = "processed_valid" ]; then - echo "✅ Package uploaded and processed successfully." - else - echo "⚠️ Package upload unexpected status: $PACKAGE_STATUS - Reason: $STATUS_REASON" - exit 1 - fi - - cd .. - ``` - - - +このセクションでは、次の処理を行うCI Workflowの作成方法を説明します。 + +- iOS用のアップデートパッケージを作成します。 +- iOSのアップデートパッケージをBitriseにアップロードします。 +- Android用のアップデートパッケージを作成します。 +- AndroidのアップデートパッケージをBitriseにアップロードします。 + +これらのアップデートパッケージの作成とアップロードには、Bitrise CodePush Publish Stepまたは[CodePush CLI](/release-management/codepush/codepush-cli/about-the-codepush-cli)のどちらかを使用できます。どちらもプロジェクトがbare React NativeとExpoのどちらを使用しているかを検出し、1回の実行で1つのプラットフォームを処理します。そのため、iOS用に1回、Android用に1回追加してください。 + +### Bitrise CodePush Publish Stepの使用 {#using-the-bitrise-codepush-publish-step} + +ほとんどのプロジェクトにはStepをお勧めします。JavaScriptの依存関係をインストールし、アプリをバンドルして、アップデートをアップロードします。`git-clone` Stepの後に、プラットフォームごとに1回ずつ追加してください。 + +```yaml +workflows: + codepush_update_deploy: + steps: + - git-clone@8: {} + - codepush-publish@1: + title: Publish iOS update + inputs: + - platform: ios + - app_id: $IOS_CONNECTED_APP_ID + - deployment: $CODEPUSH_DEPLOYMENT + - app_version: $APP_TARGET_VERSIONS + - api_token: $BITRISE_API_TOKEN + - codepush-publish@1: + title: Publish Android update + inputs: + - platform: android + - app_id: $ANDROID_CONNECTED_APP_ID + - deployment: $CODEPUSH_DEPLOYMENT + - app_version: $APP_TARGET_VERSIONS + - api_token: $BITRISE_API_TOKEN +``` + +Stepには、`rollout_percentage`、`mandatory`、`description`などのオプションの入力もあります。エントリファイルとHermesの設定は自動的に検出され、`entry_file`と`hermes`で上書きできます。前のStepですでに依存関係をインストールしている場合は、`skip_dependency_install`を`"true"`に設定してください。 + +[アップデートに署名する](/release-management/codepush/code-signing-with-codepush)には、秘密鍵をSecret Fileとしてアップロードし、`private_key_path`にその環境変数(例: `$CODEPUSH_PRIVATE_KEY`)を設定します。 + +Stepはアップデートパッケージを`$BITRISE_DEPLOY_DIR`にエクスポートするため、後続のDeploy to Bitrise.io Stepがそれをビルドのアーティファクトに追加します。 + +### CodePush CLIの使用 {#using-the-codepush-cli} + +アップデートの公開以外の操作が必要な場合(たとえば、リリースを別のデプロイに昇格させたり、ロールバックしたりする場合)は、CLIを使用します。CodePush CLIプラグインと依存関係をインストールしてから、プラットフォームごとに1回ずつ`push --bundle`を実行します。このコマンドはJavaScriptをバンドルし、アップデートをアップロードします。CLIは環境から`BITRISE_API_TOKEN`を自動的に読み取ります。 + +```yaml +workflows: + codepush_update_deploy: + steps: + - git-clone@8: {} + - script@1: + title: Install the CodePush CLI + inputs: + - content: bitrise plugin install https://github.com/bitrise-io/bitrise-plugins-codepush-cli.git + - npm@1: + inputs: + - command: install + - script@1: + title: Push iOS update + inputs: + - content: |- + bitrise :codepush push --bundle --platform ios \ + --app-id "$IOS_CONNECTED_APP_ID" \ + --deployment "$CODEPUSH_DEPLOYMENT" \ + --app-version "$APP_TARGET_VERSIONS" + - script@1: + title: Push Android update + inputs: + - content: |- + bitrise :codepush push --bundle --platform android \ + --app-id "$ANDROID_CONNECTED_APP_ID" \ + --deployment "$CODEPUSH_DEPLOYMENT" \ + --app-version "$APP_TARGET_VERSIONS" +``` + +Bitriseビルドでは、CLIがビルド番号とコミットハッシュをアップデートに付加します。また、アップデートIDを次のStepsにエクスポートします。すべてのコマンドとフラグについては、[CodePush CLIリファレンス](/release-management/codepush/codepush-cli/codepush-cli-reference)を参照してください。 ## CodePushアップデートリリースの自動化 {#automating-the-codepush-update-release} -CodePushアップデートを生成してアップロードするWorkflowを作成した後は、2つの方法で実行できます。 - -- [Workflowを手動で実行します](/bitrise-ci/run-and-analyze-builds/starting-builds/starting-builds-manually)。 -- 定義した条件が満たされたときに、[ビルドを自動的にトリガーします](/bitrise-ci/run-and-analyze-builds/build-triggers/configuring-build-triggers)。利用可能な条件については、[サポートされているトリガー条件](/bitrise-ci/run-and-analyze-builds/build-triggers/configuring-build-triggers#supported-trigger-conditions)を参照してください。 - -自動化のために、さまざまな種類のトリガーを複数設定できます。この設定例では、ラベル付きのプルリクエストトリガーを使用します。 +CodePushアップデートを生成してアップロードするWorkflowを作成したら、次の2つの方法で実行できます。 -特定のブランチへのプルリクエストにラベルが付いたときにCodePushアップデートをリリースする +- [Workflowを手動で実行する](/bitrise-ci/run-and-analyze-builds/starting-builds/starting-builds-manually)。 +- 定義した条件が満たされたときに[ビルドを自動的にトリガーする](/bitrise-ci/run-and-analyze-builds/build-triggers/configuring-build-triggers)。使用できる条件については、[サポートされているトリガー条件](/bitrise-ci/run-and-analyze-builds/build-triggers/configuring-build-triggers#supported-trigger-conditions)を参照してください。 -この例では、次のようなトリガーを設定します。 +さまざまな種類のトリガーを設定して、プロセスを自動化できます。この設定例では、ラベルを使ったプルリクエストトリガーを使用します。 -- Bitriseは、`updates`をターゲットブランチとして開かれたプルリクエストを監視します。 -- そのブランチへのプルリクエストに`release-update`ラベルが付くと、`codepush_update_deploy` Workflowが実行されます。 +プルリクエストにラベルが付いたときにCodePushアップデートをリリースする -1. [トリガーを作成します](/bitrise-ci/run-and-analyze-builds/build-triggers/configuring-build-triggers#creating-build-triggers)。`target_branch`と`label`の2つの条件を持つプルリクエストトリガーを設定します。 +この例では、いずれかのプルリクエストに`release-update`ラベルが付いたときに`codepush_update_deploy` Workflowが実行されるトリガーを設定します。マージする前のテストとして、プルリクエストを`Staging`などのデプロイにリリースする場合に使用します。 - - `target_branch`を`updates`に設定します。 - - `label`を`release-update`に設定します。 +1. [トリガーを作成します](/bitrise-ci/run-and-analyze-builds/build-triggers/configuring-build-triggers#creating-build-triggers)。`label`条件を`release-update`に設定したプルリクエストトリガーを設定します。`target_branch`条件のデフォルトは`*`のため、すべてのブランチへのプルリクエストが一致します。リリースを1つのブランチに限定するには、`target_branch`も設定してください。 :::tip[GUI設定] @@ -497,14 +143,13 @@ CodePushアップデートを生成してアップロードするWorkflowを作 [...] triggers: pull_request: - - target_branch: updates - label: release-update + - label: release-update ``` -1. CodePushアップデートをリリースするときは、`updates`ブランチへのプルリクエストを開きます。 -1. プルリクエストがレビューされて承認された後、`release-update`ラベルを付けます。 +1. CodePushアップデートをリリースするときは、プルリクエストを作成します。 +1. プルリクエストがレビューされて承認されたら、`release-update`ラベルを追加します。 :::note -ビルドは、マージ後のブランチではなく、プルリクエストのコードで実行されます。Bitriseは、プルリクエストをマージする前にアップデートをリリースします。 +Bitriseは、ラベルを追加した時点で、プルリクエストがマージされる前にビルドを実行します。アップデートはプルリクエストのコードからリリースされます。 :::