0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[iOS] GoogleService-Info.plistをBitrise上で取得させる方法

Posted at

はじめに

Firebaseを使ったiOSアプリのCI/CDを構築する上でGoogleService-Info.plistをBitriseのワークフローで取得させたく調べてみました。

困っていたこと

対象のiOSアプリのリポジトリはPublicとしているため、GoogleService-Info.plistはリポジトリ内に保存できません(.gitignoreしています)

この状態でBitrise上でテストやリリースのワークフローを動かすとGitHubからcloneしたリポジトリにはGoogleService-Info.plistが含まれてなく以下のようなエラーが発生します

❌ error: Build input file cannot be found: '/Users/vagrant/git/PadeLovers/GoogleService-Info.plist'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it? (in target 'PadeLovers' from project 'PadeLovers')

対応したこと

基本的なやり方は公式ドキュメント通りにやっていけばよさそうでした。

BitriseのCode Signing & FilesタブからGoogleService-info.plistを保存します

保存するとファイルのPathが確認できます

Bitrise.ymlを使っているのでGoogleService-info.plistの取得ステップをBitrise.ymlの(buildの前処理の)適当な位置に追加しました

    - file-downloader@1:
        inputs:
        - destination: $BITRISE_SOURCE_DIR/PadeLovers/GoogleService-Info.plist
        - source: $BITRISEIO_GoogleService_Info_PadeLovers_URL

これで完了です🎉

おまけ

ちなみにGUIでワークフローを追加する場合はFile Downloaderを追加

REQUIREDにファイルのパスと保存先を指定します

参考

0
0
0

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?