woodpecker-email/DOCS.md

113 lines
7.2 KiB
Markdown
Raw Permalink Normal View History

---
name: Woodpecker Email
author: Simon Vieille
icon: https://gitnet.fr/deblan/woodpecker-email/raw/branch/develop/logo.svg
description: plugin to send build status notifications via Email.
2023-01-15 12:24:42 +01:00
tags: [notifications, email]
containerImage: deblan/woodpecker-email
containerImageUrl: https://hub.docker.com/r/deblan/woodpecker-email
url: https://gitnet.fr/deblan/woodpecker-email
---
## Settings
2015-11-11 02:44:23 +01:00
| Settings Name | Required | Type | Description | Documentation |
2024-02-21 19:08:10 +01:00
| --------------- | -------- | ------------------ | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| dsn | yes | `string` | Mail transport configuration | [Documentation](https://symfony.com/doc/current/mailer.html#tls-peer-verification) |
| from.address | yes | `string` | Email address of the sender | |
2024-01-15 14:38:09 +01:00
| from.name | no | `string` | Name of the sender | |
| recipients | no | `string` or `list` | List of recipients to send this mail to (besides the commit author) | YAML list or comma separated list |
| recipients_only | no | `boolean` | Exclude the committer | |
| content.subject | no | `string` | Define the email subject template | |
| content.body | no | `string` | Define the email body template | |
| attachments | no | `string` or `list` | List of files to attach | YAML list or comma separated list |
2024-02-19 14:24:42 +01:00
| debug | no | `boolean` | Debug mode (email are sent!) | |
### Example
2015-11-11 02:44:23 +01:00
```
steps:
mail:
2024-03-12 23:00:41 +01:00
image: deblan/woodpecker-email
settings:
dsn: "smtp://username:password@mail.example.com:587?verify_peer=1"
from:
address: "woodpecker@example.com"
name: "Woodpecker"
evaluate: "build.status == 'failure' or prev_pipeline.status == 'failure'"
recipients:
- dev1@example.com
- dev2@example.com
recipients_only: false
content:
subject: "[{{ pipeline.status }}] {{ repo.full_name }} ({{ commit.branch }} - {{ commit.sha[0:8] }}"
body: |
{{ commit.sha }}<br>
{{ pipeline.status }}<br>
{{ commit.author_email }}<br>
attachments:
- log/*
```
### Evaluation and content
See the [Twig documentation](https://twig.symfony.com/doc/3.x/).
| Variable | Value |
2024-02-21 19:08:10 +01:00
| ----------------------------- | -------------------------------- |
| `workspace` | `CI_WORKSPACE` |
| `repo.full_name` | `CI_REPO` |
| `repo.owner` | `CI_REPO_OWNER` |
| `repo.name` | `CI_REPO_NAME` |
| `repo.url` | `CI_REPO_URL` |
| `commit.sha` | `CI_COMMIT_SHA` |
| `commit.ref` | `CI_COMMIT_REF` |
| `commit.branch` | `CI_COMMIT_BRANCH` |
| `commit.source_branch` | `CI_COMMIT_SOURCE_BRANCH` |
| `commit.target_branch` | `CI_COMMIT_TARGET_BRANCH` |
| `commit.tag` | `CI_COMMIT_TAG` |
| `commit.pull_request` | `CI_COMMIT_PULL_REQUEST` |
| `commit.pull_request_labels` | `CI_COMMIT_PULL_REQUEST_LABELS` |
| `commit.message` | `CI_COMMIT_MESSAGE` |
| `commit.author` | `CI_COMMIT_AUTHOR` |
| `commit.author_email` | `CI_COMMIT_AUTHOR_EMAIL` |
| `commit.author_avatar` | `CI_COMMIT_AUTHOR_AVATAR` |
| `commit.prerelease` | `CI_COMMIT_PRERELEASE` |
| `prev_commit.sha` | `CI_PREV_COMMIT_SHA` |
| `prev_commit.ref` | `CI_PREV_COMMIT_REF` |
| `prev_commit.branch` | `CI_PREV_COMMIT_BRANCH` |
| `prev_commit.source_branch` | `CI_PREV_COMMIT_SOURCE_BRANCH` |
| `prev_commit.target_branch` | `CI_PREV_COMMIT_TARGET_BRANCH` |
| `prev_commit.message` | `CI_PREV_COMMIT_MESSAGE` |
| `prev_commit.author` | `CI_PREV_COMMIT_AUTHOR` |
| `prev_commit.author_email` | `CI_PREV_COMMIT_AUTHOR_EMAIL` |
| `prev_commit.author_avatar` | `CI_PREV_COMMIT_AUTHOR_AVATAR` |
| `prev_commit.url` | `CI_PREV_COMMIT_URL` |
| `pipeline.number` | `CI_PIPELINE_NUMBER` |
| `pipeline.parent` | `CI_PIPELINE_PARENT` |
| `pipeline.event` | `CI_PIPELINE_EVENT` |
| `pipeline.url` | `CI_PIPELINE_URL` |
| `pipeline.deploy_target` | `CI_PIPELINE_DEPLOY_TARGET` |
| `pipeline.status` | `CI_PIPELINE_STATUS` |
| `pipeline.created_at` | `CI_PIPELINE_CREATED` |
| `pipeline.stared_at` | `CI_PIPELINE_STARTED` |
| `pipeline.finished_at` | `CI_PIPELINE_FINISHED` |
| `prev_pipeline.number` | `CI_PREV_PIPELINE_NUMBER` |
| `prev_pipeline.parent` | `CI_PREV_PIPELINE_PARENT` |
| `prev_pipeline.event` | `CI_PREV_PIPELINE_EVENT` |
| `prev_pipeline.url` | `CI_PREV_PIPELINE_URL` |
| `prev_pipeline.deploy_target` | `CI_PREV_PIPELINE_DEPLOY_TARGET` |
| `prev_pipeline.status` | `CI_PREV_PIPELINE_STATUS` |
| `prev_pipeline.created_at` | `CI_PREV_PIPELINE_CREATED` |
| `prev_pipeline.stared_at` | `CI_PREV_PIPELINE_STARTED` |
| `prev_pipeline.finished_at` | `CI_PREV_PIPELINE_FINISHED` |
| `workflow.name` | `WORKFLOW_NAME` |
| `step.name` | `CI_STEP_NAME` |
| `step.number` | `CI_STEP_NUMBER` |
| `step.status` | `CI_STEP_STATUS` |
| `step.start_at` | `CI_STEP_STARTED` |
| `step.finished_at` | `CI_STEP_FINISHED` |
| `step.url` | `CI_STEP_URL` |
[dsn_doc]: https://symfony.com/doc/current/mailer.html#tls-peer-verification