Azure devops AzureDevOps是否在管道生成中复制dist文件夹?为什么?
AzureDevOps->Pipelines生成的工件中有一个dist文件夹的副本,该副本是/dist文件夹和/drop/dist文件夹。编辑:完整的azure-pipeline.yml文件Azure devops AzureDevOps是否在管道生成中复制dist文件夹?为什么?,azure-devops,continuous-integration,yaml,Azure Devops,Continuous Integration,Yaml,AzureDevOps->Pipelines生成的工件中有一个dist文件夹的副本,该副本是/dist文件夹和/drop/dist文件夹。编辑:完整的azure-pipeline.yml文件 # Node.js with Angular # Build a Node.js project that uses Angular. # Add steps that analyze code, save build artifacts, deploy, and more: # https://docs.
# Node.js with Angular
# Build a Node.js project that uses Angular.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
# Major modification referencing
# https://dev.to/thisdotmedia/continuously-integrating-angular-with-azure-devops-2k9l
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
# Build angular app area
- script: npm install
displayName: 'npm install'
- script: npx ng build --prod
displayName: 'npm build'
# Testing area
- script: npm install puppeteer --save-dev
displayName: 'Installing puppeteer (Headless browser for testing)'
- script: npx ng test --watch=false --codeCoverage=true
displayName: 'Running Tests'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/TEST-*.xml'
displayName: 'Publish Test Results'
# Publishing items
# deploy.psl (Powershell script to deploy)
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: 'deploy.ps1'
ArtifactName: 'drop'
publishLocation: 'Container'
# Firebase.json
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: Firebase.json'
inputs:
PathtoPublish: 'firebase.json'
ArtifactName: 'drop'
publishLocation: 'Container'
# App
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: 'dist'
ArtifactName: 'drop/dist'
publishLocation: 'Container'
displayName: 'Publish Artifacts'
# Code Coverage Results
- task: PublishCodeCoverageResults@1
condition: succeededOrFailed()
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: '$(Build.SourcesDirectory)/coverage/ng-azure-devops/cobertura-coverage.xml'
displayName: 'Publish Code Coverage Results'
- script: npx ng lint
displayName: 'Code Analysis'
我已经尝试使用'drop'作为工件名,这不会在任何地方产生重复的文件夹工件。我很困惑为什么'drop/dist'会产生另一个'/dist'工件
AzureDevOps是否在管道生成中复制dist文件夹?为什么?
我可以在我这方面重复这个问题
当我们将发布工件dist
文件夹与ArtifactName:drop/dist
一起使用时,Azure Devops将首先创建一个新文件夹drop
,然后将工件dist
文件夹发布到该文件夹drop
您可以从生成日志中获取以下消息:
将“/home/vsts/work/1/s/dist”上载到文件容器:
“#/3620698/drop/dist”
但是,默认情况下,drop
文件夹已经存在。当我们使用ArtifactName:drop/dist
发布dist
文件夹时,有两个drop
文件夹,Azure devops将dist
文件夹发布到这两个drop
文件夹:
为了更清楚地理解此问题,您可以禁用预览功能中的多级管道,然后您将获得以下输出:
显然,这里有两个drop
文件夹,这就是您在管道构建中获得重复dist文件夹的原因
因此,为了解决这个问题,我们可以将ArtifactName:drop/dist
更改为ArtifactName:dropTest/dist
:
现在,重复的dist文件夹消失了
希望这能有所帮助。我无法复制此问题,请您分享有关此问题的更多信息,如生成日志或复制此问题的示例?日志在这里