Update Documentation (fix diffs and add settings) (#569)

* Add migration guide for plugin settings

* Update screenshot snippets

* Adjust plugin settings

* Fix diff insertion

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
This commit is contained in:
6543 2021-12-06 18:18:53 +01:00 committed by GitHub
parent 71b9179078
commit 7fb9191cce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 180 additions and 162 deletions

View file

@ -111,18 +111,15 @@ See [when](#step-when---step-conditional-execution) above to understand all the
Example targeting a specific platform:
```diff
pipeline:
pipeline:
build:
image: golang
commands:
- go build
- go test
-when:
-platform: [ linux/arm* ]
+when:
+ platform: [ linux/arm* ]
```
Assuming we have two agents, one `arm` and one `amd64`. Previously this pipeline would have executed on **either agent**, as Woodpecker is not fussy about where it runs the pipelines.
@ -134,8 +131,8 @@ This can be utilised in conjunction with other when blocks as well.
Example `when` pipeline & step block:
```yml
pipeline:
```diff
pipeline:
build:
image: golang
commands:
@ -144,23 +141,22 @@ pipeline:
publish:
image: plugins/docker
settings:
repo: foo/bar
+when:
+tag: release*
+ when:
+ tag: release*
+when:
+ platform: [ linux/arm* ]
```
### `platform`
To configure your pipeline to select an agent with a specific platform, you can use `platform` key.
```diff
+platform: linux/arm64
pipeline:
pipeline:
build:
image: golang
commands:
@ -190,7 +186,7 @@ Every step of your pipeline executes arbitrary commands inside a specified docke
The associated commit of a current pipeline run is checked out with git to a workspace which is mounted to every step of the pipeline as the working directory.
```diff
pipeline:
pipeline:
backend:
image: golang
commands:
@ -221,7 +217,7 @@ pipeline:
Woodpecker uses Docker images for the build environment, for plugins and for service containers. The image field is exposed in the container blocks in the Yaml:
```diff
pipeline:
pipeline:
build:
+ image: golang:1.6
commands:
@ -232,7 +228,7 @@ pipeline:
+ image: plugins/docker
repo: foo/bar
services:
services:
database:
+ image: mysql
```
@ -250,7 +246,7 @@ image: index.docker.io/library/golang:1.7
Woodpecker does not automatically upgrade docker images. Example configuration to always pull the latest image when updates are available:
```diff
pipeline:
pipeline:
build:
image: golang:latest
+ pull: true
@ -265,7 +261,7 @@ These credentials are never exposed to your pipeline, which means they cannot be
Example configuration using a private image:
```diff
pipeline:
pipeline:
build:
+ image: gcr.io/custom/golang
commands:
@ -302,7 +298,7 @@ For specific details on configuring access to Google Container Registry, please
Commands of every pipeline step are executed serially as if you would enter them into your local shell.
```diff
pipeline:
pipeline:
backend:
image: golang
commands:
@ -353,7 +349,7 @@ Woodpecker supports parallel step execution for same-machine fan-in and fan-out.
Example parallel configuration:
```diff
pipeline:
pipeline:
backend:
+ group: build
image: golang
@ -403,7 +399,7 @@ The workspace can be customized using the workspace block in the Yaml file:
+ base: /go
+ path: src/github.com/octocat/hello-world
pipeline:
pipeline:
build:
image: golang:latest
commands:
@ -414,11 +410,11 @@ pipeline:
The base attribute defines a shared base volume available to all pipeline steps. This ensures your source code, dependencies and compiled binaries are persisted and shared between steps.
```diff
workspace:
workspace:
+ base: /go
path: src/github.com/octocat/hello-world
pipeline:
pipeline:
deps:
image: golang:latest
commands:
@ -442,7 +438,7 @@ docker run --volume=my-named-volume:/go node:latest
The path attribute defines the working directory of your build. This is where your code is cloned and will be the default working directory of every step in your build process. The path must be relative and is combined with your base path.
```diff
workspace:
workspace:
base: /go
+ path: src/github.com/octocat/hello-world
```
@ -467,7 +463,7 @@ Woodpecker automatically configures a default clone step if not explicitly defin
+ git:
+ image: woodpeckerci/plugin-git
pipeline:
pipeline:
build:
image: golang
commands:
@ -478,9 +474,10 @@ pipeline:
Example configuration to override depth:
```diff
clone:
clone:
git:
image: woodpeckerci/plugin-git
+ settings:
+ depth: 50
```
@ -495,9 +492,10 @@ clone:
Example configuration to clone Mercurial repository:
```diff
clone:
clone:
hg:
+ image: plugins/hg
+ settings:
+ path: bitbucket.org/foo/bar
```
@ -506,18 +504,19 @@ clone:
To use the credentials that cloned the repository to clone it's submodules, update `.gitmodules` to use `https` instead of `git`:
```diff
[submodule "my-module"]
[submodule "my-module"]
path = my-module
- url = git@github.com:octocat/my-module.git
+ url = https://github.com/octocat/my-module.git
-url = git@github.com:octocat/my-module.git
+url = https://github.com/octocat/my-module.git
```
To use the ssh git url in `.gitmodules` for users cloning with ssh, and also use the https url in Woodpecker, add `submodule_override`:
```diff
clone:
clone:
git:
image: woodpeckerci/plugin-git
settings:
recursive: true
+ submodule_override:
+ my-module: https://github.com/octocat/my-module.git
@ -533,7 +532,7 @@ Woodpecker gives the ability to configure privileged mode in the Yaml. You can u
> Privileged mode is only available to trusted repositories and for security reasons should only be used in private environments. See [project settings](/docs/usage/project-settings#trusted) to enable trusted mode.
```diff
pipeline:
pipeline:
build:
image: docker
environment:
@ -541,7 +540,7 @@ pipeline:
commands:
- docker --tls=false ps
services:
services:
docker:
image: docker:dind
command: [ "--storage-driver=vfs", "--tls=false" ]

View file

@ -12,6 +12,7 @@ Example conditional execution by branch:
pipeline:
slack:
image: plugins/slack
settings:
channel: dev
+ when:
+ branch: master
@ -90,6 +91,7 @@ There are use cases for executing pipeline steps on failure, such as sending not
pipeline:
slack:
image: plugins/slack
settings:
channel: dev
+ when:
+ status: [ success, failure ]

View file

@ -146,6 +146,7 @@ Example commit substitution:
pipeline:
docker:
image: plugins/docker
settings:
+ tags: ${CI_COMMIT_SHA}
```
@ -155,6 +156,7 @@ Example tag substitution:
pipeline:
docker:
image: plugins/docker
settings:
+ tags: ${CI_COMMIT_TAG}
```
@ -182,6 +184,7 @@ Example variable substitution with substring:
pipeline:
docker:
image: plugins/docker
settings:
+ tags: ${CI_COMMIT_SHA:0:8}
```
@ -191,5 +194,6 @@ Example variable substitution strips `v` prefix from `v.1.0.0`:
pipeline:
docker:
image: plugins/docker
settings:
+ tags: ${CI_COMMIT_TAG##v}
```

View file

@ -16,11 +16,13 @@ pipeline:
publish:
image: plugins/docker
settings:
repo: foo/bar
tags: latest
notify:
image: plugins/slack
settings:
channel: dev
```

View file

@ -10,6 +10,7 @@ The below example demonstrates how we might configure a webhook plugin in the Ya
pipeline:
webhook:
image: foo/webhook
settings:
url: http://foo.com
method: post
body: |

View file

@ -1,6 +1,6 @@
# Project settings
As the owner of a project in Woodpecker you can change some project related settings via the Webinterface.
As the owner of a project in Woodpecker you can change project related settings via the web interface.
![project settings](./project-settings.png)
@ -10,7 +10,7 @@ The path to the pipeline config file or folder. By default it is left empty whic
## Repository hooks
Your Version-Control-System will notify Woodpecker about some events via webhooks. If you want your pipeline to only run on specific webhooks, you can check them by this setting.
Your Version-Control-System will notify Woodpecker about events via webhooks. If you want your pipeline to only run on specific webhooks, you can check them with this setting.
## Project settings

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View file

@ -51,7 +51,17 @@ Some versions need some changes to the server configuration or the pipeline conf
- `/var/lib/drone/drone.sqlite` -> `/var/lib/woodpecker/woodpecker.sqlite`
- `drone.sqlite` -> `woodpecker.sqlite`
- ...
- Plugin Settings moved into `settings` section:
```diff
pipline:
something:
image: my/plugin
- setting1: foo
- setting2: bar
+ settings:
+ setting1: foo
+ setting2: bar
```
## 0.14.0