【问题标题】:How to deploy firebase website from Gitlab CD?如何从 Gitlab CD 部署 firebase 网站?
【发布时间】:2019-10-15 09:45:48
【问题描述】:

我在 gitlab 中维护我的代码。我在firebase中托管了我的网站。我想从 gitlab 实现对 firebase 的持续部署。

这是我当前的 YML 脚本

image: node:alpine


deploy_production:
  stage: deploy
  environment: Production
  only:
    - master
  script:
    - npm install
    - npm i -g firebase-tools
    - npm build
    - firebase deploy --non-interactive --token "1//0gUT4kVkAzDa9CgYIARAAGBASNwF-L9IrGNXptJQ0YybVEjtYCttSystVDdE35i-IzSm3MwcnxDyfwT2FdQPCvdUa4o5GOVVUyrA"

我在 Gitlab 作业中收到以下错误

Error: Authorization failed. This account is missing the following required permissions on project <project-id>:

  firebase.projects.get
  firebasehosting.sites.update
ERROR: Job failed: exit code 1

【问题讨论】:

    标签: firebase gitlab devops continuous-deployment


    【解决方案1】:

    我找到了解决办法。

    复制以下代码并将其粘贴到您的 .yml 文件中:

    image: node:alpine
    
    deploy_production:
      stage: deploy
      environment: Production
      only:
        - master
      script:
        - npm install
        - npm i -g firebase-tools
        - firebase deploy --non-interactive --token "<token>" --project <project ID>
    

    如需完整教程,您可以访问link

    【讨论】:

      猜你喜欢
      • 2013-03-14
      • 2018-03-24
      • 1970-01-01
      • 2014-12-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-13
      相关资源
      最近更新 更多