Add prettier to docs/ (#4628)

This commit is contained in:
Patrick Schratz 2024-12-28 15:36:23 +01:00 committed by GitHub
parent bf751199c3
commit 3663993dcb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
46 changed files with 365 additions and 187 deletions

View file

@ -1,10 +1,8 @@
build/
docs/versioned_docs/
docs/.docusaurus/
docs/pnpm-lock.yaml
dist/
CHANGELOG.md
# web/ must be directly formatted from there
# web/ and docs/ must be directly formatted from there
# to prevent conflicts with different prettier version
web/
docs/

View file

@ -37,10 +37,17 @@ when:
evaluate: 'TASK == "docs"'
steps:
prettier:
image: docker.io/woodpeckerci/plugin-prettier:1.0.0
depends_on: []
settings:
version: 3.3.3
build-cli:
image: *golang_image
commands:
- make docs
depends_on: prettier
when:
- path: *when_path
event: [tag, pull_request, push]
@ -53,6 +60,9 @@ steps:
- corepack enable
- pnpm install --frozen-lockfile
- pnpm build
depends_on:
- prettier
- build-cli
when:
- path: *when_path
event: [tag, pull_request, push]
@ -67,6 +77,9 @@ steps:
forge_repo_token:
from_secret: GITHUB_TOKEN_SURGE
failure: ignore
depends_on:
- prettier
- build
when:
event: [pull_request, pull_request_closed]
path: *when_path
@ -83,6 +96,9 @@ steps:
- echo "$BOT_PRIVATE_KEY" > $HOME/.ssh/id_rsa
- chmod 0600 $HOME/.ssh/id_rsa
- git clone --depth 1 --single-branch git@github.com:woodpecker-ci/woodpecker-ci.github.io.git ./docs_repo
depends_on:
- prettier
- build
when:
- event: push
path:
@ -98,6 +114,9 @@ steps:
- apk add jq
- jq '.next = "next-${CI_COMMIT_SHA:0:10}"' ./docs_repo/version.json > ./docs_repo/version.json.tmp
- mv ./docs_repo/version.json.tmp ./docs_repo/version.json
depends_on:
- prettier
- deploy-prepare
when:
- event: push
path: *docker_path
@ -110,6 +129,9 @@ steps:
- if [[ "${CI_COMMIT_TAG}" != *"rc"* ]] ; then jq '.latest = "${CI_COMMIT_TAG}"' ./docs_repo/version.json > ./docs_repo/version.json.tmp && mv ./docs_repo/version.json.tmp ./docs_repo/version.json ; fi
- jq '.rc = "${CI_COMMIT_TAG}"' ./docs_repo/version.json > ./docs_repo/version.json.tmp
- mv ./docs_repo/version.json.tmp ./docs_repo/version.json
depends_on:
- prettier
- deploy-prepare
when:
- event: tag
@ -119,6 +141,8 @@ steps:
- apk add rsync
# copy all docs files and delete all old ones, but leave CNAME, index.yaml and version.json untouched
- rsync -r --exclude .git --exclude CNAME --exclude index.yaml --exclude README.md --exclude version.json --delete docs/build/ ./docs_repo
depends_on:
- prettier
when:
- event: push
path: *when_path
@ -144,6 +168,9 @@ steps:
- test -n "$(git status --porcelain)" || exit 0
- git commit -m "Deploy website - based on ${CI_COMMIT_SHA}"
- git push
depends_on:
- prettier
- copy-files
when:
- event: push
path:

7
docs/.prettierignore Normal file
View file

@ -0,0 +1,7 @@
pnpm-lock.yaml
dist
coverage/
LICENSE
components.d.ts
src/assets/locales/*.json
!src/assets/locales/en.json

16
docs/.prettierrc.js Normal file
View file

@ -0,0 +1,16 @@
import { readFile } from 'node:fs/promises';
// eslint-disable-next-line antfu/no-top-level-await
const config = JSON.parse(await readFile(new URL('../.prettierrc.json', import.meta.url)));
export default {
...config,
plugins: ['@ianvs/prettier-plugin-sort-imports'],
importOrder: [
'<THIRD_PARTY_MODULES>', // Imports not matched by other special words or groups.
'', // Empty string will match any import not matched by other special words or groups.
'^(#|@|~|\\$)(/.*)$',
'',
'^[./]',
],
};

View file

@ -1,7 +1,7 @@
import { themes } from 'prism-react-renderer';
import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import * as path from 'path';
import type * as Preset from '@docusaurus/preset-classic';
import type { Config } from '@docusaurus/types';
import { themes } from 'prism-react-renderer';
const config = {
title: 'Woodpecker CI',

View file

@ -1,9 +1,10 @@
import { LoadContext, Plugin, PluginContentLoadedActions } from '@docusaurus/types';
import path from 'path';
import fs from 'fs';
import path from 'path';
import { LoadContext, Plugin, PluginContentLoadedActions } from '@docusaurus/types';
import axios, { AxiosError } from 'axios';
import { Content, WoodpeckerPlugin, WoodpeckerPluginHeader, WoodpeckerPluginIndexEntry } from './types';
import * as markdown from './markdown';
import { Content, WoodpeckerPlugin, WoodpeckerPluginHeader, WoodpeckerPluginIndexEntry } from './types';
async function loadContent(): Promise<Content> {
const file = path.join(__dirname, '..', 'plugins.json');

View file

@ -1,5 +1,6 @@
import React from 'react';
import Layout from '@theme/Layout';
import React from 'react';
import { WoodpeckerPlugin as WoodpeckerPluginType } from '../types';
import { IconContainer, IconPlugin, IconVerified, IconWebsite } from './Icons';

View file

@ -1,7 +1,9 @@
import React, { useState, useRef } from 'react';
import Fuse from 'fuse.js';
import Layout from '@theme/Layout';
import Fuse from 'fuse.js';
import React, { useRef, useState } from 'react';
import './style.css';
import { WoodpeckerPlugin } from '../types';
import { IconPlugin, IconVerified } from './Icons';

View file

@ -57,8 +57,8 @@
padding: 1rem 1rem 1rem 2.25rem;
font-size: 1.1rem;
appearance: none;
background: var(--ifm-navbar-search-input-background-color) var(--ifm-navbar-search-input-icon) no-repeat 0.75rem 1rem /
1.1rem 1.1rem;
background: var(--ifm-navbar-search-input-background-color) var(--ifm-navbar-search-input-icon) no-repeat 0.75rem
1rem / 1.1rem 1.1rem;
border-radius: 0.5rem;
border: 1px solid var(--ifm-card-background-color);
color: var(--ifm-navbar-search-input-color);

View file

@ -1,5 +1,6 @@
import React from 'react';
import clsx from 'clsx';
import React from 'react';
import styles from './HomepageFeatures.module.css';
const FeatureList = [

View file

@ -1,10 +1,11 @@
import React from 'react';
import clsx from 'clsx';
import Layout from '@theme/Layout';
import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import styles from './index.module.css';
import Layout from '@theme/Layout';
import clsx from 'clsx';
import React from 'react';
import HomepageFeatures from '../components/HomepageFeatures';
import styles from './index.module.css';
function HomepageHeader() {
const { siteConfig } = useDocusaurusContext();

View file

@ -10,7 +10,7 @@ Webhooks are used to trigger pipeline executions. When you push code to your rep
> Required Permissions
>
>The user who enables a repo in Woodpecker must have `Admin` rights on that repo, so that Woodpecker can add the webhook.
> The user who enables a repo in Woodpecker must have `Admin` rights on that repo, so that Woodpecker can add the webhook.
>
> Note that manually creating webhooks yourself is not possible. This is because webhooks are signed using a per-repository secret key which is not exposed to end users.

View file

@ -32,11 +32,11 @@ Sometimes there exist multiple terms that can be used for a thing, we try to def
- **Pipelines** were previously called **builds**
- **Steps** were previously called **jobs**
[Pipeline]: ./20-pipeline-syntax.md
[Workflow]: ./25-workflows.md
[Forge]: ../30-administration/11-forges/10-overview.md
[Plugin]: ./51-plugins/10-plugins.md
[Pipeline]: ./20-pipeline-syntax.md
[Workflow]: ./25-workflows.md
[Forge]: ../30-administration/11-forges/10-overview.md
[Plugin]: ./51-plugins/10-plugins.md
[Workspace]: ./20-pipeline-syntax.md#workspace
[Matrix]: ./30-matrix-workflows.md
[Docker]: ../30-administration/22-backends/10-docker.md
[Local]: ../30-administration/22-backends/20-local.md
[Matrix]: ./30-matrix-workflows.md
[Docker]: ../30-administration/22-backends/10-docker.md
[Local]: ../30-administration/22-backends/20-local.md

View file

@ -297,8 +297,8 @@ Execute a step using custom include and exclude logic:
```yaml
when:
- branch:
include: [ master, release/* ]
exclude: [ release/1.0.0, release/1.1.* ]
include: [master, release/*]
exclude: [release/1.0.0, release/1.1.*]
```
#### `event`
@ -383,7 +383,7 @@ Execute a step for a specific platform using wildcards:
```yaml
when:
- platform: [ linux/*, windows/amd64 ]
- platform: [linux/*, windows/amd64]
```
#### `environment`
@ -427,14 +427,14 @@ Execute a step only when certain files were changed:
```yaml
when:
- path: "src/*.js"
- path: 'src/*.js'
```
One can also use [glob patterns](https://github.com/bmatcuk/doublestar#patterns):
```yaml
when:
- path: "src/**/*.js"
- path: 'src/**/*.js'
```
To match whether the files have been changed or not changed, use `include` or `exclude` respectively:
@ -442,9 +442,9 @@ To match whether the files have been changed or not changed, use `include` or `e
```yaml
when:
- path:
include: [ '.woodpecker/*.yml', '*.ini' ]
exclude: [ '*.md', 'docs/**' ]
ignore_message: "[ALL]"
include: ['.woodpecker/*.yml', '*.ini']
exclude: ['*.md', 'docs/**']
ignore_message: '[ALL]'
```
**Hint:** Passing a defined ignore-message like `[ALL]` inside the commit message will ignore all path conditions.

View file

@ -5,6 +5,7 @@
You can use [YAML anchors & aliases](https://yaml.org/spec/1.2.2/#3222-anchors-and-aliases) as variables in your pipeline config.
To convert this:
```yml
steps:
test:
@ -67,24 +68,24 @@ steps:
```yaml
variables:
pre_cmds: &pre_cmds
- echo start
- whoami
- echo start
- whoami
post_cmds: &post_cmds
- echo stop
- echo stop
hello_cmd: &hello_cmd
- echo hello
- echo hello
steps:
step1:
image: debian
commands:
- <<: *pre_cmds # prepend a sequence
- echo exec step now do dedicated things
- <<: *post_cmds # append a sequence
- <<: *pre_cmds # prepend a sequence
- echo exec step now do dedicated things
- <<: *post_cmds # append a sequence
step2:
image: debian
commands:
- <<: [*pre_cmds, *hello_cmd] # prepend two sequences
- echo echo from second step
- <<: *post_cmds
- <<: [*pre_cmds, *hello_cmd] # prepend two sequences
- echo echo from second step
- <<: *post_cmds
```

View file

@ -28,7 +28,6 @@ steps:
+ from_secret: secret_token
```
Please note parameter expressions are subject to pre-processing. When using secrets in parameter expressions they should be escaped.
```diff
@ -84,7 +83,7 @@ Please be careful when exposing secrets to pull requests. If your repository is
To prevent abusing your secrets with malicious pull requests, you can limit a secret to a list of images. They are not available to any other container. In addition, you can make the secret available only for plugins (steps without user-defined commands).
:::warning
If you enable the option "Only available for plugins", always set an image filter too. Otherwise, the secret can be accessed by a very simple self-developed plugin and is thus *not* safe.
If you enable the option "Only available for plugins", always set an image filter too. Otherwise, the secret can be accessed by a very simple self-developed plugin and is thus _not_ safe.
If you only set an image filter, you could still access the secret using the same image and by specifying a command that prints it.
:::

View file

@ -6,29 +6,29 @@ To configure cron jobs you need at least push access to the repository.
1. To create a new cron job adjust your pipeline config(s) and add the event filter to all steps you would like to run by the cron job:
```diff
steps:
sync_locales:
image: weblate_sync
settings:
url: example.com
token:
from_secret: weblate_token
+ when:
+ event: cron
+ cron: "name of the cron job" # if you only want to execute this step by a specific cron job
```
```diff
steps:
sync_locales:
image: weblate_sync
settings:
url: example.com
token:
from_secret: weblate_token
+ when:
+ event: cron
+ cron: "name of the cron job" # if you only want to execute this step by a specific cron job
```
1. Create a new cron job in the repository settings:
![cron settings](./cron-settings.png)
![cron settings](./cron-settings.png)
The supported schedule syntax can be found at <https://pkg.go.dev/github.com/robfig/cron?utm_source=godoc#hdr-CRON_Expression_Format>. If you need general understanding of the cron syntax <https://crontab.guru/> is a good place to start and experiment.
The supported schedule syntax can be found at <https://pkg.go.dev/github.com/robfig/cron?utm_source=godoc#hdr-CRON_Expression_Format>. If you need general understanding of the cron syntax <https://crontab.guru/> is a good place to start and experiment.
Examples: `@every 5m`, `@daily`, `0 30 * * * *` ...
Examples: `@every 5m`, `@daily`, `0 30 * * * *` ...
:::info
Woodpeckers cron syntax starts with seconds instead of minutes as used by most linux cron schedulers.
:::info
Woodpeckers cron syntax starts with seconds instead of minutes as used by most linux cron schedulers.
Example: "At minute 30 every hour" would be `0 30 * * * *` instead of `30 * * * *`
:::
Example: "At minute 30 every hour" would be `0 30 * * * *` instead of `30 * * * *`
:::

View file

@ -41,7 +41,7 @@ There are also other plugin lists with additional plugins. Keep in mind that [Dr
- [Drone Plugins](http://plugins.drone.io)
- [The Geek Lab Drone Plugins](https://drone-plugin-index.geekdocs.de/plugins/drone-matrix/)
:::
:::
## Creating a plugin

View file

@ -27,10 +27,10 @@ Another approach using YAML extensions:
```yml
variables:
- global_env: &global_env
- BASH_VERSION=1.2.3
- PATH_SRC=src/
- PATH_TEST=test/
- FOO=something
- BASH_VERSION=1.2.3
- PATH_SRC=src/
- PATH_TEST=test/
- FOO=something
steps:
build:
@ -57,8 +57,7 @@ One can create a file containing environment variables, and then source it in ea
steps:
init:
image: bash
commands:
echo "FOO=hello" >> envvars
commands: echo "FOO=hello" >> envvars
echo "BAR=world" >> envvars
debug:

View file

@ -22,7 +22,7 @@ Below are resources requirements for Woodpecker components itself:
| Component | Memory | CPU |
| --------- | ------ | --- |
| Server | 200 MB | 1 |
| Agent | 32 MB | 1 |
| Agent | 32 MB | 1 |
Note, that those values do not include the operating system or workload (pipelines execution) resources consumption.

View file

@ -154,17 +154,18 @@ WOODPECKER_CUSTOM_CSS_FILE=/usr/local/www/woodpecker.js
The examples below show how to place a banner message in the top navigation bar of Woodpecker.
##### woodpecker.css
```css
.banner-message {
position: absolute;
width: 280px;
height: 40px;
margin-left: 240px;
margin-top: 5px;
padding-top: 5px;
font-weight: bold;
background: red no-repeat;
text-align: center;
position: absolute;
width: 280px;
height: 40px;
margin-left: 240px;
margin-top: 5px;
padding-top: 5px;
font-weight: bold;
background: red no-repeat;
text-align: center;
}
```
@ -172,44 +173,52 @@ The examples below show how to place a banner message in the top navigation bar
```javascript
// place/copy a minified version of jQuery or ZeptoJS here ...
!function(){"use strict";function e(){};/*...*/}();
!(function () {
'use strict';
function e() {} /*...*/
})();
$().ready(function(){
$(".app nav img").first().htmlAfter("<div class='banner-message'>This is a demo banner message :)</div>")
$().ready(function () {
$('.app nav img').first().htmlAfter("<div class='banner-message'>This is a demo banner message :)</div>");
});
```
## All server configuration options
The following list describes all available server configuration options.
### `WOODPECKER_LOG_LEVEL`
> Default: empty
Configures the logging level. Possible values are `trace`, `debug`, `info`, `warn`, `error`, `fatal`, `panic`, `disabled` and empty.
### `WOODPECKER_LOG_XORM`
> Default: `false`
Enable XORM logs.
### `WOODPECKER_LOG_XORM_SQL`
> Default: `false`
Enable XORM SQL command logs.
### `WOODPECKER_DEBUG_PRETTY`
> Default: `false`
Enable pretty-printed debug output.
### `WOODPECKER_DEBUG_NOCOLOR`
> Default: `true`
Disable colored debug output.
### `WOODPECKER_HOST`
> Default: empty
Server fully qualified URL of the user-facing hostname.
@ -217,6 +226,7 @@ Server fully qualified URL of the user-facing hostname.
Example: `WOODPECKER_HOST=http://woodpecker.example.org`
### `WOODPECKER_WEBHOOK_HOST`
> Default: value from `WOODPECKER_HOST` config env
Server fully qualified URL of the Webhook-facing hostname.
@ -224,16 +234,19 @@ Server fully qualified URL of the Webhook-facing hostname.
Example: `WOODPECKER_WEBHOOK_HOST=http://woodpecker-server.cicd.svc.cluster.local:8000`
### `WOODPECKER_SERVER_ADDR`
> Default: `:8000`
Configures the HTTP listener port.
### `WOODPECKER_SERVER_ADDR_TLS`
> Default: `:443`
Configures the HTTPS listener port when SSL is enabled.
### `WOODPECKER_SERVER_CERT`
> Default: empty
Path to an SSL certificate used by the server to accept HTTPS requests.
@ -241,6 +254,7 @@ Path to an SSL certificate used by the server to accept HTTPS requests.
Example: `WOODPECKER_SERVER_CERT=/path/to/cert.pem`
### `WOODPECKER_SERVER_KEY`
> Default: empty
Path to an SSL certificate key used by the server to accept HTTPS requests.
@ -248,6 +262,7 @@ Path to an SSL certificate key used by the server to accept HTTPS requests.
Example: `WOODPECKER_SERVER_KEY=/path/to/key.pem`
### `WOODPECKER_CUSTOM_CSS_FILE`
> Default: empty
File path for the server to serve a custom .CSS file, used for customizing the UI.
@ -257,6 +272,7 @@ The file must be UTF-8 encoded, to ensure all special characters are preserved.
Example: `WOODPECKER_CUSTOM_CSS_FILE=/usr/local/www/woodpecker.css`
### `WOODPECKER_CUSTOM_JS_FILE`
> Default: empty
File path for the server to serve a custom .JS file, used for customizing the UI.
@ -266,26 +282,31 @@ The file must be UTF-8 encoded, to ensure all special characters are preserved.
Example: `WOODPECKER_CUSTOM_JS_FILE=/usr/local/www/woodpecker.js`
### `WOODPECKER_LETS_ENCRYPT`
> Default: `false`
Automatically generates an SSL certificate using Let's Encrypt, and configures the server to accept HTTPS requests.
### `WOODPECKER_GRPC_ADDR`
> Default: `:9000`
Configures the gRPC listener port.
### `WOODPECKER_GRPC_SECRET`
> Default: `secret`
Configures the gRPC JWT secret.
### `WOODPECKER_GRPC_SECRET_FILE`
> Default: empty
Read the value for `WOODPECKER_GRPC_SECRET` from the specified filepath.
### `WOODPECKER_METRICS_SERVER_ADDR`
> Default: empty
Configures an unprotected metrics endpoint. An empty value disables the metrics endpoint completely.
@ -293,6 +314,7 @@ Configures an unprotected metrics endpoint. An empty value disables the metrics
Example: `:9001`
### `WOODPECKER_ADMIN`
> Default: empty
Comma-separated list of admin accounts.
@ -300,6 +322,7 @@ Comma-separated list of admin accounts.
Example: `WOODPECKER_ADMIN=user1,user2`
### `WOODPECKER_ORGS`
> Default: empty
Comma-separated list of approved organizations.
@ -307,6 +330,7 @@ Comma-separated list of approved organizations.
Example: `org1,org2`
### `WOODPECKER_REPO_OWNERS`
> Default: empty
Comma-separated list of syncable repo owners. ???
@ -314,41 +338,49 @@ Comma-separated list of syncable repo owners. ???
Example: `user1,user2`
### `WOODPECKER_OPEN`
> Default: `false`
Enable to allow user registration.
### `WOODPECKER_DOCS`
> Default: `https://woodpecker-ci.org/`
Link to documentation in the UI.
### `WOODPECKER_AUTHENTICATE_PUBLIC_REPOS`
> Default: `false`
Always use authentication to clone repositories even if they are public. Needed if the forge requires to always authenticate as used by many companies.
### `WOODPECKER_DEFAULT_CANCEL_PREVIOUS_PIPELINE_EVENTS`
> Default: `pull_request, push`
List of event names that will be canceled when a new pipeline for the same context (tag, branch) is created.
### `WOODPECKER_DEFAULT_CLONE_IMAGE`
> Default is defined in [shared/constant/constant.go](https://github.com/woodpecker-ci/woodpecker/blob/master/shared/constant/constant.go)
The default docker image to be used when cloning the repo
### `WOODPECKER_DEFAULT_PIPELINE_TIMEOUT`
> 60 (minutes)
The default time for a repo in minutes before a pipeline gets killed
### `WOODPECKER_MAX_PIPELINE_TIMEOUT`
> 120 (minutes)
The maximum time in minutes you can set in the repo settings before a pipeline gets killed
### `WOODPECKER_SESSION_EXPIRES`
> Default: `72h`
Configures the session expiration time.
@ -357,6 +389,7 @@ As long as the session is valid (until it expires or log-out),
a user can log into Woodpecker, without re-authentication.
### `WOODPECKER_ESCALATE`
> Defaults are defined in [shared/constant/constant.go](https://github.com/woodpecker-ci/woodpecker/blob/master/shared/constant/constant.go)
Docker images to run in privileged mode. Only change if you are sure what you do!
@ -371,6 +404,7 @@ Example: `WOODPECKER_VOLUME=/path/on/host:/path/in/container:rw`|
-->
### `WOODPECKER_DOCKER_CONFIG`
> Default: empty
Configures a specific private registry config for all pipelines.
@ -392,16 +426,19 @@ Example: `WOODPECKER_NETWORK=network1,network2`
-->
### `WOODPECKER_AGENT_SECRET`
> Default: empty
A shared secret used by server and agents to authenticate communication. A secret can be generated by `openssl rand -hex 32`.
### `WOODPECKER_AGENT_SECRET_FILE`
> Default: empty
Read the value for `WOODPECKER_AGENT_SECRET` from the specified filepath
### `WOODPECKER_KEEPALIVE_MIN_TIME`
> Default: empty
Server-side enforcement policy on the minimum amount of time a client should wait before sending a keepalive ping.
@ -409,16 +446,19 @@ Server-side enforcement policy on the minimum amount of time a client should wai
Example: `WOODPECKER_KEEPALIVE_MIN_TIME=10s`
### `WOODPECKER_DATABASE_DRIVER`
> Default: `sqlite3`
The database driver name. Possible values are `sqlite3`, `mysql` or `postgres`.
### `WOODPECKER_DATABASE_DATASOURCE`
> Default: `woodpecker.sqlite`
The database connection string. The default value is the path of the embedded SQLite database file.
Example:
```bash
# MySQL
# https://github.com/go-sql-driver/mysql#dsn-data-source-name
@ -430,47 +470,56 @@ WOODPECKER_DATABASE_DATASOURCE=postgres://root:password@1.2.3.4:5432/woodpecker?
```
### `WOODPECKER_DATABASE_DATASOURCE_FILE`
> Default: empty
Read the value for `WOODPECKER_DATABASE_DATASOURCE` from the specified filepath
### `WOODPECKER_ENCRYPTION_KEY`
> Default: empty
Encryption key used to encrypt secrets in DB. See [secrets encryption](./40-encryption.md)
### `WOODPECKER_ENCRYPTION_KEY_FILE`
> Default: empty
Read the value for `WOODPECKER_ENCRYPTION_KEY` from the specified filepath
### `WOODPECKER_ENCRYPTION_TINK_KEYSET_FILE`
> Default: empty
Filepath to encryption keyset used to encrypt secrets in DB. See [secrets encryption](./40-encryption.md)
### `WOODPECKER_ENCRYPTION_DISABLE`
> Default: empty
Boolean flag to decrypt secrets in DB and disable server encryption. See [secrets encryption](./40-encryption.md)
### `WOODPECKER_PROMETHEUS_AUTH_TOKEN`
> Default: empty
Token to secure the Prometheus metrics endpoint.
Must be set to enable the endpoint.
### `WOODPECKER_PROMETHEUS_AUTH_TOKEN_FILE`
> Default: empty
Read the value for `WOODPECKER_PROMETHEUS_AUTH_TOKEN` from the specified filepath
### `WOODPECKER_STATUS_CONTEXT`
> Default: `ci/woodpecker`
Context prefix Woodpecker will use to publish status messages to SCM. You probably will only need to change it if you run multiple Woodpecker instances for a single repository.
### `WOODPECKER_STATUS_CONTEXT_FORMAT`
> Default: `{{ .context }}/{{ .event }}/{{ .workflow }}`
Template for the status messages published to forges, uses [Go templates](https://pkg.go.dev/text/template) as template language.
@ -485,50 +534,57 @@ Supported variables:
---
### `WOODPECKER_LIMIT_MEM_SWAP`
> Default: `0`
The maximum amount of memory a single pipeline container is allowed to swap to disk, configured in bytes. There is no limit if `0`.
### `WOODPECKER_LIMIT_MEM`
> Default: `0`
The maximum amount of memory a single pipeline container can use, configured in bytes. There is no limit if `0`.
### `WOODPECKER_LIMIT_SHM_SIZE`
> Default: `0`
The maximum amount of memory of `/dev/shm` allowed in bytes. There is no limit if `0`.
### `WOODPECKER_LIMIT_CPU_QUOTA`
> Default: `0`
The number of microseconds per CPU period that the container is limited to before throttled. There is no limit if `0`.
### `WOODPECKER_LIMIT_CPU_SHARES`
> Default: `0`
The relative weight vs. other containers.
### `WOODPECKER_LIMIT_CPU_SET`
> Default: empty
Comma-separated list to limit the specific CPUs or cores a pipeline container can use.
Example: `WOODPECKER_LIMIT_CPU_SET=1,2`
### `WOODPECKER_CONFIG_SERVICE_ENDPOINT`
> Default: ``
Specify a configuration service endpoint, see [Configuration Extension](./100-external-configuration-api.md)
### `WOODPECKER_FORGE_TIMEOUT`
> Default: 3sec
Specify how many seconds before timeout when fetching the Woodpecker configuration from a Forge
### `WOODPECKER_ROOT_URL`
> Default: ``
Server URL path prefix (used for statics loading when having a url path prefix), should start with `/`

View file

@ -52,9 +52,7 @@ WOODPECKER_CONFIG_SERVICE_ENDPOINT=https://example.com/ciconfig
"author_avatar": "https://myforge.com/avatars/d6b3f7787a685fcdf2a44e2c685c7e03",
"author_email": "my@email.com",
"branch": "master",
"changed_files": [
"somefilename.txt"
],
"changed_files": ["somefilename.txt"],
"commit": "2fff90f8d288a4640e90f05049fe30e61a14fd50",
"created_at": 0,
"deploy_to": "",

View file

@ -2,13 +2,13 @@
## Supported features
| Feature | [GitHub](github/) | [Gitea / Forgejo](gitea/) | [Gitlab](gitlab/) | [Bitbucket](bitbucket/) |
| --- | :---: | :---: | :---: | :---: |
| Event: Push | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Event: Tag | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Event: Pull-Request | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Event: Deploy | :white_check_mark: | :x: | :x: | :x: |
| [Multiple workflows](../../20-usage/25-workflows.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: |
| [when.path filter](../../20-usage/20-pipeline-syntax.md#path) | :white_check_mark: | :white_check_mark:¹ | :white_check_mark: | :x: |
| Feature | [GitHub](github/) | [Gitea / Forgejo](gitea/) | [Gitlab](gitlab/) | [Bitbucket](bitbucket/) |
| ------------------------------------------------------------- | :----------------: | :-----------------------: | :----------------: | :---------------------: |
| Event: Push | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Event: Tag | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Event: Pull-Request | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Event: Deploy | :white_check_mark: | :x: | :x: | :x: |
| [Multiple workflows](../../20-usage/25-workflows.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: |
| [when.path filter](../../20-usage/20-pipeline-syntax.md#path) | :white_check_mark: | :white_check_mark:¹ | :white_check_mark: | :x: |
¹ for pull requests at least Gitea version 1.17 is required

View file

@ -32,41 +32,49 @@ 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.
### `WOODPECKER_GITHUB`
> Default: `false`
Enables the GitHub driver.
### `WOODPECKER_GITHUB_URL`
> Default: `https://github.com`
Configures the GitHub server address.
### `WOODPECKER_GITHUB_CLIENT`
> Default: empty
Configures the GitHub OAuth client id. This is used to authorize access.
### `WOODPECKER_GITHUB_CLIENT_FILE`
> Default: empty
Read the value for `WOODPECKER_GITHUB_CLIENT` from the specified filepath
### `WOODPECKER_GITHUB_SECRET`
> Default: empty
Configures the GitHub OAuth client secret. This is used to authorize access.
### `WOODPECKER_GITHUB_SECRET_FILE`
> Default: empty
Read the value for `WOODPECKER_GITHUB_SECRET` from the specified filepath
### `WOODPECKER_GITHUB_MERGE_REF`
> Default: `true`
TODO
### `WOODPECKER_GITHUB_SKIP_VERIFY`
> Default: `false`
Configure if SSL verification should be skipped.

View file

@ -25,51 +25,59 @@ services:
Register your application with Gitea to create your client id and secret. You can find the OAuth applications settings of Gitea at `https://gitea.<host>/user/settings/`. It is very import the authorization callback URL matches your http(s) scheme and hostname exactly with `https://<host>/authorize` as the path.
If you run the Woodpecker CI server on the same host as the Gitea instance, you might also need to allow local connections in Gitea, since version `v1.16`. Otherwise webhooks will fail. Add the following lines to your Gitea configuration (usually at `/etc/gitea/conf/app.ini`).
```ini
...
[webhook]
ALLOWED_HOST_LIST=external,loopback
```
For reference see [Configuration Cheat Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/#webhook-webhook).
![gitea oauth setup](gitea_oauth.gif)
## 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_GITEA`
> Default: `false`
Enables the Gitea driver.
### `WOODPECKER_GITEA_URL`
> Default: `https://try.gitea.io`
Configures the Gitea server address.
### `WOODPECKER_GITEA_CLIENT`
> Default: empty
Configures the Gitea OAuth client id. This is used to authorize access.
### `WOODPECKER_GITEA_CLIENT_FILE`
> Default: empty
Read the value for `WOODPECKER_GITEA_CLIENT` from the specified filepath
### `WOODPECKER_GITEA_SECRET`
> Default: empty
Configures the Gitea OAuth client secret. This is used to authorize access.
### `WOODPECKER_GITEA_SECRET_FILE`
> Default: empty
Read the value for `WOODPECKER_GITEA_SECRET` from the specified filepath
### `WOODPECKER_GITEA_SKIP_VERIFY`
> Default: `false`
Configure if SSL verification should be skipped.

View file

@ -32,36 +32,43 @@ If you run the Woodpecker CI server on the same host as the GitLab instance, you
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`
> Default: `false`
Enables the GitLab driver.
### `WOODPECKER_GITLAB_URL`
> Default: `https://gitlab.com`
Configures the GitLab server address.
### `WOODPECKER_GITLAB_CLIENT`
> Default: empty
Configures the GitLab OAuth client id. This is used to authorize access.
### `WOODPECKER_GITLAB_CLIENT_FILE`
> Default: empty
Read the value for `WOODPECKER_GITLAB_CLIENT` from the specified filepath
### `WOODPECKER_GITLAB_SECRET`
> Default: empty
Configures the GitLab OAuth client secret. This is used to authorize access.
### `WOODPECKER_GITLAB_SECRET_FILE`
> Default: empty
Read the value for `WOODPECKER_GITLAB_SECRET` from the specified filepath
### `WOODPECKER_GITLAB_SKIP_VERIFY`
> Default: `false`
Configure if SSL verification should be skipped.

View file

@ -44,26 +44,31 @@ Webhooks:Read and Write
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`
> Default: `false`
Enables the Bitbucket driver.
### `WOODPECKER_BITBUCKET_CLIENT`
> Default: empty
Configures the Bitbucket OAuth client id. This is used to authorize access.
### `WOODPECKER_BITBUCKET_CLIENT_FILE`
> Default: empty
Read the value for `WOODPECKER_BITBUCKET_CLIENT` from the specified filepath
### `WOODPECKER_BITBUCKET_SECRET`
> Default: empty
Configures the Bitbucket OAuth client secret. This is used to authorize access.
### `WOODPECKER_BITBUCKET_SECRET_FILE`
> Default: empty
Read the value for `WOODPECKER_BITBUCKET_SECRET` from the specified filepath

View file

@ -62,12 +62,12 @@ _Agent token_ is a token that is used by only particular agent. This unique toke
In that case you probably doesn't configure `WOODPECKER_AGENT_SECRET` on the server side. The registration process would be as follows:
1. Administrator registers Agent manually in _Server settings - Agents - Add agent_;
![Agent creation](./new-agent-registration.png)
![Agent created](./new-agent-created.png)
![Agent creation](./new-agent-registration.png)
![Agent created](./new-agent-created.png)
2. The token generated in previous step have to be provided to Agent in `WOODPECKER_AGENT_SECRET`;
3. First time Agent communicates with Server using agent token;
4. Server identifies Agent by the token and fills additional information provided by Agent;
![Agent connected](./new-agent-connected.png)
![Agent connected](./new-agent-connected.png)
At following startups Agent uses own token only.
@ -76,91 +76,109 @@ At following startups Agent uses own token only.
Here is the full list of configuration options and their default variables.
### `WOODPECKER_SERVER`
> Default: `localhost:9000`
Configures gRPC address of the server.
### `WOODPECKER_USERNAME`
> Default: `x-oauth-basic`
The gRPC username.
### `WOODPECKER_AGENT_SECRET`
> Default: empty
A shared secret used by server and agents to authenticate communication. A secret can be generated by `openssl rand -hex 32`.
### `WOODPECKER_AGENT_SECRET_FILE`
> Default: empty
Read the value for `WOODPECKER_AGENT_SECRET` from the specified filepath, e.g. `/etc/woodpecker/agent-secret.conf`
### `WOODPECKER_LOG_LEVEL`
> Default: empty
Configures the logging level. Possible values are `trace`, `debug`, `info`, `warn`, `error`, `fatal`, `panic`, `disabled` and empty.
### `WOODPECKER_DEBUG_PRETTY`
> Default: `false`
Enable pretty-printed debug output.
### `WOODPECKER_DEBUG_NOCOLOR`
> Default: `true`
Disable colored debug output.
### `WOODPECKER_HOSTNAME`
> Default: empty
Configures the agent hostname.
### `WOODPECKER_AGENT_CONFIG_FILE`
> Default: `/etc/woodpecker/agent.conf`
Configures the path of the agent config file.
### `WOODPECKER_MAX_WORKFLOWS`
> Default: `1`
Configures the number of parallel workflows.
### `WOODPECKER_FILTER_LABELS`
> Default: empty
Configures labels to filter pipeline pick up. Use a list of key-value pairs like `key=value,second-key=*`. `*` can be used as a wildcard. By default agents provide three additional labels `platform=os/arch`, `hostname=my-agent` and `repo=*` which can be overwritten if needed. To learn how labels work check out the [pipeline syntax page](../20-usage/20-pipeline-syntax.md#labels).
### `WOODPECKER_HEALTHCHECK`
> Default: `true`
Enable healthcheck endpoint.
### `WOODPECKER_HEALTHCHECK_ADDR`
> Default: `:3000`
Configures healthcheck endpoint address.
### `WOODPECKER_KEEPALIVE_TIME`
> Default: empty
After a duration of this time of no activity, the agent pings the server to check if the transport is still alive.
### `WOODPECKER_KEEPALIVE_TIMEOUT`
> Default: `20s`
After pinging for a keepalive check, the agent waits for a duration of this time before closing the connection if no activity.
### `WOODPECKER_GRPC_SECURE`
> Default: `false`
Configures if the connection to `WOODPECKER_SERVER` should be made using a secure transport.
### `WOODPECKER_GRPC_VERIFY`
> Default: `true`
Configures if the gRPC server certificate should be verified, only valid when `WOODPECKER_GRPC_SECURE` is `true`.
### `WOODPECKER_BACKEND`
> Default: `auto-detect`
Configures the backend engine to run pipelines on. Possible values are `auto-detect`, `docker`, `local`, `ssh` or `kubernetes`.

View file

@ -5,16 +5,19 @@ This is the original backend used with Woodpecker. The docker backend executes e
## Configuration
### `WOODPECKER_BACKEND_DOCKER_NETWORK`
> Default: empty
Set to the name of an existing network which will be attached to all your pipeline containers (steps). Please be careful as this allows the containers of different pipelines to access each other!
### `WOODPECKER_BACKEND_DOCKER_ENABLE_IPV6`
> Default: `false`
Enable IPv6 for the networks used by pipeline containers (steps). Make sure you configured your docker daemon to support IPv6.
### `WOODPECKER_BACKEND_DOCKER_VOLUMES`
> Default: empty
List of default volumes separated by comma to be mounted to all pipeline containers (steps). For example to use custom CA

View file

@ -77,15 +77,13 @@ manual clone step.
The `image` entry is used to specify the shell, such as Bash or Fish, that is
used to run the commands.
```yaml
# .woodpecker.yml
steps:
build:
image: bash
commands:
[...]
commands: [...]
```
### Using labels to filter tasks
@ -111,6 +109,5 @@ only run on this agent:
labels:
type: exec
steps:
[...]
steps: [...]
```

View file

@ -16,26 +16,31 @@ The backend will use a random directory in $TMPDIR to store the clone code and e
## Configuration
### `WOODPECKER_BACKEND_SSH_ADDRESS`
> Default: empty
The SSH host to run steps with `ssh` backend.
### `WOODPECKER_BACKEND_SSH_USER`
> Default: empty
The SSH user to run steps with `ssh` backend.
### `WOODPECKER_BACKEND_SSH_KEY`
> Default: empty
Path to the private SSH key to run steps with `ssh` backend.
### `WOODPECKER_BACKEND_SSH_KEY_PASSWORD`
> Default: empty
The password for the private key to run steps with `ssh` backend.
### `WOODPECKER_BACKEND_SSH_PASSWORD`
> Default empty
The SSH password to run steps with `ssh` backend.

View file

@ -11,31 +11,37 @@ The kubernetes backend executes each step inside a newly created pod. A PVC is a
## Configuration
### `WOODPECKER_BACKEND_K8S_NAMESPACE`
> Default: `woodpecker`
The namespace to create worker pods in.
### `WOODPECKER_BACKEND_K8S_VOLUME_SIZE`
> Default: `10G`
The volume size of the pipeline volume.
### `WOODPECKER_BACKEND_K8S_STORAGE_CLASS`
> Default: empty
The storage class to use for the pipeline volume.
### `WOODPECKER_BACKEND_K8S_STORAGE_RWX`
> Default: `true`
Determines if `RWX` should be used for the pipeline volume's [access mode](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes). If false, `RWO` is used instead.
### `WOODPECKER_BACKEND_K8S_POD_LABELS`
> Default: empty
Additional labels to apply to worker pods. Must be a YAML object, e.g. `{"example.com/test-label":"test-value"}`.
### `WOODPECKER_BACKEND_K8S_POD_ANNOTATIONS`
> Default: empty
Additional annotations to apply to worker pods. Must be a YAML object, e.g. `{"example.com/test-annotation":"test-value"}`.
@ -59,6 +65,7 @@ By default the pod will use "kubernetes.io/arch" inferred from top-level "platfo
See the [kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) for more information on using nodeSelector.
Example pipeline configuration:
```yaml
steps:
build:

View file

@ -22,25 +22,31 @@ enabled encryption method, and `WOODPECKER_ENCRYPTION_DISABLE` set to true.
After secrets was decrypted server will proceed working in unencrypted mode. You will not need to use "disable encryption"
variable or encryption keys to start server anymore.
## AES
Simple AES encryption.
### Configuration
You can manage encryption on server using these environment variables:
- `WOODPECKER_ENCRYPTION_KEY` - encryption key
- `WOODPECKER_ENCRYPTION_KEY_FILE` - file to read encryption key from
- `WOODPECKER_ENCRYPTION_DISABLE` - disable encryption flag used to decrypt all data on server
## TINK
TINK uses AEAD encryption instead of simple AES and supports key rotation.
### Configuration
You can manage encryption on server using these two environment variables:
- `WOODPECKER_ENCRYPTION_TINK_KEYSET_FILE` - keyset filepath
- `WOODPECKER_ENCRYPTION_DISABLE` - disable encryption flag used to decrypt all data on server
### Encryption keys
You will need plaintext AEAD-compatible Google TINK keyset to encrypt your data.
To generate it and then rotate keys if needed, install `tinkey`([installation guide](https://developers.google.com/tink/install-tinkey))
@ -49,12 +55,15 @@ Keyset contains one or more keys, used to encrypt or decrypt your data, and prim
to use while encrypting new data.
Keyset generation example:
```shell
tinkey create-keyset --key-template AES256_GCM --out-format json --out keyset.json
```
### Key rotation
Use `tinkey` to rotate encryption keys in your existing keyset:
```shell
tinkey rotate-keyset --in keyset_v1.json --out keyset_v2.json --key-template AES256_GCM
```

View file

@ -108,7 +108,6 @@ ngrok http 8000
Set `WOODPECKER_HOST` (for example in `docker-compose.yml`) to the ngrok URL (usually xxx.ngrok.io) and start the server.
## Traefik
To install the Woodpecker server behind a [Traefik](https://traefik.io/) load balancer, you must expose both the `http` and the `gRPC` ports. Here is a comprehensive example, considering you are running Traefik with docker swarm and want to do TLS termination and automatic redirection from http to https.
@ -168,7 +167,6 @@ services:
- traefik.http.middlewares.woodpecker-grpc-redirect.redirectscheme.permanent=true
- traefik.http.routers.woodpecker-grpc.middlewares=woodpecker-grpc-redirect@docker
volumes:
woodpecker-server-data:
driver: local

View file

@ -11,7 +11,7 @@ scrape_configs:
bearer_token: dummyToken...
static_configs:
- targets: ['woodpecker.domain.com']
- targets: ['woodpecker.domain.com']
```
## Authorization

View file

@ -28,7 +28,6 @@ woodpecker-cli [GLOBAL OPTIONS] command [COMMAND OPTIONS] [ARGUMENTS...]
**--token, -t**="": server auth token
# COMMANDS
## pipeline, build
@ -338,19 +337,19 @@ execute a local pipeline
**--network**="": external networks
**--pipeline-created**="": (default: 0)
**--pipeline-created**="": (default: 0)
**--pipeline-event**="": (default: manual)
**--pipeline-event**="": (default: manual)
**--pipeline-finished**="": (default: 0)
**--pipeline-finished**="": (default: 0)
**--pipeline-link**="":
**--pipeline-number**="": (default: 0)
**--pipeline-number**="": (default: 0)
**--pipeline-parent**="": (default: 0)
**--pipeline-parent**="": (default: 0)
**--pipeline-started**="": (default: 0)
**--pipeline-started**="": (default: 0)
**--pipeline-status**="":
@ -372,17 +371,17 @@ execute a local pipeline
**--prev-commit-sha**="":
**--prev-pipeline-created**="": (default: 0)
**--prev-pipeline-created**="": (default: 0)
**--prev-pipeline-event**="":
**--prev-pipeline-finished**="": (default: 0)
**--prev-pipeline-finished**="": (default: 0)
**--prev-pipeline-link**="":
**--prev-pipeline-number**="": (default: 0)
**--prev-pipeline-number**="": (default: 0)
**--prev-pipeline-started**="": (default: 0)
**--prev-pipeline-started**="": (default: 0)
**--prev-pipeline-status**="":
@ -402,11 +401,11 @@ execute a local pipeline
**--server, -s**="": server address
**--step-name**="": (default: 0)
**--step-name**="": (default: 0)
**--system-link**="": (default: https://github.com/woodpecker-ci/woodpecker)
**--system-link**="": (default: https://github.com/woodpecker-ci/woodpecker)
**--system-name**="": (default: woodpecker)
**--system-name**="": (default: woodpecker)
**--system-platform**="":
@ -416,13 +415,13 @@ execute a local pipeline
**--volumes**="": pipeline volumes
**--workflow-name**="": (default: 0)
**--workflow-name**="": (default: 0)
**--workflow-number**="": (default: 0)
**--workflow-number**="": (default: 0)
**--workspace-base**="": (default: /woodpecker)
**--workspace-base**="": (default: /woodpecker)
**--workspace-path**="": (default: src)
**--workspace-path**="": (default: src)
## info

View file

@ -17,7 +17,7 @@ Image variants:
- The `vX.X` images are based on the current release branch (e.g. `release/v1.0`) and can be used to get bugfixes asap
- The `next` images are based on the current `main` branch and should not be used for production environments
``` bash
```bash
# server
docker pull woodpeckerci/woodpecker-server:latest
docker pull woodpeckerci/woodpecker-server:latest-alpine

View file

@ -19,7 +19,7 @@ No breaking changes
- Updated Prometheus gauge `build_*` to `pipeline_*`
- Updated Prometheus gauge `*_job_*` to `*_step_*`
- Renamed config env `WOODPECKER_MAX_PROCS` to `WOODPECKER_MAX_WORKFLOWS` (still available as fallback)
- The pipelines are now also read from `.yaml` files, the new default order is `.woodpecker/*.yml` and `.woodpecker/*.yaml` (without any prioritization) -> `.woodpecker.yml` -> `.woodpecker.yaml`
- The pipelines are now also read from `.yaml` files, the new default order is `.woodpecker/*.yml` and `.woodpecker/*.yaml` (without any prioritization) -> `.woodpecker.yml` -> `.woodpecker.yaml`
- Dropped support for [Coding](https://coding.net/), [Gogs](https://gogs.io) and Bitbucket Server (Stash).
- `/api/queue/resume` & `/api/queue/pause` endpoint methods were changed from `GET` to `POST`
- rename `pipeline:` key in your workflow config to `steps:`
@ -54,12 +54,14 @@ No breaking changes
- Dropped support for `DRONE_*` environment variables. The according `WOODPECKER_*` variables must be used instead.
Additionally some alternative namings have been removed to simplify maintenance:
- `WOODPECKER_AGENT_SECRET` replaces `WOODPECKER_SECRET`, `DRONE_SECRET`, `WOODPECKER_PASSWORD`, `DRONE_PASSWORD` and `DRONE_AGENT_SECRET`.
- `WOODPECKER_HOST` replaces `DRONE_HOST` and `DRONE_SERVER_HOST`.
- `WOODPECKER_DATABASE_DRIVER` replaces `DRONE_DATABASE_DRIVER` and `DATABASE_DRIVER`.
- `WOODPECKER_DATABASE_DATASOURCE` replaces `DRONE_DATABASE_DATASOURCE` and `DATABASE_CONFIG`.
- Dropped support for `DRONE_*` environment variables in pipeline steps. Pipeline meta-data can be accessed with `CI_*` variables.
- `CI_*` prefix replaces `DRONE_*`
- `CI` value is now `woodpecker`
- `DRONE=true` has been removed
@ -89,6 +91,7 @@ No breaking changes
- Default workspace base path has moved from `/drone` to `/woodpecker`
- Default SQLite database location has changed:
- `/var/lib/drone/drone.sqlite` -> `/var/lib/woodpecker/woodpecker.sqlite`
- `drone.sqlite` -> `woodpecker.sqlite`
@ -107,7 +110,7 @@ No breaking changes
- `WOODPECKER_DEBUG` option for server and agent got removed in favor of `WOODPECKER_LOG_LEVEL=debug`
- Remove unused server flags which can safely be removed from your server config: `WOODPECKER_QUIC`, `WOODPECKER_GITHUB_SCOPE`, `WOODPECKER_GITHUB_GIT_USERNAME`, `WOODPECKER_GITHUB_GIT_PASSWORD`, `WOODPECKER_GITHUB_PRIVATE_MODE`, `WOODPECKER_GITEA_GIT_USERNAME`, `WOODPECKER_GITEA_GIT_PASSWORD`, `WOODPECKER_GITEA_PRIVATE_MODE`, `WOODPECKER_GITLAB_GIT_USERNAME`, `WOODPECKER_GITLAB_GIT_PASSWORD`, `WOODPECKER_GITLAB_PRIVATE_MODE`
- Remove unused server flags which can safely be removed from your server config: `WOODPECKER_QUIC`, `WOODPECKER_GITHUB_SCOPE`, `WOODPECKER_GITHUB_GIT_USERNAME`, `WOODPECKER_GITHUB_GIT_PASSWORD`, `WOODPECKER_GITHUB_PRIVATE_MODE`, `WOODPECKER_GITEA_GIT_USERNAME`, `WOODPECKER_GITEA_GIT_PASSWORD`, `WOODPECKER_GITEA_PRIVATE_MODE`, `WOODPECKER_GITLAB_GIT_USERNAME`, `WOODPECKER_GITLAB_GIT_PASSWORD`, `WOODPECKER_GITLAB_PRIVATE_MODE`
- Dropped support for manually setting the agents platform with `WOODPECKER_PLATFORM`. The platform is now automatically detected.

View file

@ -27,9 +27,10 @@ Install Golang (>=1.20) as described by [this guide](https://go.dev/doc/install)
> GNU Make is a tool which controls the generation of executables and other non-source files of a program from the program's source files. (https://www.gnu.org/software/make/)
Install make on:
- Ubuntu: `apt install make` - [Docs](https://wiki.ubuntuusers.de/Makefile/)
- [Windows](https://stackoverflow.com/a/32127632/8461267)
- Mac OS: `brew install make`
- Ubuntu: `apt install make` - [Docs](https://wiki.ubuntuusers.de/Makefile/)
- [Windows](https://stackoverflow.com/a/32127632/8461267)
- Mac OS: `brew install make`
### Install Node.js & pnpm

View file

@ -3,6 +3,7 @@
To develop the UI you need to install [Node.js and pnpm](./01-getting-started.md#install-nodejs--pnpm). In addition it is recommended to use VS-Code with the recommended plugin selection to get features like auto-formatting, linting and typechecking. The UI is written with [Vue 3](https://v3.vuejs.org/) as Single-Page-Application accessing the Woodpecker REST api.
## Setup
The UI code is placed in `web/`. Change to that folder in your terminal with `cd web/` and install all dependencies by running `pnpm install`. For production builds the generated UI code is integrated into the Woodpecker server by using [go-embed](https://pkg.go.dev/embed).
Testing UI changes would require us to rebuild the UI after each adjustment to the code by running `pnpm build` and restarting the Woodpecker server. To avoid this you can make use of the dev-proxy integrated into the Woodpecker server. This integrated dev-proxy will forward all none api request to a separate http-server which will only serve the UI files.
@ -32,7 +33,7 @@ The following list contains some tools and frameworks used by the Woodpecker UI.
## Messages and Translations
Woodpecker uses [Vue I18n](https://vue-i18n.intlify.dev/) as translation library. New translations have to be added to `web/src/assets/locales/en.json`. The English source file will be automatically imported into [Weblate](https://translate.woodpecker-ci.org/) (the translation system used by Woodpecker) where all other languages will be translated by the community based on the English source.
Woodpecker uses [Vue I18n](https://vue-i18n.intlify.dev/) as translation library. New translations have to be added to `web/src/assets/locales/en.json`. The English source file will be automatically imported into [Weblate](https://translate.woodpecker-ci.org/) (the translation system used by Woodpecker) where all other languages will be translated by the community based on the English source.
You must not provide translations except English in PRs, otherwise weblate could put git into conflicts (when someone has translated in that language file and changes are not into master branch yet)
For more information about translations see [Translations](./07-translations.md).

View file

@ -8,36 +8,36 @@
### main package hierarchy
| package | meaning | imports
|------------|--------------------------------------------------------------|----------
| `cmd/**` | parse command-line args & environment to stat server/cli/agent | all other
| `agent/**` | code only agent (remote worker) will need | `pipeline`, `shared`
| `cli/**` | code only cli tool does need | `pipeline`, `shared`, `woodpecker-go`
| `server/**`| code only server will need | `pipeline`, `shared`
| `shared/**`| code shared for all three main tools (go help utils) | only std and external libs
| `woodpecker-go/**` | go client for server rest api | std
| package | meaning | imports |
| ------------------ | -------------------------------------------------------------- | ------------------------------------- |
| `cmd/**` | parse command-line args & environment to stat server/cli/agent | all other |
| `agent/**` | code only agent (remote worker) will need | `pipeline`, `shared` |
| `cli/**` | code only cli tool does need | `pipeline`, `shared`, `woodpecker-go` |
| `server/**` | code only server will need | `pipeline`, `shared` |
| `shared/**` | code shared for all three main tools (go help utils) | only std and external libs |
| `woodpecker-go/**` | go client for server rest api | std |
### Server
| package | meaning | imports
|----------------------|-------------------------------------------------------------------------------------|----------
| `server/api/**` | handle web requests from `server/router` | `pipeline`, `../badges`, `../ccmenue`, `../logging`, `../model`, `../pubsub`, `../queue`, `../forge`, `../shared`, `../store`, `shared`, (TODO: mv `server/router/middleware/session`)
| `server/badges/**` | generate svg badges for pipelines | `../model`
| `server/ccmenu/**` | generate xml ccmenu for pipelines | `../model`
| `server/grpc/**` | gRPC server agents can connect to | `pipeline/rpc/**`, `../logging`, `../model`, `../pubsub`, `../queue`, `../forge`, `../pipeline`, `../store`
| `server/logging/**` | logging lib for gPRC server to stream logs while running | std
| `server/model/**` | structs for store (db) and api (json) | std
| `server/plugins/**` | plugins for server | `../model`, `../forge`
| `server/pipeline/**` | orchestrate pipelines | `pipeline`, `../model`, `../pubsub`, `../queue`, `../forge`, `../store`, `../plugins`
| `server/pubsub/**` | pubsub lib for server to push changes to the WebUI | std
| `server/queue/**` | queue lib for server where agents pull new pipelines from via gRPC | `server/model`
| `server/forge/**` | forge lib for server to connect and handle forge specific stuff | `shared`, `server/model`
| `server/router/**` | handle requests to REST API (and all middleware) and serve UI and WebUI config | `shared`, `../api`, `../model`, `../forge`, `../store`, `../web`
| `server/store/**` | handle database | `server/model`
| package | meaning | imports |
| -------------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `server/api/**` | handle web requests from `server/router` | `pipeline`, `../badges`, `../ccmenue`, `../logging`, `../model`, `../pubsub`, `../queue`, `../forge`, `../shared`, `../store`, `shared`, (TODO: mv `server/router/middleware/session`) |
| `server/badges/**` | generate svg badges for pipelines | `../model` |
| `server/ccmenu/**` | generate xml ccmenu for pipelines | `../model` |
| `server/grpc/**` | gRPC server agents can connect to | `pipeline/rpc/**`, `../logging`, `../model`, `../pubsub`, `../queue`, `../forge`, `../pipeline`, `../store` |
| `server/logging/**` | logging lib for gPRC server to stream logs while running | std |
| `server/model/**` | structs for store (db) and api (json) | std |
| `server/plugins/**` | plugins for server | `../model`, `../forge` |
| `server/pipeline/**` | orchestrate pipelines | `pipeline`, `../model`, `../pubsub`, `../queue`, `../forge`, `../store`, `../plugins` |
| `server/pubsub/**` | pubsub lib for server to push changes to the WebUI | std |
| `server/queue/**` | queue lib for server where agents pull new pipelines from via gRPC | `server/model` |
| `server/forge/**` | forge lib for server to connect and handle forge specific stuff | `shared`, `server/model` |
| `server/router/**` | handle requests to REST API (and all middleware) and serve UI and WebUI config | `shared`, `../api`, `../model`, `../forge`, `../store`, `../web` |
| `server/store/**` | handle database | `server/model` |
| `server/shared/**` | TODO: move and split [#974](https://github.com/woodpecker-ci/woodpecker/issues/974) |
| `server/web/**` | server SPA |
* `../` = `server/`
- `../` = `server/`
### Agent

View file

@ -7,7 +7,7 @@ You can find its documentation at [gobook.io/read/gitea.com/xorm](https://gobook
## Add a new migration
Woodpecker uses migrations to change the database schema if a database model has been changed. If for example a developer removes a property `Counter` from the model `Repo` in `server/model/` they would need to add a new migration task like the following example to a file like `server/store/datastore/migration/004_repos_drop_repo_counter.go`:
Woodpecker uses migrations to change the database schema if a database model has been changed. If for example a developer removes a property `Counter` from the model `Repo` in `server/model/` they would need to add a new migration task like the following example to a file like `server/store/datastore/migration/004_repos_drop_repo_counter.go`:
```go
package migration

View file

@ -39,12 +39,13 @@ type User struct {
```
These guidelines aim to have consistent wording in the swagger doc:
* first word after `@Summary` and `@Summary` are always uppercase
* `@Summary` has no . (dot) at the end of the line
* model structs shall use custom short names, to ease life for API consumers, using `@name`
* `@Success` object or array declarations shall be short, this means the actual `model.User` struct must have a `@name` annotation, so that the model can be renderend in Swagger
* when pagination is used, `@Parame page` and `@Parame perPage` must be added manually
* `@Param Authorization` is almost always present, there are just a few un-protected endpoints
- first word after `@Summary` and `@Summary` are always uppercase
- `@Summary` has no . (dot) at the end of the line
- model structs shall use custom short names, to ease life for API consumers, using `@name`
- `@Success` object or array declarations shall be short, this means the actual `model.User` struct must have a `@name` annotation, so that the model can be renderend in Swagger
- when pagination is used, `@Parame page` and `@Parame perPage` must be added manually
- `@Param Authorization` is almost always present, there are just a few un-protected endpoints
There are many examples in the server/api package, which you can use a blueprint.
More enhanced information you can find here https://github.com/swaggo/swag/blob/master/README.md#declarative-comments-format

View file

@ -19,23 +19,23 @@
### Server
| package | meaning | imports |
| -------------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| package | meaning | imports |
| -------------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `server/api/**` | handle web requests from `server/router` | `pipeline`, `../badges`, `../ccmenu`, `../logging`, `../model`, `../pubsub`, `../queue`, `../forge`, `../shared`, `../store`, `shared`, (TODO: mv `server/router/middleware/session`) |
| `server/badges/**` | generate svg badges for pipelines | `../model` |
| `server/ccmenu/**` | generate xml ccmenu for pipelines | `../model` |
| `server/grpc/**` | gRPC server agents can connect to | `pipeline/rpc/**`, `../logging`, `../model`, `../pubsub`, `../queue`, `../forge`, `../pipeline`, `../store` |
| `server/logging/**` | logging lib for gPRC server to stream logs while running | std |
| `server/model/**` | structs for store (db) and api (json) | std |
| `server/plugins/**` | plugins for server | `../model`, `../forge` |
| `server/pipeline/**` | orchestrate pipelines | `pipeline`, `../model`, `../pubsub`, `../queue`, `../forge`, `../store`, `../plugins` |
| `server/pubsub/**` | pubsub lib for server to push changes to the WebUI | std |
| `server/queue/**` | queue lib for server where agents pull new pipelines from via gRPC | `server/model` |
| `server/forge/**` | forge lib for server to connect and handle forge specific stuff | `shared`, `server/model` |
| `server/router/**` | handle requests to REST API (and all middleware) and serve UI and WebUI config | `shared`, `../api`, `../model`, `../forge`, `../store`, `../web` |
| `server/store/**` | handle database | `server/model` |
| `server/shared/**` | TODO: move and split [#974](https://github.com/woodpecker-ci/woodpecker/issues/974) | |
| `server/web/**` | server SPA | |
| `server/badges/**` | generate svg badges for pipelines | `../model` |
| `server/ccmenu/**` | generate xml ccmenu for pipelines | `../model` |
| `server/grpc/**` | gRPC server agents can connect to | `pipeline/rpc/**`, `../logging`, `../model`, `../pubsub`, `../queue`, `../forge`, `../pipeline`, `../store` |
| `server/logging/**` | logging lib for gPRC server to stream logs while running | std |
| `server/model/**` | structs for store (db) and api (json) | std |
| `server/plugins/**` | plugins for server | `../model`, `../forge` |
| `server/pipeline/**` | orchestrate pipelines | `pipeline`, `../model`, `../pubsub`, `../queue`, `../forge`, `../store`, `../plugins` |
| `server/pubsub/**` | pubsub lib for server to push changes to the WebUI | std |
| `server/queue/**` | queue lib for server where agents pull new pipelines from via gRPC | `server/model` |
| `server/forge/**` | forge lib for server to connect and handle forge specific stuff | `shared`, `server/model` |
| `server/router/**` | handle requests to REST API (and all middleware) and serve UI and WebUI config | `shared`, `../api`, `../model`, `../forge`, `../store`, `../web` |
| `server/store/**` | handle database | `server/model` |
| `server/shared/**` | TODO: move and split [#974](https://github.com/woodpecker-ci/woodpecker/issues/974) | |
| `server/web/**` | server SPA | |
- `../` = `server/`

View file

@ -15,7 +15,7 @@ Woodpecker provides three different levels to add secrets to your pipeline. The
:::warning
The use of secrets is deprecated as of version 2.8 and planned to be removed with version 3.
Instead, you can use the *secrets in settings and environment* approach outlined below.
Instead, you can use the _secrets in settings and environment_ approach outlined below.
You can already migrate to this strategy with version 2.8.
:::

View file

@ -168,6 +168,7 @@ services:
ports:
- 2376
```
In the step that needs access to the daemon we need to:
1. Set the `DOCKER_*` environment variables shown below, setting up the connection with the daemon. These are standardized environment variables that should work with the docker client used by your framework of choice (e.g. [TestContainers](https://testcontainers.com/), [Spring Boot Docker Compose](https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-docker-compose) or similar).