gpt4 book ai didi

Azure DevOps 工件目录问题

转载 作者:行者123 更新时间:2023-12-03 02:19:28 25 4
gpt4 key购买 nike

当我尝试使用 Azure DevOps 管道运行 Powershell 脚本时,收到错误“ENOENT:没有此类文件或目录,stat '/azp/agent/_work/1/a/repo1/folder1/Powershell- newscript.ps1

日志文件表明该文件位于:/azp/agent/_work/1/s/repo1/folder1/Powershell-newscript.ps1

如何将此文件从“s”移动到“a”?/azp/agent/_work/1/s 至/azp/agent/_work/1/a

   - checkout: self
- checkout: IAC

- task: CopyFiles@2
inputs:
targetFolder: '$(Build.ArtifactStagingDirectory)'

- task: PublishBuildArtifacts@1
displayName: 'Building Artifact now'
inputs:
pathToPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'drop-self'

steps:
- task: DownloadBuildArtifacts@0
inputs:
artifactName: 'drop-self'
downloadPath: '$(System.ArtifactsDirectory)'


- task: AzurePowerShell@5
inputs:
azureSubscription: ${{parameters.subName}}
ScriptType: 'FilePath'
ScriptPath: '$(System.ArtifactsDirectory)/repo1/folder1/Powershell-newscript.ps1'
azurePowerShellVersion: 'LatestVersion'

你能帮忙吗?谢谢!

最佳答案

如果您想使用特定构建中的工件,则需要引用发布管道中的文件路径,如下所示:'$(Pipeline.Workspace)/{DefinedNameofCIPipelineInReleaseFile}/{NameOfArtifacts}/{URL}*。 ps1'

resources:
pipelines:
- pipeline: CI
source: 'build-pipeline-CI'

steps:
- task: AzurePowerShell@5
inputs:
azureSubscription: ${{parameters.subName}}
ScriptType: 'FilePath'
ScriptPath: '$(Pipeline.Workspace)/CI/drop-self/folder1/Powershellnewscript.ps1'
azurePowerShellVersion: 'LatestVersion'

关于Azure DevOps 工件目录问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69602305/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com