0

I have a requirement to loop over a text file containing a list of Azure Artifacts and use the UniversalPackages task to download them.

Is this doable? Can something like this work?

jobs:
    ${{ each filename in /myfolder/*.yaml}}:
       valueFile: $filename
       - job: Deploy
         steps:
         - task: UniversalPackages@
           displayName: 'Download artifact'
Mihaimyh
  • 1,262
  • 1
  • 13
  • 35
  • On a second look that loop is iterating over files in a directory, I need to read the content of a file and loop over each line in that file. – Mihaimyh Mar 30 '21 at 18:42
  • What is the actual goal here? To change the pipeline base on a variable in the file? To get config information? Something else? – Gregory A Beamer Mar 30 '21 at 20:34
  • To create a pipeline which downloads multiple artifacts from an Azure feed, name of those artifacts being in that text file which needs to be read. – Mihaimyh Mar 30 '21 at 20:39

1 Answers1

0

As an answer, there are a couple of possibilities. You can scour the marketplace, with a focus on pipeline and seek plug ins for text files. I know there are items to change configuration from a text file and use text in a file as a variable. I am not sure there are currently plug ins that allow you to read and parse. The question of substringing a variable and parsing out items is covered here, so that is one place to look if you can do it this way (and you do not find a better plug-in in the marketplace).

From a custom standpoint, you can create your own organizational custom pipelines task extension. The link has a brief tutorial on setting up the manifest, putting the plug in into Azure DevOps, etc.

If this is to customize deployments, there are ways to handle this in the .sln files, which are MSBuild files, as well. I don't have a link for that at this point, but customizing builds is a common task. It really depends on how variable your deployments truly are.

Gregory A Beamer
  • 16,870
  • 3
  • 25
  • 32