Atlassian Pipelines和Angular CLI

时间:2016-07-05 15:49:11

标签: angular-cli bitbucket-pipelines

尝试使用Angular CLI设置管道并在调用#ifdef __has_feature(modules) @import Foundation; #else #import <Foundation/Foundation.h> #endif 时遇到问题。

ng build

angular-cli是我的package.json中的dev依赖项,但无法找到ng。

pipelines:
   default:
     - step:
        script: # Modify the commands below to build your repository.
          - npm --version
          - npm install
          - ng build

我错过了什么步骤? 感谢您

5 个答案:

答案 0 :(得分:3)

看起来必须从npm context调用它。我最终调用了npm build并在package.json

中添加了脚本
"build": "ng build"

答案 1 :(得分:2)

如上所述包含npm build之后,事情似乎成功运行但实际上并没有做任何事情。为了工作,我不得不用$(npm bin)/ng build替换它。

答案 2 :(得分:0)

你必须在npm语境中调用就像上面提到的那样。在你的package.json中写一个脚本:

"scripts": {
        "build": "ng build"
}

然后你可以

pipelines:
  default:
    - step:
        script: # Modify the commands below to build your repository.
          - npm --version
          - npm install
          - npm build

将运行ng build

答案 3 :(得分:0)

对我有用。

int num = getIntent().getIntExtra("num",0);
LinearLayout linearLayout = findViewById(R.id.myLinearLayout);

for (int i = 0; i < num; i++) {
    final TextView rowTextView = new TextView(this);
    rowTextView.setText("Value " + i);
    myLinearLayout.addView(rowTextView);
}

答案 4 :(得分:-1)

您的泊坞窗图片中未安装Angular CLI。

使用此配置:

image: trion/ng-cli # Any docker image from dokerhub with angular cli installed.

pipelines:
  default:
    - step:
        caches:
          - node
        script: # Modify the commands below to build your repository.
          - npm install
          - npm run build