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: Example targeting a specific platform:
```diff ```diff
pipeline: pipeline:
build: build:
image: golang image: golang
commands: commands:
- go build - go build
- go test - go test
-when:
-platform: [ linux/arm* ]
+when: +when:
+ platform: [ linux/arm* ] + 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. 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: Example `when` pipeline & step block:
```yml ```diff
pipeline: pipeline:
build: build:
image: golang image: golang
commands: commands:
@ -144,23 +141,22 @@ pipeline:
publish: publish:
image: plugins/docker image: plugins/docker
settings:
repo: foo/bar repo: foo/bar
+when: + when:
+tag: release* + tag: release*
+when: +when:
+ platform: [ linux/arm* ] + platform: [ linux/arm* ]
``` ```
### `platform` ### `platform`
To configure your pipeline to select an agent with a specific platform, you can use `platform` key. To configure your pipeline to select an agent with a specific platform, you can use `platform` key.
```diff ```diff
+platform: linux/arm64 +platform: linux/arm64
pipeline: pipeline:
build: build:
image: golang image: golang
commands: 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. 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 ```diff
pipeline: pipeline:
backend: backend:
image: golang image: golang
commands: 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: 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 ```diff
pipeline: pipeline:
build: build:
+ image: golang:1.6 + image: golang:1.6
commands: commands:
@ -232,7 +228,7 @@ pipeline:
+ image: plugins/docker + image: plugins/docker
repo: foo/bar repo: foo/bar
services: services:
database: database:
+ image: mysql + 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: Woodpecker does not automatically upgrade docker images. Example configuration to always pull the latest image when updates are available:
```diff ```diff
pipeline: pipeline:
build: build:
image: golang:latest image: golang:latest
+ pull: true + 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: Example configuration using a private image:
```diff ```diff
pipeline: pipeline:
build: build:
+ image: gcr.io/custom/golang + image: gcr.io/custom/golang
commands: 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. Commands of every pipeline step are executed serially as if you would enter them into your local shell.
```diff ```diff
pipeline: pipeline:
backend: backend:
image: golang image: golang
commands: commands:
@ -353,7 +349,7 @@ Woodpecker supports parallel step execution for same-machine fan-in and fan-out.
Example parallel configuration: Example parallel configuration:
```diff ```diff
pipeline: pipeline:
backend: backend:
+ group: build + group: build
image: golang image: golang
@ -403,7 +399,7 @@ The workspace can be customized using the workspace block in the Yaml file:
+ base: /go + base: /go
+ path: src/github.com/octocat/hello-world + path: src/github.com/octocat/hello-world
pipeline: pipeline:
build: build:
image: golang:latest image: golang:latest
commands: 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. 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 ```diff
workspace: workspace:
+ base: /go + base: /go
path: src/github.com/octocat/hello-world path: src/github.com/octocat/hello-world
pipeline: pipeline:
deps: deps:
image: golang:latest image: golang:latest
commands: 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. 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 ```diff
workspace: workspace:
base: /go base: /go
+ path: src/github.com/octocat/hello-world + path: src/github.com/octocat/hello-world
``` ```
@ -467,7 +463,7 @@ Woodpecker automatically configures a default clone step if not explicitly defin
+ git: + git:
+ image: woodpeckerci/plugin-git + image: woodpeckerci/plugin-git
pipeline: pipeline:
build: build:
image: golang image: golang
commands: commands:
@ -478,9 +474,10 @@ pipeline:
Example configuration to override depth: Example configuration to override depth:
```diff ```diff
clone: clone:
git: git:
image: woodpeckerci/plugin-git image: woodpeckerci/plugin-git
+ settings:
+ depth: 50 + depth: 50
``` ```
@ -495,9 +492,10 @@ clone:
Example configuration to clone Mercurial repository: Example configuration to clone Mercurial repository:
```diff ```diff
clone: clone:
hg: hg:
+ image: plugins/hg + image: plugins/hg
+ settings:
+ path: bitbucket.org/foo/bar + 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`: To use the credentials that cloned the repository to clone it's submodules, update `.gitmodules` to use `https` instead of `git`:
```diff ```diff
[submodule "my-module"] [submodule "my-module"]
path = my-module path = my-module
- url = git@github.com:octocat/my-module.git -url = git@github.com:octocat/my-module.git
+ url = https://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`: 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 ```diff
clone: clone:
git: git:
image: woodpeckerci/plugin-git image: woodpeckerci/plugin-git
settings:
recursive: true recursive: true
+ submodule_override: + submodule_override:
+ my-module: https://github.com/octocat/my-module.git + 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. > 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 ```diff
pipeline: pipeline:
build: build:
image: docker image: docker
environment: environment:
@ -541,7 +540,7 @@ pipeline:
commands: commands:
- docker --tls=false ps - docker --tls=false ps
services: services:
docker: docker:
image: docker:dind image: docker:dind
command: [ "--storage-driver=vfs", "--tls=false" ] command: [ "--storage-driver=vfs", "--tls=false" ]

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
# Project settings # 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) ![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 ## 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 ## 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` - `/var/lib/drone/drone.sqlite` -> `/var/lib/woodpecker/woodpecker.sqlite`
- `drone.sqlite` -> `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 ## 0.14.0