【发布时间】:2020-07-30 14:45:35
【问题描述】:
在我可以运行任何其他任务 dist 文件夹之前,似乎在构建期间生成的文件夹已被删除。
trigger:
- master
pool: default
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
npm install -g @angular/cli
npm install
ng build --prod
displayName: 'npm install and build'
#i added this task and it seems like the node_modules and the dist
#folder that was generated during the build are not getting copied to the (a)directory
#only the source code get copied. it seems like the folders are getting
#deleted even before the #PublishPipelineArtifact@1 task ran
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Pipeline.Workspace)/s'
publishLocation: 'pipeline'
我也尝试在中输出构建
【问题讨论】:
-
你用的是什么代理?您还可以在发布管道任务之前插入它吗?这将递归地吐出文件夹的输出,因此可以确认 npm install 确实在工作:'-powershell: Get-ChildItem -Path '/home/vsts/work/1' -recurse'
-
我使用的是 Windows 10。我安装了 npm 并安装了 cli
-
我正在我的机器上运行一个自托管代理 == 操作系统是 Windows 10,当我在 azure 上使用 ubuntu 代理运行它时,一切似乎都运行良好,但是当使用 Windows 运行它时-最新我的本地代理遇到了同样的问题,没有生成 dist 文件夹
-
指定
vmImage:'ubuntu-latest'为我工作,无法让它在 Windows 代理上工作。 -
@forX 我得到通过问题的方式是使用 powershell 在 Windows 代理上进行构建。那是我的工作 - 任务:PowerShell@2 输入:targetType:'inline' 脚本:| # 在此处编写您的 PowerShell 命令。 npm install -g @angular/cli npm install ng build --prod
标签: azure-devops azure-pipelines azure-yaml-pipelines