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?

AzureDevOpsのパイプライン上でFirebaseEmulatorをdocker-composeを使って起動したメモ

Posted at

概要

前回はserviceを使ってパイプラインがうまく動かなかった。今回は、taskとしてdocker-composeを実行し、FirebaseEmulatorを試すことにする。

この時点のソース

追加したソースコード

packages/bdd-e2e-test/azure-pipeline.yml
      - bash: |
          sudo mkdir $(dockerComposePath)
          sudo curl -SL https://github.com/docker/compose/releases/download/v2.35.0/docker-compose-linux-x86_64 -o $(dockerComposePath)/docker-compose
          sudo chmod 755 $(dockerComposePath)/docker-compose
        displayName: Download docker-compose

      - script: |
          # Firebaseディレクトリに移動
          cd infra/local/firebase
          
          # docker-composeを直接使用してFirebaseエミュレータを起動
          $(dockerComposePath)/docker-compose -f docker-compose.ci.yml up -d firebase

        displayName: 'Wait for Firebase emulators'
        timeoutInMinutes: 3  # タスク全体のタイムアウト

実行

立ち上げるのに2分程度と少々時間はかかるが、立ち上げられることを確認。

image.png

毎回ビルドするのではなく、Imageを使う

時短のため、前回のImageを使用するようにする。

infra/local/firebase/docker-compose.yml

# https://qiita.com/ppco/items/87682b3a14ceb3702dbb
services:
  firebase:
-    build:
-     context: ./docker
-     dockerfile: Dockerfile
+    image: docker.io/hibohiboo66/ubuntu24-firebase-tools:latest
    volumes:
      - ./ci/firebase_ci.json:/opt/firebase/firebase.json
      - ./ci/.firebaserc_ci:/opt/firebase/.firebaserc
    ports:
      - 9099:9099 # Firebase Authentication
      - 9005:9005 # Firebase login
    working_dir: /opt/firebase
    command: firebase emulators:start
    tty: true

実行

40秒程度と短くなった。

image.png

参考

Docker Compose インストール

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?