From 171cdab4536b4ae74d924d94e17fbe3fe4fbef58 Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Thu, 20 Apr 2023 23:39:57 +0200 Subject: [PATCH] chore: added kb about azure devops --- knowledge base/azure devops.md | 58 ++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 knowledge base/azure devops.md diff --git a/knowledge base/azure devops.md b/knowledge base/azure devops.md new file mode 100644 index 0000000..46eefd3 --- /dev/null +++ b/knowledge base/azure devops.md @@ -0,0 +1,58 @@ +# Azure Devops + +## Table of contents + +1. [Pipelines](#pipelines) + 1. [Predefined variables](#predefined-variables) + 1. [Loops](#loops) +1. [Further readings](#further-readings) +1. [Sources](#sources) + +## Pipelines + +### Predefined variables + +See [Use predefined variables] for more information. + +### Loops + +See [Expressions] for more information. + +Use the `each` keyword to loop through **parameters of the object type**: + +```yaml +parameters: + - name: listOfFruits + type: object + default: + - fruitName: 'apple' + colors: ['red','green'] + - fruitName: 'lemon' + colors: ['yellow'] + +steps: + - ${{ each fruit in parameters.listOfFruits }} : + - ${{ each fruitColor in fruit.colors}} : + - script: echo ${{ fruit.fruitName}} ${{ fruitColor }} +``` + +## Further readings + +- [Expressions] +- [Use predefined variables] + +## Sources + +All the references in the [further readings] section, plus the following: + +- [Loops in Azure DevOps Pipelines] + + +[expressions]: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/expressions +[use predefined variables]: https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables + + +[further readings]: #further-readings + + +[loops in azure devops pipelines]: https://pakstech.com/blog/azure-devops-loops/