Is there a way ot declare resources in Yaml template ?
#yaml template
parameters:
- name: p1
resources:
repositories: #repository with cd template
- repository: yaml.templates
Is there a way ot declare resources in Yaml template ?
#yaml template
parameters:
- name: p1
resources:
repositories: #repository with cd template
- repository: yaml.templates
Resources cannot currently be declared in templates. Only the “root” yaml file may declare resources. The current workaround is to lift all referenced resources from the template into the “root” yaml file.
Following beatcracker in this issue: https://github.com/Microsoft/azure-pipelines-yaml/issues/49
It should be possible to include resources from templates, if you utilize the extends keyword. I have not been able to confirm it since the extends keyword is currently only supported in Azure DevOps Services.
But he gave the example seen below.
azure-pipelines.yml
resources:
containers:
- container: node_latest
image: node:latest
extends:
template: template.yml
template.yml
resources:
containers:
- container: node_lts
image: node:lts