So I am trying to copy file and publish it via Azure yaml pipeline task PublishBuildArtifacts@1 so that I can use that file in other pipeline by downloading build artifact.
- script: |
cat ./pipelines/config/abc.config
mkdir $(Build.ArtifactStagingDirectory)/abc-config
cp -R ./pipelines/config/abc.config $(Build.ArtifactStagingDirectory)/abc-config
displayName: "Archiving runtime config file"
# Publish Config Build Artifacts
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: "$(Build.ArtifactStagingDirectory)/abc-config/"
ArtifactName: "abc-config"
publishLocation: "Container"
when I use the task DownloadBuildArtifacts@0 and download that file to a specific path, it supposed to store that file to ./pipelines/config/abc.config
but when I type ls to see if I get this file, for some reason I couldn't able to get that file.
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
project: '$(System.TeamProjectId)'
pipeline: '$(System.DefinitionId)'
downloadType: 'single'
artifactName: 'abc-config'
downloadPath: '$(System.ArtifactsDirectory)/pipelines/config'
- bash: |
# input file and remove empty lines and/or lines with crlf
ls ./pipelines/config
pipeline Logs: logs show that it's trying to download that file by adding artifact name before that file. I don't understand this behavior of adding artifact name before the file name.
Downloading abc-config/runtime.config to /home/vsts/work/1/a/pipelines/abc-config/runtime.config
Downloaded abc-config/runtime.config to /home/vsts/work/1/a/pipelines/abc-config/runtime.config
What should I need to do to store that file to pipelines/config/runtime.config?
Documentation of task: DownloadBuildArtifacts@0 doesn't mention anything about this behavior. so I am not sure what am I missing here. Any help would be highly appreciated.
Thank you.