You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Sheelayathakula I tested this out quick, and according to the pipeline editor/validator, this doesn't work 😢
This example sees duplicate entry errors for the 2 extends: properties:
${{ if eq(variables.foo, 'adaptum') }}:
extends:
template: template/extends.ymlparameters:
usersteps:
- script: echo "This is my first step"
- script: echo "This is my second step"${{ if eq(variables.foo, 'other') }}:
extends:
template: template/extends.ymlparameters:
usersteps:
- script: echo "This is my first step"
- script: echo "This is my second step"
I see duplicate entry errors for template and parameters for this example too:
extends:
${{ if eq(variables.foo, 'adaptum') }}:
template: template/extends.ymlparameters:
usersteps:
- script: echo "This is my first step"
- script: echo "This is my second step"${{ if eq(variables.foo, 'other') }}:
template: template/extends.ymlparameters:
usersteps:
- script: echo "This is my first step"
- script: echo "This is my second step"
You would probably have to key on the parameter itself for the extends template path, something like:
extends:
template: template/${{ parameters.x }}.ymlparameters:
usersteps:
- script: echo "This is my first step"
- script: echo "This is my second step"
As a reference, I have more information on the extends template in blog post from a few years ago here: https://josh-ops.com/posts/extends-template/ (I don't discuss conditionals, though)
Hello,
I have a question regarding extending a template. I want to create a jar or containerised image based on the parameterised condition.
for example:
if ${{ parameters.x }}', 'True
extends:
template: x/create-library.yml
{{ else }}:
extends:
template: x/create-image.yml
I havent tested this yet.
The text was updated successfully, but these errors were encountered: