Plugins
Plugins are docker containers that encapsulate commands, and can be shared and re-used in your pipeline. Use plugins to build and publish artifacts, send notifications, and more.
Example Slack plugin:
1 kind: pipeline
2 type: kubernetes
3 name: default
4
5 steps:
6 - name: build
7 image: node
8 commands:
9 - npm install
10 - npm test
11
12 - name: notify
13 image: plugins/slack
14 settings:
15 webhook: https://hooks.slack.com/services/...
As you can see plugins are just Docker containers. Anyone can encapsulate logic, bundle as a Docker image, and publish to a Docker registry to share with their organization, or with the broader community.
Secrets
Drone provides the ability to source any configuration parameter from a named secret using the from_secret
syntax.
Example Slack plugin using secrets:
5 steps:
6 - name: build
7 image: node
8 commands:
9 - npm install
10 - npm test
11
12 - name: notify
13 image: plugins/slack
14 settings:
15 webhook:
16 from_secret: webhook
Example NPM plugin using secrets:
5 steps:
6 - name: build
7 image: node
8 commands:
9 - npm install
10 - npm test
11
12 - name: publish
13 image: plugins/npm
14 settings:
15 username:
16 from_secret: username
17 password:
18 from_secret: password
Registry
The community maintains a public registry of Open Source plugins. You can browse the plugin registry at plugins.drone.io.