mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-08-30 07:37:54 +00:00
Remove Slack plugin from examples (#4914)
This commit is contained in:
parent
41a97efb00
commit
c84aa95bfb
@ -83,20 +83,20 @@ the same workspace it can use the previously built binary and test it.
|
|||||||
|
|
||||||
Sometimes you have some tasks that you need to do in every project. For example, deploying to Kubernetes or sending a Slack message. Therefore you can use one of the [official and community plugins](/plugins) or simply [create your own](./51-plugins/20-creating-plugins.md).
|
Sometimes you have some tasks that you need to do in every project. For example, deploying to Kubernetes or sending a Slack message. Therefore you can use one of the [official and community plugins](/plugins) or simply [create your own](./51-plugins/20-creating-plugins.md).
|
||||||
|
|
||||||
If you want to get a Slack notification after your pipeline has finished, you can add a Slack plugin to your pipeline:
|
If you want to publish a file to an S3 bucket, you can add an S3 plugin to your pipeline:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
# ...
|
# ...
|
||||||
- name: notify me on Slack
|
- name: upload
|
||||||
image: plugins/slack
|
image: woodpeckerci/plugin-s3
|
||||||
settings:
|
settings:
|
||||||
channel: developers
|
bucket: my-bucket-name
|
||||||
username: woodpecker
|
access_key: a50d28f4dd477bc184fbd10b376de753
|
||||||
password:
|
secret_key:
|
||||||
from_secret: slack_token
|
from_secret: aws_secret_key
|
||||||
when:
|
source: public/**/*
|
||||||
status: [success, failure] # This will execute the step on success and failure
|
target: /target/location
|
||||||
```
|
```
|
||||||
|
|
||||||
To configure a plugin you can use the `settings` section.
|
To configure a plugin you can use the `settings` section.
|
||||||
|
@ -200,10 +200,8 @@ A condition can be a check like:
|
|||||||
|
|
||||||
```diff
|
```diff
|
||||||
steps:
|
steps:
|
||||||
- name: slack
|
- name: prettier
|
||||||
image: plugins/slack
|
image: woodpeckerci/plugin-prettier
|
||||||
settings:
|
|
||||||
channel: dev
|
|
||||||
+ when:
|
+ when:
|
||||||
+ - event: pull_request
|
+ - event: pull_request
|
||||||
+ repo: test/test
|
+ repo: test/test
|
||||||
@ -211,7 +209,7 @@ A condition can be a check like:
|
|||||||
+ branch: main
|
+ branch: main
|
||||||
```
|
```
|
||||||
|
|
||||||
The `slack` step is executed if one of these conditions is met:
|
The `prettier` step is executed if one of these conditions is met:
|
||||||
|
|
||||||
1. The pipeline is executed from a pull request in the repo `test/test`
|
1. The pipeline is executed from a pull request in the repo `test/test`
|
||||||
2. The pipeline is executed from a push to `main`
|
2. The pipeline is executed from a push to `main`
|
||||||
@ -222,10 +220,8 @@ Example conditional execution by repository:
|
|||||||
|
|
||||||
```diff
|
```diff
|
||||||
steps:
|
steps:
|
||||||
- name: slack
|
- name: prettier
|
||||||
image: plugins/slack
|
image: woodpeckerci/plugin-prettier
|
||||||
settings:
|
|
||||||
channel: dev
|
|
||||||
+ when:
|
+ when:
|
||||||
+ - repo: test/test
|
+ - repo: test/test
|
||||||
```
|
```
|
||||||
@ -240,10 +236,8 @@ Example conditional execution by branch:
|
|||||||
|
|
||||||
```diff
|
```diff
|
||||||
steps:
|
steps:
|
||||||
- name: slack
|
- name: prettier
|
||||||
image: plugins/slack
|
image: woodpeckerci/plugin-prettier
|
||||||
settings:
|
|
||||||
channel: dev
|
|
||||||
+ when:
|
+ when:
|
||||||
+ - branch: main
|
+ - branch: main
|
||||||
```
|
```
|
||||||
@ -342,14 +336,12 @@ when:
|
|||||||
|
|
||||||
#### `status`
|
#### `status`
|
||||||
|
|
||||||
There are use cases for executing steps on failure, such as sending notifications for failed workflow / pipeline. Use the status constraint to execute steps even when the workflow fails:
|
There are use cases for executing steps on failure, such as sending notifications for failed workflow/pipeline. Use the status constraint to execute steps even when the workflow fails:
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
steps:
|
steps:
|
||||||
- name: slack
|
- name: notify
|
||||||
image: plugins/slack
|
image: alpine
|
||||||
settings:
|
|
||||||
channel: dev
|
|
||||||
+ when:
|
+ when:
|
||||||
+ - status: [ success, failure ]
|
+ - status: [ success, failure ]
|
||||||
```
|
```
|
||||||
@ -733,10 +725,8 @@ Example conditional execution by branch:
|
|||||||
+ branch: main
|
+ branch: main
|
||||||
+
|
+
|
||||||
steps:
|
steps:
|
||||||
- name: slack
|
- name: prettier
|
||||||
image: plugins/slack
|
image: woodpeckerci/plugin-prettier
|
||||||
settings:
|
|
||||||
channel: dev
|
|
||||||
```
|
```
|
||||||
|
|
||||||
The workflow now triggers on `main`, but also if the target branch of a pull request is `main`.
|
The workflow now triggers on `main`, but also if the target branch of a pull request is `main`.
|
||||||
|
@ -23,7 +23,7 @@ steps:
|
|||||||
template: config/k8s/service.yaml
|
template: config/k8s/service.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
Example pipeline using the Docker and Slack plugins:
|
Example pipeline using the Docker and Prettier plugins:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
@ -33,16 +33,14 @@ steps:
|
|||||||
- go build
|
- go build
|
||||||
- go test
|
- go test
|
||||||
|
|
||||||
|
- name: prettier
|
||||||
|
image: woodpeckerci/plugin-prettier
|
||||||
|
|
||||||
- name: publish
|
- name: publish
|
||||||
image: woodpeckerci/plugin-kaniko
|
image: woodpeckerci/plugin-kaniko
|
||||||
settings:
|
settings:
|
||||||
repo: foo/bar
|
repo: foo/bar
|
||||||
tags: latest
|
tags: latest
|
||||||
|
|
||||||
- name: notify
|
|
||||||
image: plugins/slack
|
|
||||||
settings:
|
|
||||||
channel: dev
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Plugin Isolation
|
## Plugin Isolation
|
||||||
|
@ -165,6 +165,10 @@ const config = {
|
|||||||
label: 'Mastodon',
|
label: 'Mastodon',
|
||||||
href: 'https://floss.social/@WoodpeckerCI',
|
href: 'https://floss.social/@WoodpeckerCI',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'Bluesky',
|
||||||
|
href: 'https://bsky.app/profile/woodpecker-ci.org',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'X',
|
label: 'X',
|
||||||
href: 'https://twitter.com/woodpeckerci',
|
href: 'https://twitter.com/woodpeckerci',
|
||||||
|
Loading…
Reference in New Issue
Block a user