Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
date title author toc weight related aliases
2000-01-01 00:00:00 +0000
Overview
bradrydzewski
true
1
items
name path
Example Go Plugin
tutorials/golang.md
name path
Example Bash Plugin
tutorials/bash.md
/plugin-overview/
/plugin-guidelines/

Plugins are Docker containers that perform pre-defined tasks and are configured as steps in your pipeline. Plugins can be used to deploy code, publish artifacts, send notification, and more.

Example pipeline using the Docker and Slack plugins:

kind: pipeline
type: docker
name: default

steps:
- name: build
  image: golang
  commands:
  - go get
  - go test
  - go build

- name: publish
  image: plugins/docker
  settings:
    username: kevinbacon
    password: pa55word
    repo: foo/bar
    tags:
    - 1.0.0
    - 1.0

- name: notify
  image: plugins/slack
  settings:
    channel: developers
    username: drone

Plugins are just Docker containers which means you can write plugins in any programming language that runs inside a container. You can even create plugins using simple bash scripting.

Source Code

Plugins automatically have access to the relevant source code and commit for a build, mounted as a volume into the plugin container. The plugin is also started with the current working directory set to the root of the git repository. The plugin does not need to clone or checkout code; this is handled by Drone.

Plugin Inputs

Plugins parameters are defined in the settings section of the pipeline step and are passed to the plugin container as environment variables. The environment variables are prefixed to prevent naming conflicts.

  • Example plugin configuration.

    - name: publish
      image: plugins/docker
      settings:
        username: kevinbacon
        password: pa55word
        repo: foo/bar
        tags:
        - 1.0.0
        - 1.0
    
  • Example plugin variables passed to the container.

    PLUGIN_USERNAME=kevinbacon
    PLUGIN_PASSWORD=pa55word
    PLUGIN_REPO=foo/bar
    PLUGIN_TAGS=1.0.0,1.0
    

Plugin parameters can be any primitive type or array of primitive types. Arrays are converted to comma-separate strings.

Plugin Distribution

Plugins are distributed as Docker images. You can publish plugins to any Docker registry, private or public, to share plugins internally with your organization, or publicly with the broader developer community.

Plugin Registry

The Drone plugin registry is a listing of Open Source plugins created by the Drone community. Want to add your plugin to the registry? Send us a pull request that adds your plugin to the registry website.

{{< link-to "http://plugins.drone.io" >}} Browse the Plugin Registry {{< / link-to >}}