在firebase主机中使用bitbucket管道部署Angular应用的问题。

问题描述 投票:0回答:1

我在firebase主机上使用bitbucket pipelines部署angular app ver.8,但在运行pipelines时出现了一些错误,我对一些文件做了一些修改,检查如下。e2e: protractor.conf.js

exports.config = {
...,
  capabilities: {
    'browserName': 'chrome',
    chromeOptions: {
      args: ['--headless', '--no-sandbox']
    }
  }
...}

包.json

  "scripts": {
...,
    "build:prod": "ng build --prod",
    "deploy": "firebase deploy --token $FIREBASE_TOKEN --non-interactive"
}

bibucket-pipelines.yml

module.exports = function (config) {
  config.set({
...,
    customLaunchers: {
      ChromeHeadlessCI: {
        base: 'ChromeHeadless',
        flags: ['--no-sandbox']
      }
    }
})
}

bibucket-pipelines.yml.

image: node:10.16.3
pipelines:
   branches:
      master: #master branch
      - step:
         deployment: production
         caches:
         - node
         script:
         - npm install
         - npm install -g @angular/cli
         - npm install -g firebase-tools 
         - ng build --prod
         - ls -laR ./dist #recursively list directories
         - firebase deploy --token=$FIREBASE_TOKEN --project your-prod-firebase-projectname --non-interactive
      develop: # develop branch 
      - step: 
         deployment: test
         caches:
         - node
         script:
         - npm install
         - npm install -g @angular/cli
         - npm install -g firebase-tools 
         - ng build
         - ls -laR ./dist #recursively list directories
         - firebase deploy --token=$FIREBASE_TOKEN --project your-test-firebase-projectname --non-interactive

我已经在bitbucket pipelines变量中添加了firebase token,但是出现了错误。

    1. If 'app-header' is an Angular component, then verify that it is part of this module.
    2. If 'app-header' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("[ERROR ->]<app-header></app-header>
    <div class="container-fluid">
      <section>
...
javascript angular bitbucket bitbucket-pipelines
1个回答
0
投票

你是否尝试过运行"ng serve --prod"在你的本地? 你可能会得到更多关于这个错误的信息,因为它看起来不像是Bitbucket错误,而更像是Angular错误。你也可以把你的Firebase凭证放在Bitbucket中,我做了一篇文章。用Angular和Firebase构建一个Bitbucket CICD。

© www.soinside.com 2019 - 2024. All rights reserved.