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

Using published pipeline artifact in azure devops using YAML

I have a simple helloworld c++ program, and I am writing a pipeline to get familiar with the azure environment.
However, I have created multiple stages, with individual jobs inside the stages.
I have a build stage where I compile my source code to produce an object file.

I can execute the file in the same job without any issues, however I want to create a separate stage for execution. Since I need to share the files now between stages, I use pipeline artifact. However, I am not able to download the artifact. It produces an error – "Unexpected value ”" at line 37.

trigger:
- main

pool:
  vmImage: ubuntu-latest


stages:
  - stage: Analysis
    jobs:
      - job: AnalyisJob
        steps:
          - script: echo Analysing the cpp file
  
  - stage: Build
    jobs:
      - job: BuildJob
        steps:
          - script: |
              echo compiling the cpp file
              g++ helloworld.cpp -o helloworld
              echo finished compiling
              echo "publishing the object file"
          - publish: 
            target: '$(Pipeline.Workspace)'
            artifact: 'MyArtifact'

  - stage: Test
    jobs:
      - job: Test
        steps:
          - download:                  #ERROR LINE 37
            artifact: 'MyArtifact'
          - script: |
              echo running the cpp file
              ./helloworld

Any suggestions to overcome this?

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

>Solution :

You need to add current:

- download: current

See the docs here.

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