I have a UI pipeline variable (called 'HTML_Files') that passes in a string of filenames i.e. login.html password.html
In my pipeline i want to loop over and repeat a task based on the number of filenames passed in (in this case 2)
My yaml looks something like this:
steps:
- powershell: |
$f = "$(HTML_Files)".Split(" ");
echo $f;
echo '##vso[task.setvariable variable=htmlFiles; isOutput=true]$f'
displayName: 'Create array of html files to loop over'
- bash: |
echo "variable value: $(htmlFiles)"
- ${{ each file in variables.htmlFiles }}:
- task: CmdLine@2
displayName: run language injection tool
inputs:
script: .\DrupalLanguageInjector.exe $(file) $(Language)
workingDirectory: $(System.DefaultWorkingDirectory)/terraform/language-injection
This does not work and the bash task above is outputting:
Generating script.
Script contents:
echo "variable value: $f"
"C:\Program Files\Git\bin\bash.exe" -c pwd
/d/a/_temp
========================== Starting Command Output ===========================
"C:\Program Files\Git\bin\bash.exe" /d/a/_temp/6326a530-a71b-4961-b314-cff1e694b97b.sh
variable value:
Finishing: Bash
and the each loop does not get entered at all. Could anyone help with this?
Thanks