0
0

【Azure/Firebase】Azure PipelinesでCLIツールのインストールに失敗するのを解決する方法

Last updated at Posted at 2024-09-12

はじめに

Azure PipelineでアプリをFirebase App Distributeに配布しています。
このパイプラインで本日(2024/09/12)突然エラーが発生したため、解決方法を記録しておきます。

環境

  • Firebase CLI 13.17.0
  • Azure Pipeline
    • ubuntu-latest (Ubuntu 22.04)
    • macos-13

起きたこと

以下の公式サイトにある、「Standalone Binary」の手順でインストールしていました。

具体的には以下のコマンドを使用しインストールする方法を使用していました。

$ curl -sL https://firebase.tools | bash

ですのでパイプラインの定義は以下のようになります。(前後省略)

  - script: curl -sL https://firebase.tools | bash
    displayName: Install Firebase CLI

すると以下のようなエラーが発生していました。

-- Setting permissions on binary...
/usr/local/bin/firebase: line 1: Not: command not found
Something went wrong, firebase has not been installed.
Please file a bug with your system information on Github.
https://github.com/firebase/firebase-tools/
-- All done!

原因

最近アップデートされていたようで、関連のLinuxバイナリの最新が欠落していることが原因のようです。
古いものですが内容は以下のIssueと同じようです。

アップデート直後でしたので、もう少し様子見たら解決した可能性もあります。

firebase-cli-version-v13.17.0-image

対応方法

私は公式にも記載にある、npmを使用した方法に変更しました。
以下のサイトを見ても最新になっていたので問題無さそうです。

以下のように変更し、問題なくインストールできました。

  - script: npm install -g firebase-tools
    displayName: Install Firebase CLI

さいごに

https://firebase.toolsのスクリプトの内容を見ると、コメントで以下のような記載がありました。

#
# If you do not want to use this script, you can manually
# download the latest "firebase" binary.
#
:   curl -Lo ./firebase_bin https://firebase.tools/bin/linux/latest
#
# Alternatively, you can download a specific version.
#
:   curl -Lo ./firebase_bin https://firebase.tools/bin/linux/v7.2.2
#

今回エラーが発生している際には、https://firebase.tools/bin/linux/latestのものが404エラーとなっていたので最新のものがまだアップロードされていないようでした。

一つ前のバージョンを指定したものhttps://firebase.tools/bin/linux/v13.16.0では期待通り取得できましたので固定バージョンを使用して解決する方法もありそうです。

ただし、Firebaseのサービス側は常に最新ですしCLIツールも常に最新を使用したほうが良いと考え、バージョンの固定化の方法を採用しませんでした。

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