Version 0.9.0
Language EN

Jsonnet

The jsonnet extension fetches the configuration file from your repository. If the configuration file has a .jsonnet file extension it is dynamically converted to yaml. This extension is useful when you want to use jsonnet as the configuration language, but you do not want to commit the generated yaml file to version control.

Prerequisites

GitHub Token

Generate a GitHub access token. This token is used to fetch the jsonnet configuration file from the repository. This token must therefore have sufficient permission to do so.

Please note this extension only supports GitHub. This is by design. If you would like to support additional source code management systems we kindly ask that you maintain a separate fork.

Shared Secret

Generate a shared secret key. This key is used to secure communication between the server and agents. The secret should be 32 bytes.

$ openssl rand -hex 16
558f3eacbfd5928157cbfe34823ab921

Installation

The extension is distributed as a Docker container. We install the plugin by pulling and running the container.

docker run \
  -p 3000:3000 \
  -e PLUGIN_SECRET=558f3eacbfd5928157cbfe34823ab921 \
  -e GITHUB_TOKEN=GITHUB8168c98304b \
  drone/drone-jsonnet

Networking

The server communicates with the extension using http. You will need to publish a container port and ensure the server can reach the extension.

docker run \
  -p 3000:3000 \
  -e PLUGIN_SECRET=558f3eacbfd5928157cbfe34823ab921 \
  -e GITHUB_TOKEN=GITHUB8168c98304b \
  drone/drone-jsonnet

Security

The server sends signed requests to the extension to prevent unauthorized access. The extension encrypts the response body using the shared secret key, using aesgcm encryption.

PLUGIN_SECRET

The server and extension authenticate http requests using a shared secret. You must provide the shared secret to both the extenion and the server.

docker run \
  -p 3000:3000 \
  -e PLUGIN_SECRET=558f3eacbfd5928157cbfe34823ab921 \
  -e GITHUB_TOKEN=GITHUB8168c98304b \
  drone/drone-jsonnet

GITHUB_TOKEN

The extensions communicates with GitHub using the API. You must provide an API token to authorize requests. If you are using GitHub Enterprise you must also provide your GitHub server address.

docker run \
  -p 3000:3000 \
  -e PLUGIN_SECRET=558f3eacbfd5928157cbfe34823ab921 \
  -e GITHUB_SERVER=https://github.company.com/api/v3/ \
  -e GITHUB_TOKEN=GITHUB8168c98304b \
  drone/drone-jsonnet

Configuration

Once the extension is installed and running, you need to modify your Drone server configuration and provide the extension endpoint and shared secret.

-e DRONE_YAML_ENDPOINT=http://...
-e DRONE_YAML_SECRET=558f3eacbfd5928157cbfe34823ab921

On This Page:

Getting Help

Enterprise Support
Real-time chat support from the developers that wrote the code.
Mailing List
Search for information in the mailing list archives, or post a question.