for example, I have something like this:
- job: Build
dependsOn: CheckTest
pool: ${{ parameters.setPool }}
services:
redis: redis
rabbitmq: rabbitmq
steps:
- checkout: self
My question is – is it possible to manage services
list? For example, for some cases I need only redis
container, for another only rabbitmq
and sometimes I don’t need any containers at all. Is it possible to implement dynamic services list?
2
Answers
I would consider choosing with a conditional approach. For example
And then you could use
This can be done using object parameters.
Pipeline:
Run pipeline with 4 services:
Result:
Run pipeline with "No" services
Result:
PS: I do not have any container pools to test, but the conditions and loop should work exactly the same