LoginSignup
16
7

More than 3 years have passed since last update.

Bitrise で並列ビルド (iOS/Android)

Last updated at Posted at 2019-07-11

概要

  • React Native のビルドとデプロイに Bitrise を利用している
  • iOS のビルド時間が長いせいで、 Android が完了する前に45分超えてしまう
  • そのため、 iOS/Android でビルドするワークフローを並列実行したい
    • 使っている技術が別物だから、並列実行しても問題ないのではないか

結論

並列実行は GUI ではサポートされていないが、 Bitrise CLI を使うと、超単純に並列ビルドが可能。

  • ローカルに下記のような bitrise.yml を入れてGitリポジトリに入れる
bitrise.yml
---
format_version: '6'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: react-native
workflows:
  common:
    steps:
    - yarn@0.0.8:
        inputs:
          - command: install

  ios:
    steps:
      - certificate-and-profile-installer@1.10.1: {}
      - # 色々

  android:
    steps:
      - install-missing-android-tools@2.3.5: {}
      - # 色々

  • Bitrise にて、ワークフローエディタを開き、下記を入力
#!/bin/bash
set -ex

pids=()

bitrise run common --config bitrise.yml
bitrise run ios -c bitrise.yml &
pids+=($!)
bitrise run android -c bitrise.yml &
pids+=($!)

for pid in "${pids[@]}"; do
  wait "$pid"
done

全体としてはこんな感じ。

image.png

これで、ビルド時間が3分の2くらいになった。

16
7
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
7