简体   繁体   中英

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. The npm task looks like this:

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. Currently I have a custom function called "vsts-build-dev" which just runs "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.

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?

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

For example, Command and arguments: run vsts-build-dev -- -op ..\\a\\wwwroot . (can't use build variable, using relative path instead)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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