How to publish and download artifacts from multiple jobs into one location on pipeline?

Gyorgy Matyasfalvi 21 Reputation points
2021-03-21T20:20:29.997+00:00

I would like to download files that are produced by multiple jobs into one folder.
Here is a schema of what I'd like to accomplish:

jobs:                                                                           
 - job: job1                                                         
    pool: {vmImage: 'Ubuntu-16.04'}                                             
    steps:                                                                      
      - bash: |                                                                 
          printf "Hello form job1\n" > $(Pipeline.Workspace)/file.1 
      - task: PublishPipelineArtifact@1                                         
        inputs:                                                                 
            targetPath: $(Pipeline.Workspace)/file.1

 - job: job2                                                         
    pool: {vmImage: 'Ubuntu-16.04'}                                             
    steps:                                                                      
      - bash: |                                                                 
          printf "Hello form job2\n" > $(Pipeline.Workspace)/file.2 
      - task: PublishPipelineArtifact@1                                         
        inputs:                                                                 
            targetPath: $(Pipeline.Workspace)/file.2

 - job: check_prev_jobs
   dependsOn: "all other jobs"
    pool: {vmImage: 'Ubuntu-16.04'}                                             
    steps:                                                                      
      - bash: |                                                                 
          mkdir -p  $(Pipeline.Workspace)/previous_artifacts
      - task: DownloadPipelineArtifact@2                                         
        inputs:
            source: current
            path: $(Pipeline.Workspace)/previous_artifacts

Where the directory $(Pipeline.Workspace)/previous_artifacts only contains file.1 and file.2 and does not have directories job1 and job2 that contain /file.1 and /file.2 respectively.

Thanks!

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,798 questions
0 comments No comments
{count} votes

Accepted answer
  1. BhargaviAnnadevara-MSFT 5,446 Reputation points
    2021-03-22T04:22:05.247+00:00

    Hello @Gyorgy Matyasfalvi , Thanks for reaching out. Azure DevOps and its services is not supported on the Microsoft Q&A platform. Please post your question in the following forum where the Azure DevOps team and DevOps community are actively answering questions: https://developercommunity.visualstudio.com/spaces/21/index.html

    0 comments No comments

0 additional answers

Sort by: Most helpful