Drone supports Jsonnet scripting as an alternate to yaml configurations. Jsonnet is a data templating language that extends Json syntax, adding constructs for generating, translating and refining data.Jsonnet Language Specification
Jsonnet is intended for projects with complex configurations that benefit from advanced scripting capabilities and code re-use.
You can use Jsonnet for an individual project by creating a
.drone.jsonnet file in the root of your git repository. Then update your repository configuration file accordingly, from your repository settings screen.
Here is an example script that returns a pipeline configuration. Please note the returned pipeline object uses the same structure as a pipeline defined in yaml.
You can automatically convert your Jsonnet configuration file to yaml using the command line tools. This can be useful for local testing.
$ drone jsonnet --stdout kind: pipeline name: default steps: - name: build image: alpine commands: [ echo hello world ]