Issues when mixing template and pipeline

Hello.

I’m trying out the new template functionality but ran into issues when mixing a template with other pipelines. It works if I only specify the template, but not if i mix them or use multiple templates. Is this expected behavior?

.drone.yml (this will not work)

kind: template
load: plugin.jsonnet
data:
  stepName: test
  image: alpine
  commands: ls

---
kind: pipeline
type: docker
name: mypipelinename

steps:
  - name: mystepname
    image: alpine
    commands:
      - ls

Template (from docs example)

local stepName = std.extVar("input.stepName");
local image = std.extVar("input.image");
local commands = std.extVar("input.commands");
{
  "kind": "pipeline",
  "type": "docker",
  "name": "default",
  "steps": [
    {
      "name": stepName,
      "image": image,
      "commands": [
        commands
      ]
    }
  ]
}

You cannot mix templates and pipelines in the same yaml. A single template, however, can return multiple pipelines. We will update the documentation accordingly.

Ok. I see. Thanks for the reply.

@bradrydzewski

Has the documentation for templates been updated yet ? I was trying to use multiple ‘kind: template’ in a drone.yml file, but it doesn’t seems to work. Only the first template seems to trigger.
e.g.

---
kind: template
load: template1.jsonnet
data:
  some-data: 'my-value'
---
kind: template
load: template2.jsonnet
data:
  some-data: 'my-other-value'

Your last comment suggests that we need to do this inside the template file rather than the drone file.

@david-knott Unfortunately, Drone also doesn’t support the multiple templates in a single YAML file. Drone template not triggering build