docs: add documentation about "evaluate" and remove info about drone
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Simon Vieille 2023-01-04 13:26:25 +01:00
parent a3aab36b52
commit e9edb536ab
2 changed files with 21 additions and 49 deletions

53
DOCS.md
View file

@ -17,19 +17,16 @@ You can configure the plugin using the following parameters:
* **subject** - The subject line 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.
* **evaluate** - An optional expression to evaluate (on the fly) whether the mail should be sent or not.
## Example
The following is a sample configuration in your .drone.yml file:
The following is a sample configuration in your .woodpecker.yml file:
```yaml
kind: pipeline
type: docker
name: default
steps:
- name: notify
image: drillster/drone-email
pipeline:
mail:
image: deblan/woodpecker-email
settings:
from.address: noreply@github.com
from.name: John Smith
@ -41,12 +38,13 @@ steps:
```
### Secrets
The Email plugin supports reading credentials and other parameters from the Drone secret store. This is strongly recommended instead of storing credentials in the pipeline configuration in plain text.
```diff
steps:
- name: notify:
image: drillster/drone-email
pipeline:
mail:
image: deblan/woodpecker-email
settings:
from.address: noreply@github.com
host: smtp.mailgun.org
@ -58,21 +56,6 @@ steps:
- octocat@github.com
```
Use the command line utility to add the secrets to the store:
```sh
drone secret add \
--repository octocat/hello-world \
--name email_username \
--data octocat
drone secret add \
--repository octocat/hello-world \
--name email_password \
--data 12345
```
See [Secret Guide](https://docs.drone.io/secret/) for additional information on secrets.
### Custom Templates
In some cases you may want to customize the look and feel of the email message
@ -90,9 +73,9 @@ provided as a string or as a remote URL which gets fetched and parsed:
Example configuration that generate a custom email:
```yaml
steps:
- name: notify
image: drillster/drone-email
pipeline:
mail:
image: deblan/woodpecker-email
settings:
from.address: noreply@github.com
host: smtp.mailgun.org
@ -118,9 +101,9 @@ following additional parameter:
Example configuration that skips SSL verification:
```diff
steps:
- name: notify
image: drillster/drone-email
pipeline:
mail:
image: deblan/woodpecker-email
settings:
from: noreply@github.com
host: smtp.mailgun.org
@ -137,9 +120,9 @@ by the server, traffic is going to be encrypted.
You may want to disable STARTTLS, e.g., with faulty and/or internal servers:
```diff
steps:
- name: notify
image: drillster/drone-email
pipeline:
mail:
image: deblan/woodpecker-email
settings:
from: noreply@github.com
host: smtp.mailgun.org

View file

@ -1,9 +1,6 @@
# drone-email
# woodpecker-email
[![Go Doc](https://godoc.org/github.com/Drillster/drone-email?status.svg)](http://godoc.org/github.com/Drillster/drone-email)
[![Go Report](https://goreportcard.com/badge/github.com/Drillster/drone-email)](https://goreportcard.com/report/github.com/Drillster/drone-email)
Drone plugin to send build status notifications via Email. For the usage information and a listing of the available options please take a look at [the docs](DOCS.md).
Woodpecker plugin to send build status notifications via Email. For the usage information and a listing of the available options please take a look at [the docs](DOCS.md).
## Binary
@ -18,15 +15,7 @@ go build
Build the docker image with the following commands:
```
docker build -t drillster/drone-email:latest .
```
Build the docker for ARM with buildx
```
docker buildx create --name mybuilder
docker buildx use mybuilder
docker buildx build --file Dockerfile.armhf --platform linux/arm64/v7,linux/arm64 -t drone-email:latest .
docker build -t deblan/woodpecker-email:latest .
```
This will create a Docker image called `drillster/drone-email:latest`.