Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Azure Devops – Can not retrieve artifact

I am publishing a artifact in a job (which completes successfully). In a separate job, I am trying to retrieve the artifact. However, nothings shows in the ls $(Build.ArtifactStagingDirectory). Why is this?

      - task: PublishPipelineArtifact@1
        displayName: 'Publish Artifact'
        inputs:
          targetpath: 'anatomy/dist'
          artifact: 'anatomy-artifact'
          publishLocation: 'pipeline'

  - job: deployBucket
    displayName: 'Deploy Bucket'
    dependsOn: buildAnatomy
    condition: eq(dependencies.buildAnatomy.result,'Succeeded')
    pool:
      vmImage: "ubuntu-20.04"

    steps:

      - task: Bash@3
        displayName: "Upload contents to bucket"
        inputs:
          targetType: "inline"
          script: |
            ls -al '$(Build.ArtifactStagingDirectory)'

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Each job runs in its own space and the agent cleans up after itself by default. If you want the contents of the artifact to be available in the 2nd job, you need to fetch it again.

Use the DownloadPipelineArtifact@1 task at the start of your 2nd job.

Or move the deploy command into the same job.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading