Update docs for Drone 0.6 and up
This commit is contained in:
parent
4242a88488
commit
0dbfcce537
64
DOCS.md
64
DOCS.md
|
@ -15,6 +15,15 @@ You can configure the plugin using the following parameters:
|
||||||
* **body** - The email body template
|
* **body** - The email body template
|
||||||
* **attachment** - An optional file to attach to the sent mail(s), can be an absolute path or relative to the working directory.
|
* **attachment** - An optional file to attach to the sent mail(s), can be an absolute path or relative to the working directory.
|
||||||
|
|
||||||
|
## Secrets
|
||||||
|
You can use the following secrets to secure the sensitive configuration of this plugin:
|
||||||
|
|
||||||
|
* **email_host** - corresponds to **host**
|
||||||
|
* **email_port** - corresponds to **port**
|
||||||
|
* **email_username** - corresponds to **username**
|
||||||
|
* **email_password** - corresponds to **password**
|
||||||
|
* **email_recipients**- corresponds to **recipients**
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
The following is a sample configuration in your .drone.yml file:
|
The following is a sample configuration in your .drone.yml file:
|
||||||
|
@ -44,31 +53,25 @@ pipeline:
|
||||||
- password: 12345
|
- password: 12345
|
||||||
recipients:
|
recipients:
|
||||||
- octocat@github.com
|
- octocat@github.com
|
||||||
|
+ secrets: [ email_username, email_password ]
|
||||||
```
|
```
|
||||||
|
|
||||||
Use the command line utility to add the secrets to the store:
|
Use the command line utility to add the secrets to the store:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
drone secret add --image=drillster/drone-email \
|
drone secret add \
|
||||||
octocat/hello-world EMAIL_USERNAME octocat
|
--repository octocat/hello-world \
|
||||||
drone secret add --image=drillster/drone-email \
|
--name email_username \
|
||||||
octocat/hello-world EMAIL_PASSWORD 12345
|
--value octocat \
|
||||||
|
--image drillster/drone-email
|
||||||
|
drone secret add \
|
||||||
|
--repository octocat/hello-world \
|
||||||
|
--name email_password \
|
||||||
|
--value 12345 \
|
||||||
|
--image drillster/drone-email
|
||||||
```
|
```
|
||||||
|
|
||||||
Then sign the YAML file after all secrets are added:
|
See [Secret Guide](http://docs.drone.io/manage-secrets/) for additional information on secrets.
|
||||||
|
|
||||||
```sh
|
|
||||||
drone sign octocat/hello-world
|
|
||||||
```
|
|
||||||
|
|
||||||
The following secret values can be set to configure the plugin:
|
|
||||||
* **EMAIL_HOST** - corresponds to **host**
|
|
||||||
* **EMAIL_PORT** - corresponds to **port**
|
|
||||||
* **EMAIL_USERNAME** - corresponds to **username**
|
|
||||||
* **EMAIL_PASSWORD** - corresponds to **password**
|
|
||||||
* **EMAIL_RECIPIENTS** - corresponds to **recipients**
|
|
||||||
|
|
||||||
See [Secret Guide](http://readme.drone.io/usage/secret-guide/) for additional information on secrets.
|
|
||||||
|
|
||||||
### Custom Templates
|
### Custom Templates
|
||||||
|
|
||||||
|
@ -123,3 +126,28 @@ pipeline:
|
||||||
password: 12345
|
password: 12345
|
||||||
skip_verify: true
|
skip_verify: true
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Secrets in Drone 0.5
|
||||||
|
Secret injection has changed for Drone 0.6 and up. To use this plugin with Drone 0.5, use:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
drone secret add octocat/hello-world EMAIL_PASSWORD 12345
|
||||||
|
```
|
||||||
|
|
||||||
|
to add the secret. Then add the secret to your `.drone.yml`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
pipeline:
|
||||||
|
notify:
|
||||||
|
image: drillster/drone-email
|
||||||
|
from: noreply@github.com
|
||||||
|
host: smtp.mailgun.org
|
||||||
|
username: octocat
|
||||||
|
password: ${EMAIL_PASSWORD}
|
||||||
|
```
|
||||||
|
|
||||||
|
and then sign your configuration using:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
drone sign octocat/hello-world
|
||||||
|
```
|
Loading…
Reference in a new issue