简体   繁体   English

使用npm任务进行角度cli构建的VSTS构建定义-输出在哪里?

[英]VSTS build definition using npm task for angular cli build - where's the output?

I've created a build definition in Visual Studio Team Services with a hosted agent, and I'm trying to build an Angular 4 project via an npm task, but when I use a Copy File or Publish Artifact task, the places I look for output are always empty. 我已经在Visual Studio Team Services中使用托管代理创建了构建定义,并且尝试通过npm任务构建Angular 4项目,但是当我使用“复制文件”或“发布工件”任务时,我要寻找的位置输出始终为空。 The npm task looks like this: npm任务如下所示:

Version: 1.*
Command: custom
Working folder with package.json: $/teamproj/soln/proj
Command and arguments: run vsts-build-dev -op $(BuildArtifactStagingDirectory)\wwwroot

I've tried controlling the output and retrieving the compiled code via a number of methods...the npm step usually completes , but I'm never able to find the output. 我试图通过多种方法控制输出并检索编译后的代码... npm步骤通常完成了 ,但是我永远找不到输出。 Currently I have a custom function called "vsts-build-dev" which just runs "ng build -dev". 当前,我有一个名为“ vsts-build-dev”的自定义函数,该函数仅运行“ ng build -dev”。 I wasn't sure whether I could build directly to a subfolder of the BuildArtifactStagingDirectory...the npm task works, but a later zip of the build files is empty. 我不确定是否可以直接构建到BuildArtifactStagingDirectory的子文件夹... npm任务有效,但是构建文件的更高版本的压缩文件为空。

The logs don't always give the full picture of where the files are being generated and I've found debugging these tedious as they're always taking 6-10 minutes before failing...what's the best way to troubleshoot file paths with a hosted agent? 日志并不总能提供文件生成位置的完整信息,我发现调试这些乏味的工作是因为它们总是需要6到10分钟的时间才能失败...这是解决文件路径问题的最佳方法托管代理?

The syntax is: npm run <command> [-- <args>] 语法为: npm run <command> [-- <args>]

For example, Command and arguments: run vsts-build-dev -- -op ..\\a\\wwwroot . 例如,命令和参数: run vsts-build-dev -- -op ..\\a\\wwwroot (can't use build variable, using relative path instead) (不能使用构建变量,而是使用相对路径)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM