首页 文章

Bitbucket Pipeline Firebase托管

提问于
浏览
1

我正在尝试将Bitbucket管道与firebase托管集成,以实现持续交付 . 在部署公用文件夹之前,一切似乎都能正常工作 .

这是我的'bitbucket-pipelines.yml':

image: gabrielaraujof/angular-cli

pipelines:
  default:
    - step:
        caches:
          - node
        script: # Modify the commands below to build your repository.
          - npm install
          - npm build
          - firebase deploy --token=$FIREBASE_TOKEN --project MT_PROJECT --only hosting --public dist

npm build运行“ng build”的地方 . 当我在我的本地机器上运行“firebase deploy ..”命令时,它工作正常,因为dist目录就在那里 . 但当它由Bitbucket Pipeline运行时会抛出此错误:

=== Deploying to MY_PROJECT...
i  deploying hosting
Error: Specified public directory does not exist, can't deploy hosting

似乎bitbucket管道不会生成firebase部署试图找到的dist文件夹(dist) .

1 回答

  • 2

    对于任何寻找答案的人来说,这对我有用:

    image: node:7.4.0
    
    pipelines:
      default:
        - step:
            caches:
              - node
            script:
                - npm install -g @angular/cli
                - npm install -g firebase-tools
                - npm install
                - ng build
                - firebase deploy --only hosting --token "$FIREBASE_TOKEN" --public dist
    

相关问题