Drone

Drone starlark does not support the runner plugins

Hola crew!

Drone starlark does not appear to allow generating .yamls for the pluggable runners (such as kubernetes or ssh). For example,

def main(ctx): 
    return {
        "kind": "pipeline",

        "type": "ssh",
        "name": "poc",
        
        # Currently, this must be ported across manually to .drone.yml. See
        # https://github.com/drone/drone-yaml/issues/49
        "server": {
            "host": "127.0.0.1",
            "user": "ubuntu",
            "ssh_key": {
                "from_secret": "ssh_key"
            }
        },
        "steps": [{
            "name": "salt-sync",
            "commands": [
                "sudo salt \* saltutil.sync_all"
            ]
        }]
    }

produces

---
kind: pipeline
type: ssh
name: poc

platform:
  os: linux
  arch: amd64

steps:
- name: salt-sync
  commands:
  - sudo salt \* saltutil.sync_all
...

(it’s missing the host bit)

the local starlark command only supports the docker pipeline type at the moment, but you can work around this by disabling formatting:

drone starlark --stdout --format=false

Oh! That works. Still, I kind of like my yaml (that output being json). Can you give some hint as to what I might look at if I was to try and implement this feature?