mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-08-29 19:53:32 +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).
|
||||
|
||||
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
|
||||
steps:
|
||||
# ...
|
||||
- name: notify me on Slack
|
||||
image: plugins/slack
|
||||
- name: upload
|
||||
image: woodpeckerci/plugin-s3
|
||||
settings:
|
||||
channel: developers
|
||||
username: woodpecker
|
||||
password:
|
||||
from_secret: slack_token
|
||||
when:
|
||||
status: [success, failure] # This will execute the step on success and failure
|
||||
bucket: my-bucket-name
|
||||
access_key: a50d28f4dd477bc184fbd10b376de753
|
||||
secret_key:
|
||||
from_secret: aws_secret_key
|
||||
source: public/**/*
|
||||
target: /target/location
|
||||
```
|
||||
|
||||
To configure a plugin you can use the `settings` section.
|
||||
|
@ -200,10 +200,8 @@ A condition can be a check like:
|
||||
|
||||
```diff
|
||||
steps:
|
||||
- name: slack
|
||||
image: plugins/slack
|
||||
settings:
|
||||
channel: dev
|
||||
- name: prettier
|
||||
image: woodpeckerci/plugin-prettier
|
||||
+ when:
|
||||
+ - event: pull_request
|
||||
+ repo: test/test
|
||||
@ -211,7 +209,7 @@ A condition can be a check like:
|
||||
+ 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`
|
||||
2. The pipeline is executed from a push to `main`
|
||||
@ -222,10 +220,8 @@ Example conditional execution by repository:
|
||||
|
||||
```diff
|
||||
steps:
|
||||
- name: slack
|
||||
image: plugins/slack
|
||||
settings:
|
||||
channel: dev
|
||||
- name: prettier
|
||||
image: woodpeckerci/plugin-prettier
|
||||
+ when:
|
||||
+ - repo: test/test
|
||||
```
|
||||
@ -240,10 +236,8 @@ Example conditional execution by branch:
|
||||
|
||||
```diff
|
||||
steps:
|
||||
- name: slack
|
||||
image: plugins/slack
|
||||
settings:
|
||||
channel: dev
|
||||
- name: prettier
|
||||
image: woodpeckerci/plugin-prettier
|
||||
+ when:
|
||||
+ - branch: main
|
||||
```
|
||||
@ -346,10 +340,8 @@ There are use cases for executing steps on failure, such as sending notification
|
||||
|
||||
```diff
|
||||
steps:
|
||||
- name: slack
|
||||
image: plugins/slack
|
||||
settings:
|
||||
channel: dev
|
||||
- name: notify
|
||||
image: alpine
|
||||
+ when:
|
||||
+ - status: [ success, failure ]
|
||||
```
|
||||
@ -733,10 +725,8 @@ Example conditional execution by branch:
|
||||
+ branch: main
|
||||
+
|
||||
steps:
|
||||
- name: slack
|
||||
image: plugins/slack
|
||||
settings:
|
||||
channel: dev
|
||||
- name: prettier
|
||||
image: woodpeckerci/plugin-prettier
|
||||
```
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
Example pipeline using the Docker and Slack plugins:
|
||||
Example pipeline using the Docker and Prettier plugins:
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
@ -33,16 +33,14 @@ steps:
|
||||
- go build
|
||||
- go test
|
||||
|
||||
- name: prettier
|
||||
image: woodpeckerci/plugin-prettier
|
||||
|
||||
- name: publish
|
||||
image: woodpeckerci/plugin-kaniko
|
||||
settings:
|
||||
repo: foo/bar
|
||||
tags: latest
|
||||
|
||||
- name: notify
|
||||
image: plugins/slack
|
||||
settings:
|
||||
channel: dev
|
||||
```
|
||||
|
||||
## Plugin Isolation
|
||||
|
@ -165,6 +165,10 @@ const config = {
|
||||
label: 'Mastodon',
|
||||
href: 'https://floss.social/@WoodpeckerCI',
|
||||
},
|
||||
{
|
||||
label: 'Bluesky',
|
||||
href: 'https://bsky.app/profile/woodpecker-ci.org',
|
||||
},
|
||||
{
|
||||
label: 'X',
|
||||
href: 'https://twitter.com/woodpeckerci',
|
||||
|
Loading…
Reference in New Issue
Block a user