[Docs] Simplify docker-compose samples (#356)

This commit is contained in:
Anbraten 2021-09-28 00:04:52 +02:00 committed by GitHub
parent f81bd8c656
commit 3f03052190
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 175 additions and 303 deletions

View file

@ -95,23 +95,12 @@ This is the reference list of all environment variables available to your build
If you want specific environment variables to be available in all of your builds use the `WOODPECKER_ENVIRONMENT` setting on the Woodpecker server. If you want specific environment variables to be available in all of your builds use the `WOODPECKER_ENVIRONMENT` setting on the Woodpecker server.
```.env
WOODPECKER_ENVIRONMENT=first_var:value1,second_var:value2
```
```.diff ```.diff
services: services:
woodpecker-server: woodpecker-server:
image: woodpeckerci/woodpecker-server:latest [...]
environment: environment:
- WOODPECKER_OPEN=true - [...]
- WOODPECKER_ORGS=dolores,dogpatch
- WOODPECKER_ADMIN=johnsmith,janedoe
- WOODPECKER_HOST=${WOODPECKER_HOST}
- WOODPECKER_GITHUB=true
- WOODPECKER_GITHUB_CLIENT=${WOODPECKER_GITHUB_CLIENT}
- WOODPECKER_GITHUB_SECRET=${WOODPECKER_GITHUB_SECRET}
- WOODPECKER_SECRET=${WOODPECKER_SECRET}
+ - WOODPECKER_ENVIRONMENT=first_var:value1,second_var:value2 + - WOODPECKER_ENVIRONMENT=first_var:value1,second_var:value2
``` ```

View file

@ -12,9 +12,9 @@ A Woodpecker deployment consists of two parts:
## Installation ## Installation
You can install Woodpecker [images](/docs/downloads#docker-images) on multiple ways: You can install Woodpecker on multiple ways:
- Using [docker-compose](https://docs.docker.com/compose/) - Using [docker-compose](/docs/administration/setup#docker-compose) with the official [docker images](/docs/downloads#docker-images)
- By deploying to a [Kubernetes](/docs/administration/kubernetes) with manifests or a Helm charts - By deploying to a [Kubernetes](/docs/administration/kubernetes) with manifests or Woodpeckers official Helm charts
- Using [binaries](/docs/downloads) - Using [binaries](/docs/downloads)
### docker-compose ### docker-compose
@ -61,27 +61,27 @@ volumes:
Woodpecker needs to know its own address. You must therefore provide the public address of it in `<scheme>://<hostname>` format. Please omit trailing slashes: Woodpecker needs to know its own address. You must therefore provide the public address of it in `<scheme>://<hostname>` format. Please omit trailing slashes:
```diff ```diff
# docker-compose.yml
version: '3'
services: services:
woodpecker-server: woodpecker-server:
image: woodpeckerci/woodpecker-server:latest [...]
environment: environment:
- WOODPECKER_OPEN=true - [...]
+ - WOODPECKER_HOST=${WOODPECKER_HOST} + - WOODPECKER_HOST=${WOODPECKER_HOST}
- WOODPECKER_GITHUB=true
- WOODPECKER_GITHUB_CLIENT=${WOODPECKER_GITHUB_CLIENT}
- WOODPECKER_GITHUB_SECRET=${WOODPECKER_GITHUB_SECRET}
- WOODPECKER_SECRET=${WOODPECKER_SECRET}
``` ```
As agents run pipeline steps as docker containers they require access to the host machine's Docker daemon: As agents run pipeline steps as docker containers they require access to the host machine's Docker daemon:
```diff ```diff
# docker-compose.yml
version: '3'
services: services:
[...]
woodpecker-agent: woodpecker-agent:
image: woodpeckerci/woodpecker-agent:latest [...]
command: agent
restart: always
depends_on: [ woodpecker-server ]
+ volumes: + volumes:
+ - /var/run/docker.sock:/var/run/docker.sock + - /var/run/docker.sock:/var/run/docker.sock
``` ```
@ -89,37 +89,32 @@ services:
Agents require the server address for agent-to-server communication: Agents require the server address for agent-to-server communication:
```diff ```diff
# docker-compose.yml
version: '3'
services: services:
woodpecker-agent: woodpecker-agent:
image: woodpeckerci/woodpecker-agent:latest [...]
command: agent
restart: always
depends_on: [ woodpecker-server ]
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment: environment:
+ - WOODPECKER_SERVER=woodpecker-server:9000 + - WOODPECKER_SERVER=woodpecker-server:9000
- WOODPECKER_SECRET=${WOODPECKER_SECRET}
``` ```
The server and agents use a shared secret to authenticate communication. This should be a random string of your choosing and should be kept private. You can generate such string with `openssl rand -hex 32`: The server and agents use a shared secret to authenticate communication. This should be a random string of your choosing and should be kept private. You can generate such string with `openssl rand -hex 32`:
```diff ```diff
# docker-compose.yml
version: '3'
services: services:
woodpecker-server: woodpecker-server:
image: woodpeckerci/woodpecker-server:latest [...]
environment: environment:
- WOODPECKER_OPEN=true - [...]
- WOODPECKER_HOST=${WOODPECKER_HOST}
- WOODPECKER_GITHUB=true
- WOODPECKER_GITHUB_CLIENT=${WOODPECKER_GITHUB_CLIENT}
- WOODPECKER_GITHUB_SECRET=${WOODPECKER_GITHUB_SECRET}
+ - WOODPECKER_SECRET=${WOODPECKER_SECRET} + - WOODPECKER_SECRET=${WOODPECKER_SECRET}
woodpecker-agent: woodpecker-agent:
image: woodpeckerci/woodpecker-agent:latest [...]
environment: environment:
- WOODPECKER_SERVER=woodpecker-server:9000 - [...]
- WOODPECKER_DEBUG=true
+ - WOODPECKER_SECRET=${WOODPECKER_SECRET} + - WOODPECKER_SECRET=${WOODPECKER_SECRET}
``` ```

View file

@ -8,17 +8,17 @@ If registration is open every user with an account at the configured [SCM](docs/
This example enables open registration for users that are members of approved organizations: This example enables open registration for users that are members of approved organizations:
```diff ```diff
# docker-compose.yml
version: '3'
services: services:
woodpecker-server: woodpecker-server:
image: woodpeckerci/woodpecker-server:latest [...]
environment: environment:
- [...]
+ - WOODPECKER_OPEN=true + - WOODPECKER_OPEN=true
+ - WOODPECKER_ORGS=dolores,dogpatch + - WOODPECKER_ORGS=dolores,dogpatch
- WOODPECKER_HOST=${WOODPECKER_HOST}
- WOODPECKER_GITHUB=true
- WOODPECKER_GITHUB_CLIENT=${WOODPECKER_GITHUB_CLIENT}
- WOODPECKER_GITHUB_SECRET=${WOODPECKER_GITHUB_SECRET}
- WOODPECKER_SECRET=${WOODPECKER_SECRET}
``` ```
## Administrators ## Administrators
@ -26,18 +26,15 @@ services:
Administrators should also be enumerated in your configuration. Administrators should also be enumerated in your configuration.
```diff ```diff
# docker-compose.yml
version: '3'
services: services:
woodpecker-server: woodpecker-server:
image: woodpeckerci/woodpecker-server:latest [...]
environment: environment:
- WOODPECKER_OPEN=true - [...]
- WOODPECKER_ORGS=dolores,dogpatch
+ - WOODPECKER_ADMIN=johnsmith,janedoe + - WOODPECKER_ADMIN=johnsmith,janedoe
- WOODPECKER_HOST=${WOODPECKER_HOST}
- WOODPECKER_GITHUB=true
- WOODPECKER_GITHUB_CLIENT=${WOODPECKER_GITHUB_CLIENT}
- WOODPECKER_GITHUB_SECRET=${WOODPECKER_GITHUB_SECRET}
- WOODPECKER_SECRET=${WOODPECKER_SECRET}
``` ```
## Filtering repositories ## Filtering repositories
@ -47,18 +44,15 @@ Woodpecker operates with the user's OAuth permission. Due to the coarse permissi
Use the `WOODPECKER_REPO_OWNERS` variable to filter which GitHub user's repos should be synced only. You typically want to put here your company's GitHub name. Use the `WOODPECKER_REPO_OWNERS` variable to filter which GitHub user's repos should be synced only. You typically want to put here your company's GitHub name.
```diff ```diff
# docker-compose.yml
version: '3'
services: services:
woodpecker-server: woodpecker-server:
image: woodpeckerci/woodpecker-server:latest [...]
environment: environment:
- WOODPECKER_OPEN=true - [...]
- WOODPECKER_ORGS=dolores,dogpatch
+ - WOODPECKER_REPO_OWNERS=mycompany,mycompanyossgithubuser + - WOODPECKER_REPO_OWNERS=mycompany,mycompanyossgithubuser
- WOODPECKER_HOST=${WOODPECKER_HOST}
- WOODPECKER_GITHUB=true
- WOODPECKER_GITHUB_CLIENT=${WOODPECKER_GITHUB_CLIENT}
- WOODPECKER_GITHUB_SECRET=${WOODPECKER_GITHUB_SECRET}
- WOODPECKER_SECRET=${WOODPECKER_SECRET}
``` ```
## Global registry setting ## Global registry setting
@ -72,19 +66,8 @@ version: '3'
services: services:
woodpecker-server: woodpecker-server:
image: woodpeckerci/woodpecker-server:latest [...]
ports:
- 80:8000
- 9000
volumes:
- woodpecker-server-data:/var/lib/drone/
restart: always
environment: environment:
- WOODPECKER_OPEN=true - [...]
- WOODPECKER_HOST=${WOODPECKER_HOST}
- WOODPECKER_GITHUB=true
- WOODPECKER_GITHUB_CLIENT=${WOODPECKER_GITHUB_CLIENT}
- WOODPECKER_GITHUB_SECRET=${WOODPECKER_GITHUB_SECRET}
- WOODPECKER_SECRET=${WOODPECKER_SECRET}
+ - WOODPECKER_DOCKER_CONFIG=/home/user/.docker/config.json + - WOODPECKER_DOCKER_CONFIG=/home/user/.docker/config.json
``` ```

View file

@ -1,37 +1,22 @@
# GitHub # GitHub
Woodpecker comes with built-in support for GitHub and GitHub Enterprise. To enable GitHub you should configure the Woodpecker container using the following environment variables: Woodpecker comes with built-in support for GitHub and GitHub Enterprise. To enable GitHub you should configure the Woodpecker server using the following environment variables:
```diff ```diff
# docker-compose.yml
version: '3' version: '3'
services: services:
woodpecker-server: woodpecker-server:
image: woodpeckerci/woodpecker-server:latest [...]
ports:
- 80:8000
- 9000
volumes:
- /var/lib/drone:/var/lib/drone/
restart: always
environment: environment:
- WOODPECKER_OPEN=true - [...]
- WOODPECKER_HOST=${WOODPECKER_HOST}
+ - WOODPECKER_GITHUB=true + - WOODPECKER_GITHUB=true
+ - WOODPECKER_GITHUB_CLIENT=${WOODPECKER_GITHUB_CLIENT} + - WOODPECKER_GITHUB_CLIENT=${WOODPECKER_GITHUB_CLIENT}
+ - WOODPECKER_GITHUB_SECRET=${WOODPECKER_GITHUB_SECRET} + - WOODPECKER_GITHUB_SECRET=${WOODPECKER_GITHUB_SECRET}
- WOODPECKER_SECRET=${WOODPECKER_SECRET}
woodpecker-agent: woodpecker-agent:
image: woodpeckerci/woodpecker-agent:latest [...]
restart: always
depends_on:
- woodpecker-server
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- WOODPECKER_SERVER=woodpecker-server:9000
- WOODPECKER_SECRET=${WOODPECKER_SECRET}
``` ```
## Registration ## Registration
@ -46,35 +31,26 @@ Please use this screenshot for reference:
This is a full list of configuration options. Please note that many of these options use default configuration values that should work for the majority of installations. This is a full list of configuration options. Please note that many of these options use default configuration values that should work for the majority of installations.
`WOODPECKER_GITHUB=true` ```shell
: Set to true to enable the GitHub driver. WOODPECKER_GITHUB=true # Set to true to enable the GitHub driver
`WOODPECKER_GITHUB_URL=https://github.com` WOODPECKER_GITHUB_URL=https://github.com # GitHub server address
: GitHub server address.
`WOODPECKER_GITHUB_CLIENT` WOODPECKER_GITHUB_CLIENT=... # GitHub oauth2 client id
: GitHub oauth2 client id.
`WOODPECKER_GITHUB_SECRET` WOODPECKER_GITHUB_SECRET=... # GitHub oauth2 client secret.
: GitHub oauth2 client secret.
`WOODPECKER_GITHUB_SCOPE=repo,repo:status,user:email,read:org` WOODPECKER_GITHUB_SCOPE=repo,repo:status,user:email,read:org # Comma-separated GitHub oauth scope.
: Comma-separated GitHub oauth scope.
`WOODPECKER_GITHUB_GIT_USERNAME` WOODPECKER_GITHUB_GIT_USERNAME=... # Optional. Use a single machine account username to clone all repositories.
: Optional. Use a single machine account username to clone all repositories.
`WOODPECKER_GITHUB_GIT_PASSWORD` WOODPECKER_GITHUB_GIT_PASSWORD=... # Optional. Use a single machine account password to clone all repositories.
: Optional. Use a single machine account password to clone all repositories.
`WOODPECKER_GITHUB_PRIVATE_MODE=false` WOODPECKER_GITHUB_PRIVATE_MODE=false # Set to true if GitHub is running in private mode.
: Set to true if GitHub is running in private mode.
`WOODPECKER_GITHUB_MERGE_REF=true` WOODPECKER_GITHUB_MERGE_REF=true # Set to true to use the `refs/pulls/%d/merge` vs `refs/pulls/%d/head`
: Set to true to use the `refs/pulls/%d/merge` vs `refs/pulls/%d/head`
`WOODPECKER_GITHUB_CONTEXT=continuous-integration/woodpecker` WOODPECKER_GITHUB_CONTEXT=continuous-integration/woodpecker # Customize the GitHub status message context
: Customize the GitHub status message context
`WOODPECKER_GITHUB_SKIP_VERIFY=false` WOODPECKER_GITHUB_SKIP_VERIFY=false # Set to true to disable SSL verification
: Set to true to disable SSL verification. ```

View file

@ -3,36 +3,21 @@
Woodpecker comes with built-in support for Gitea. To enable Gitea you should configure the Woodpecker container using the following environment variables: Woodpecker comes with built-in support for Gitea. To enable Gitea you should configure the Woodpecker container using the following environment variables:
```diff ```diff
# docker-compose.yml
version: '3' version: '3'
services: services:
woodpecker-server: woodpecker-server:
image: woodpeckerci/woodpecker-server:latest [...]
ports:
- 80:8000
- 9000
volumes:
- /var/lib/drone:/var/lib/drone/
restart: always
environment: environment:
- WOODPECKER_OPEN=true - [...]
- WOODPECKER_HOST=${WOODPECKER_HOST}
+ - WOODPECKER_GITEA=true + - WOODPECKER_GITEA=true
+ - WOODPECKER_GITEA_URL=${WOODPECKER_GITEA_URL} + - WOODPECKER_GITEA_URL=${WOODPECKER_GITEA_URL}
+ - WOODPECKER_GITEA_CLIENT=${WOODPECKER_GITEA_CLIENT} + - WOODPECKER_GITEA_CLIENT=${WOODPECKER_GITEA_CLIENT}
+ - WOODPECKER_GITEA_SECRET=${WOODPECKER_GITEA_SECRET} + - WOODPECKER_GITEA_SECRET=${WOODPECKER_GITEA_SECRET}
- WOODPECKER_SECRET=${WOODPECKER_SECRET}
woodpecker-agent: woodpecker-agent:
image: woodpeckerci/woodpecker-agent:latest [...]
restart: always
depends_on:
- woodpecker-server
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- WOODPECKER_SERVER=woodpecker-server:9000
- WOODPECKER_SECRET=${WOODPECKER_SECRET}
``` ```
## Registration ## Registration
@ -46,29 +31,22 @@ Register your application with Gitea to create your client id and secret. You ca
This is a full list of configuration options. Please note that many of these options use default configuration values that should work for the majority of installations. This is a full list of configuration options. Please note that many of these options use default configuration values that should work for the majority of installations.
`WOODPECKER_GITEA=true` ```shell
: Set to true to enable the Gitea driver. WOODPECKER_GITEA=true # Set to true to enable the Gitea driver
`WOODPECKER_GITEA_URL=https://try.gitea.io` WOODPECKER_GITEA_URL=https://try.gitea.io # Gitea server address
: Gitea server address.
`WOODPECKER_GITEA_CLIENT` WOODPECKER_GITEA_CLIENT=... # Gitea oauth2 client id
: Gitea oauth2 client id.
`WOODPECKER_GITEA_SECRET` WOODPECKER_GITEA_SECRET=... # Gitea oauth2 client secret
: Gitea oauth2 client secret.
`WOODPECKER_GITEA_CONTEXT=continuous-integration/woodpecker` WOODPECKER_GITEA_CONTEXT=continuous-integration/woodpecker # Customize the Gitea status message context
: Customize the Gitea status message context
`WOODPECKER_GITEA_GIT_USERNAME` WOODPECKER_GITEA_GIT_USERNAME=... # Optional. Use a single machine account username to clone all repositories.
: Optional. Use a single machine account username to clone all repositories.
`WOODPECKER_GITEA_GIT_PASSWORD` WOODPECKER_GITEA_GIT_PASSWORD=... # Optional. Use a single machine account password to clone all repositories.
: Optional. Use a single machine account password to clone all repositories.
`WOODPECKER_GITEA_PRIVATE_MODE=true` WOODPECKER_GITEA_PRIVATE_MODE=true # Set to true if Gitea is running in private mode.
: Set to true if Gitea is running in private mode.
`WOODPECKER_GITEA_SKIP_VERIFY=false` WOODPECKER_GITEA_SKIP_VERIFY=false # Set to true to disable SSL verification.
: Set to true to disable SSL verification. ```

View file

@ -3,66 +3,46 @@
Woodpecker comes with built-in support for the GitLab version 8.2 and higher. To enable GitLab you should configure the Woodpecker container using the following environment variables: Woodpecker comes with built-in support for the GitLab version 8.2 and higher. To enable GitLab you should configure the Woodpecker container using the following environment variables:
```diff ```diff
version: '2' # docker-compose.yml
version: '3'
services: services:
woodpecker-server: woodpecker-server:
image: woodpeckerci/woodpecker-server:latest [...]
ports:
- 80:8000
- 9000
volumes:
- /var/lib/drone:/var/lib/drone/
restart: always
environment: environment:
+ - WOODPECKER_GITLAB=true + - WOODPECKER_GITLAB=true
+ - WOODPECKER_GITLAB_CLIENT=95c0282573633eb25e82 + - WOODPECKER_GITLAB_CLIENT=95c0282573633eb25e82
+ - WOODPECKER_GITLAB_SECRET=30f5064039e6b359e075 + - WOODPECKER_GITLAB_SECRET=30f5064039e6b359e075
+ - WOODPECKER_GITLAB_URL=http://gitlab.mycompany.com + - WOODPECKER_GITLAB_URL=http://gitlab.mycompany.com
- WOODPECKER_SECRET=${WOODPECKER_SECRET}
woodpecker-agent: woodpecker-agent:
image: woodpeckerci/woodpecker-agent:latest [...]
restart: always
depends_on:
- woodpecker-server
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- WOODPECKER_SERVER=woodpecker-server:9000
- WOODPECKER_SECRET=${WOODPECKER_SECRET}
``` ```
## Configuration
This is a full list of configuration options. Please note that many of these options use default configuration values that should work for the majority of installations.
`WOODPECKER_GITLAB=true`
: Set to true to enable the GitLab driver.
`WOODPECKER_GITLAB_URL=https://gitlab.com`
: GitLab Server address.
`WOODPECKER_GITLAB_CLIENT`
: GitLab oauth2 client id.
`WOODPECKER_GITLAB_SECRET`
: GitLab oauth2 client secret.
`WOODPECKER_GITLAB_GIT_USERNAME`
: Optional. Use a single machine account username to clone all repositories.
`WOODPECKER_GITLAB_GIT_PASSWORD`
: Optional. Use a single machine account password to clone all repositories.
`WOODPECKER_GITLAB_SKIP_VERIFY=false`
: Set to true to disable SSL verification.
`WOODPECKER_GITLAB_PRIVATE_MODE=false`
: Set to true if GitLab is running in private mode.
## Registration ## Registration
You must register your application with GitLab in order to generate a Client and Secret. Navigate to your account settings and choose Applications from the menu, and click New Application. You must register your application with GitLab in order to generate a Client and Secret. Navigate to your account settings and choose Applications from the menu, and click New Application.
Please use `http://woodpecker.mycompany.com/authorize` as the Authorization callback URL. Grant `api` scope to the application. Please use `http://woodpecker.mycompany.com/authorize` as the Authorization callback URL. Grant `api` scope to the application.
## Configuration
This is a full list of configuration options. Please note that many of these options use default configuration values that should work for the majority of installations.
```shell
WOODPECKER_GITLAB=true # Set to true to enable the GitLab driver
WOODPECKER_GITLAB_URL=https://gitlab.com # GitLab Server address
WOODPECKER_GITLAB_CLIENT=... # GitLab oauth2 client id
WOODPECKER_GITLAB_SECRET=... # GitLab oauth2 client secret.
WOODPECKER_GITLAB_GIT_USERNAME=... # Optional. Use a single machine account username to clone all repositories
WOODPECKER_GITLAB_GIT_PASSWORD=... # Optional. Use a single machine account password to clone all repositories
WOODPECKER_GITLAB_SKIP_VERIFY=false # Set to true to disable SSL verification
WOODPECKER_GITLAB_PRIVATE_MODE=false # Set to true if GitLab is running in private mode
```

View file

@ -3,50 +3,22 @@
Woodpecker comes with built-in support for Bitbucket Cloud. To enable Bitbucket Cloud you should configure the Woodpecker container using the following environment variables: Woodpecker comes with built-in support for Bitbucket Cloud. To enable Bitbucket Cloud you should configure the Woodpecker container using the following environment variables:
```diff ```diff
# docker-compose.yml
version: '3' version: '3'
services: services:
woodpecker-server: woodpecker-server:
image: woodpeckerci/woodpecker-server:latest [...]
ports:
- 80:8000
- 9000
volumes:
- /var/lib/drone:/var/lib/drone/
restart: always
environment: environment:
- WOODPECKER_OPEN=true - [...]
- WOODPECKER_HOST=${WOODPECKER_HOST}
+ - WOODPECKER_BITBUCKET=true + - WOODPECKER_BITBUCKET=true
+ - WOODPECKER_BITBUCKET_CLIENT=95c0282573633eb25e82 + - WOODPECKER_BITBUCKET_CLIENT=95c0282573633eb25e82
+ - WOODPECKER_BITBUCKET_SECRET=30f5064039e6b359e075 + - WOODPECKER_BITBUCKET_SECRET=30f5064039e6b359e075
- WOODPECKER_SECRET=${WOODPECKER_SECRET}
woodpecker-agent: woodpecker-agent:
image: woodpeckerci/woodpecker-agent:latest [...]
restart: always
depends_on:
- woodpecker-server
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- WOODPECKER_SERVER=woodpecker-server:9000
- WOODPECKER_SECRET=${WOODPECKER_SECRET}
``` ```
## Configuration
This is a full list of configuration options. Please note that many of these options use default configuration values that should work for the majority of installations.
`WOODPECKER_BITBUCKET=true`
: Set to true to enable the Bitbucket driver.
`WOODPECKER_BITBUCKET_CLIENT`
: Bitbucket oauth2 client id
`WOODPECKER_BITBUCKET_SECRET`
: Bitbucket oauth2 client secret
## Registration ## Registration
You must register your application with Bitbucket in order to generate a client and secret. Navigate to your account settings and choose OAuth from the menu, and click Add Consumer. You must register your application with Bitbucket in order to generate a client and secret. Navigate to your account settings and choose OAuth from the menu, and click Add Consumer.
@ -67,6 +39,18 @@ Repositories:Read
Webhooks:Read and Write Webhooks:Read and Write
``` ```
## Configuration
This is a full list of configuration options. Please note that many of these options use default configuration values that should work for the majority of installations.
```shell
WOODPECKER_BITBUCKET=true # Set to true to enable the Bitbucket driver
WOODPECKER_BITBUCKET_CLIENT=... # Bitbucket oauth2 client id
WOODPECKER_BITBUCKET_SECRET=... # Bitbucket oauth2 client secret
```
## Missing Features ## Missing Features
Merge requests are not currently supported. We are interested in patches to include this functionality. If you are interested in contributing to Woodpecker and submitting a patch please [contact us](https://discord.gg/fcMQqSMXJy). Merge requests are not currently supported. We are interested in patches to include this functionality. If you are interested in contributing to Woodpecker and submitting a patch please [contact us](https://discord.gg/fcMQqSMXJy).

View file

@ -3,40 +3,25 @@
Woodpecker comes with experimental support for Bitbucket Server, formerly known as Atlassian Stash. To enable Bitbucket Server you should configure the Woodpecker container using the following environment variables: Woodpecker comes with experimental support for Bitbucket Server, formerly known as Atlassian Stash. To enable Bitbucket Server you should configure the Woodpecker container using the following environment variables:
```diff ```diff
# docker-compose.yml
version: '3' version: '3'
services: services:
woodpecker-server: woodpecker-server:
image: woodpeckerci/woodpecker-server:latest [...]
ports:
- 80:8000
- 9000
volumes:
- /var/lib/drone:/var/lib/drone/
restart: always
environment: environment:
- WOODPECKER_OPEN=true - [...]
- WOODPECKER_HOST=${WOODPECKER_HOST}
+ - WOODPECKER_STASH=true + - WOODPECKER_STASH=true
+ - WOODPECKER_STASH_GIT_USERNAME=foo + - WOODPECKER_STASH_GIT_USERNAME=foo
+ - WOODPECKER_STASH_GIT_PASSWORD=bar + - WOODPECKER_STASH_GIT_PASSWORD=bar
+ - WOODPECKER_STASH_CONSUMER_KEY=95c0282573633eb25e82 + - WOODPECKER_STASH_CONSUMER_KEY=95c0282573633eb25e82
+ - WOODPECKER_STASH_CONSUMER_RSA=/etc/bitbucket/key.pem + - WOODPECKER_STASH_CONSUMER_RSA=/etc/bitbucket/key.pem
+ - WOODPECKER_STASH_URL=http://stash.mycompany.com + - WOODPECKER_STASH_URL=http://stash.mycompany.com
- WOODPECKER_SECRET=${WOODPECKER_SECRET}
volumes: volumes:
+ - /path/to/key.pem:/path/to/key.pem + - /path/to/key.pem:/path/to/key.pem
woodpecker-agent: woodpecker-agent:
image: woodpeckerci/woodpecker-agent:latest [...]
restart: always
depends_on:
- woodpecker-server
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- WOODPECKER_SERVER=woodpecker-server:9000
- WOODPECKER_SECRET=${WOODPECKER_SECRET}
``` ```
## Private Key File ## Private Key File
@ -58,43 +43,47 @@ Please note that the private key file can be mounted into your Woodpecker conati
Private key file mounted into your Woodpecker container at runtime as a volume. Private key file mounted into your Woodpecker container at runtime as a volume.
```diff ```diff
version: '2' # docker-compose.yml
version: '3'
services: services:
woodpecker-server: woodpecker-server:
image: woodpeckerci/woodpecker-server:latest [...]
environment: environment:
- WOODPECKER_OPEN=true - [...]
- WOODPECKER_HOST=${WOODPECKER_HOST}
- WOODPECKER_STASH=true - WOODPECKER_STASH=true
- WOODPECKER_STASH_GIT_USERNAME=foo - WOODPECKER_STASH_GIT_USERNAME=foo
- WOODPECKER_STASH_GIT_PASSWORD=bar - WOODPECKER_STASH_GIT_PASSWORD=bar
- WOODPECKER_STASH_CONSUMER_KEY=95c0282573633eb25e82 - WOODPECKER_STASH_CONSUMER_KEY=95c0282573633eb25e82
+ - WOODPECKER_STASH_CONSUMER_RSA=/etc/bitbucket/key.pem + - WOODPECKER_STASH_CONSUMER_RSA=/etc/bitbucket/key.pem
- WOODPECKER_STASH_URL=http://stash.mycompany.com - WOODPECKER_STASH_URL=http://stash.mycompany.com
- WOODPECKER_SECRET=${WOODPECKER_SECRET}
+ volumes: + volumes:
+ - /etc/bitbucket/key.pem:/etc/bitbucket/key.pem + - /etc/bitbucket/key.pem:/etc/bitbucket/key.pem
woodpecker-agent:
[...]
``` ```
Private key as environment variable Private key as environment variable
```diff ```diff
# docker-compose.yml
version: '3' version: '3'
services: services:
woodpecker-server: woodpecker-server:
image: woodpeckerci/woodpecker-server:latest [...]
environment: environment:
- WOODPECKER_OPEN=true - [...]
- WOODPECKER_HOST=${WOODPECKER_HOST}
- WOODPECKER_STASH=true - WOODPECKER_STASH=true
- WOODPECKER_STASH_GIT_USERNAME=foo - WOODPECKER_STASH_GIT_USERNAME=foo
- WOODPECKER_STASH_GIT_PASSWORD=bar - WOODPECKER_STASH_GIT_PASSWORD=bar
- WOODPECKER_STASH_CONSUMER_KEY=95c0282573633eb25e82 - WOODPECKER_STASH_CONSUMER_KEY=95c0282573633eb25e82
+ - WOODPECKER_STASH_CONSUMER_RSA_STRING=contentOfPemKeyAsString + - WOODPECKER_STASH_CONSUMER_RSA_STRING=contentOfPemKeyAsString
- WOODPECKER_STASH_URL=http://stash.mycompany.com - WOODPECKER_STASH_URL=http://stash.mycompany.com
- WOODPECKER_SECRET=${WOODPECKER_SECRET}
woodpecker-agent:
[...]
``` ```
## Service Account ## Service Account
@ -112,24 +101,18 @@ Please use http://woodpecker.mycompany.com/authorize as the Authorization callba
This is a full list of configuration options. Please note that many of these options use default configuration values that should work for the majority of installations. This is a full list of configuration options. Please note that many of these options use default configuration values that should work for the majority of installations.
```shell
WOODPECKER_STASH=true # Set to true to enable the Bitbucket Server (Stash) driver
`WOODPECKER_STASH=true` WOODPECKER_STASH_URL # Bitbucket Server address.
: Set to true to enable the Bitbucket Server (Stash) driver.
`WOODPECKER_STASH_URL` WOODPECKER_STASH_CONSUMER_KEY=... # Bitbucket Server oauth1 consumer key
: Bitbucket Server address.
`WOODPECKER_STASH_CONSUMER_KEY` WOODPECKER_STASH_CONSUMER_RSA=... # Bitbucket Server oauth1 private key file
: Bitbucket Server oauth1 consumer key
`WOODPECKER_STASH_CONSUMER_RSA` WOODPECKER_STASH_CONSUMER_RSA_STRING=... # Bibucket Server oauth1 private key as a string
: Bitbucket Server oauth1 private key file
`WOODPECKER_STASH_CONSUMER_RSA_STRING` WOODPECKER_STASH_GIT_USERNAME=... # Machine account username used to clone repositories
: Bibucket Server oauth1 private key as a string
`WOODPECKER_STASH_GIT_USERNAME` WOODPECKER_STASH_GIT_PASSWORD=... # Machine account password used to clone repositories
: Machine account username used to clone repositories. ```
`WOODPECKER_STASH_GIT_PASSWORD`
: Machine account password used to clone repositories.

View file

@ -7,15 +7,14 @@ The default database engine of Woodpecker is an embedded SQLite database which r
By default Woodpecker uses a sqlite database stored under `/var/lib/drone/`. You can mount a [data volume](https://docs.docker.com/storage/volumes/#create-and-manage-volumes) to persist the sqlite database. By default Woodpecker uses a sqlite database stored under `/var/lib/drone/`. You can mount a [data volume](https://docs.docker.com/storage/volumes/#create-and-manage-volumes) to persist the sqlite database.
```diff ```diff
# docker-compose.yml
version: '3'
services: services:
woodpecker-server: woodpecker-server:
image: woodpeckerci/woodpecker-server:latest [...]
ports:
- 80:8000
- 9000
+ volumes: + volumes:
+ - woodpecker-server-data:/var/lib/drone/ + - woodpecker-server-data:/var/lib/drone/
restart: always
``` ```
## Configure MySQL ## Configure MySQL
@ -23,11 +22,12 @@ services:
The below example demonstrates mysql database configuration. See the official driver [documentation](https://github.com/go-sql-driver/mysql#dsn-data-source-name) for configuration options and examples. The below example demonstrates mysql database configuration. See the official driver [documentation](https://github.com/go-sql-driver/mysql#dsn-data-source-name) for configuration options and examples.
```diff ```diff
# docker-compose.yml
version: '3' version: '3'
services: services:
woodpecker-server: woodpecker-server:
image: woodpeckerci/woodpecker-server:latest [...]
environment: environment:
+ WOODPECKER_DATABASE_DRIVER: mysql + WOODPECKER_DATABASE_DRIVER: mysql
+ WOODPECKER_DATABASE_DATASOURCE: root:password@tcp(1.2.3.4:3306)/woodpecker?parseTime=true + WOODPECKER_DATABASE_DATASOURCE: root:password@tcp(1.2.3.4:3306)/woodpecker?parseTime=true
@ -38,11 +38,12 @@ services:
The below example demonstrates postgres database configuration. See the official driver [documentation](https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING) for configuration options and examples. The below example demonstrates postgres database configuration. See the official driver [documentation](https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING) for configuration options and examples.
```diff ```diff
# docker-compose.yml
version: '3' version: '3'
services: services:
woodpecker-server: woodpecker-server:
image: woodpeckerci/woodpecker-server:latest [...]
environment: environment:
+ WOODPECKER_DATABASE_DRIVER: postgres + WOODPECKER_DATABASE_DRIVER: postgres
+ WOODPECKER_DATABASE_DATASOURCE: postgres://root:password@1.2.3.4:5432/postgres?sslmode=disable + WOODPECKER_DATABASE_DATASOURCE: postgres://root:password@1.2.3.4:5432/postgres?sslmode=disable

View file

@ -11,23 +11,18 @@ Woodpecker supports automated SSL configuration and updates using Let's Encrypt.
You can enable Let's Encrypt by making the following modifications to your server configuration: You can enable Let's Encrypt by making the following modifications to your server configuration:
```diff ```diff
# docker-compose.yml
version: '3'
services: services:
woodpecker-server: woodpecker-server:
image: woodpeckerci/woodpecker-server:latest [...]
ports: ports:
+ - 80:80 + - 80:80
+ - 443:443 + - 443:443
- 9000:9000 - 9000:9000
volumes:
- /var/lib/drone:/var/lib/drone/
restart: always
environment: environment:
- WOODPECKER_OPEN=true - [...]
- WOODPECKER_HOST=${WOODPECKER_HOST}
- WOODPECKER_GITHUB=true
- WOODPECKER_GITHUB_CLIENT=${WOODPECKER_GITHUB_CLIENT}
- WOODPECKER_GITHUB_SECRET=${WOODPECKER_GITHUB_SECRET}
- WOODPECKER_SECRET=${WOODPECKER_SECRET}
+ - WOODPECKER_LETS_ENCRYPT=true + - WOODPECKER_LETS_ENCRYPT=true
``` ```
@ -52,19 +47,21 @@ Woodpecker uses the official Go acme library which will handle certificate upgra
Woodpecker supports ssl configuration by mounting certificates into your container. Woodpecker supports ssl configuration by mounting certificates into your container.
```diff ```diff
# docker-compose.yml
version: '3'
services: services:
woodpecker-server: woodpecker-server:
image: woodpeckerci/woodpecker-server:latest [...]
ports: ports:
+ - 80:80 + - 80:80
+ - 443:443 + - 443:443
- 9000:9000 - 9000:9000
volumes: volumes:
- /var/lib/drone:/var/lib/drone/
+ - /etc/certs/woodpecker.foo.com/server.crt:/etc/certs/woodpecker.foo.com/server.crt + - /etc/certs/woodpecker.foo.com/server.crt:/etc/certs/woodpecker.foo.com/server.crt
+ - /etc/certs/woodpecker.foo.com/server.key:/etc/certs/woodpecker.foo.com/server.key + - /etc/certs/woodpecker.foo.com/server.key:/etc/certs/woodpecker.foo.com/server.key
restart: always
environment: environment:
- [...]
+ - WOODPECKER_SERVER_CERT=/etc/certs/woodpecker.foo.com/server.crt + - WOODPECKER_SERVER_CERT=/etc/certs/woodpecker.foo.com/server.crt
+ - WOODPECKER_SERVER_KEY=/etc/certs/woodpecker.foo.com/server.key + - WOODPECKER_SERVER_KEY=/etc/certs/woodpecker.foo.com/server.key
``` ```
@ -72,9 +69,12 @@ services:
Update your configuration to expose the following ports: Update your configuration to expose the following ports:
```diff ```diff
# docker-compose.yml
version: '3'
services: services:
woodpecker-server: woodpecker-server:
image: woodpeckerci/woodpecker-server:latest [...]
ports: ports:
+ - 80:80 + - 80:80
+ - 443:443 + - 443:443
@ -84,15 +84,17 @@ services:
Update your configuration to mount your certificate and key: Update your configuration to mount your certificate and key:
```diff ```diff
# docker-compose.yml
version: '3'
services: services:
woodpecker-server: woodpecker-server:
image: woodpeckerci/woodpecker-server:latest [...]
ports: ports:
- 80:80 - 80:80
- 443:443 - 443:443
- 9000:9000 - 9000:9000
volumes: volumes:
- /var/lib/drone:/var/lib/drone/
+ - /etc/certs/woodpecker.foo.com/server.crt:/etc/certs/woodpecker.foo.com/server.crt + - /etc/certs/woodpecker.foo.com/server.crt:/etc/certs/woodpecker.foo.com/server.crt
+ - /etc/certs/woodpecker.foo.com/server.key:/etc/certs/woodpecker.foo.com/server.key + - /etc/certs/woodpecker.foo.com/server.key:/etc/certs/woodpecker.foo.com/server.key
``` ```
@ -100,18 +102,19 @@ services:
Update your configuration to provide the paths of your certificate and key: Update your configuration to provide the paths of your certificate and key:
```diff ```diff
# docker-compose.yml
version: '3'
services: services:
woodpecker-server: woodpecker-server:
image: woodpeckerci/woodpecker-server:latest [...]
ports: ports:
- 80:80 - 80:80
- 443:443 - 443:443
- 9000:9000 - 9000:9000
volumes: volumes:
- /var/lib/drone:/var/lib/drone/
- /etc/certs/woodpecker.foo.com/server.crt:/etc/certs/woodpecker.foo.com/server.crt - /etc/certs/woodpecker.foo.com/server.crt:/etc/certs/woodpecker.foo.com/server.crt
- /etc/certs/woodpecker.foo.com/server.key:/etc/certs/woodpecker.foo.com/server.key - /etc/certs/woodpecker.foo.com/server.key:/etc/certs/woodpecker.foo.com/server.key
restart: always
environment: environment:
+ - WOODPECKER_SERVER_CERT=/etc/certs/woodpecker.foo.com/server.crt + - WOODPECKER_SERVER_CERT=/etc/certs/woodpecker.foo.com/server.crt
+ - WOODPECKER_SERVER_KEY=/etc/certs/woodpecker.foo.com/server.key + - WOODPECKER_SERVER_KEY=/etc/certs/woodpecker.foo.com/server.key