From f56f9cb1c02549894e3e1cb45b6d682b6b8ee901 Mon Sep 17 00:00:00 2001 From: qwerty287 <80460567+qwerty287@users.noreply.github.com> Date: Thu, 11 Jan 2024 18:43:54 +0100 Subject: [PATCH] Cleanups + prefer .yaml (#3069) Co-authored-by: Robert Kaussow --- .github/{FUNDING.yml => FUNDING.yaml} | 0 .../{bug_report.yml => bug_report.yaml} | 0 .../{config.yml => config.yaml} | 0 ...ature_request.yml => feature_request.yaml} | 0 .gitpod.yml | 2 +- .golangci.yml => .golangci.yaml | 0 .hadolint.yml => .hadolint.yaml | 0 .pre-commit-config.yaml | 8 ++ .woodpecker/{binaries.yml => binaries.yaml} | 0 .woodpecker/{docker.yml => docker.yaml} | 0 .woodpecker/{docs.yml => docs.yaml} | 2 +- ...release-helper.yml => release-helper.yaml} | 0 .../{securityscan.yml => securityscan.yaml} | 0 .woodpecker/{test.yml => test.yaml} | 2 +- .woodpecker/{web.yml => web.yaml} | 2 +- CONTRIBUTING.md | 5 - Makefile | 12 +- SECURITY.md | 2 +- .../.woodpecker/{demo.yml => demo.yaml} | 0 .../.woodpecker/{test.yml => test.yaml} | 0 ...example.yml => docker-compose.example.yaml | 0 ...e.gitpod.yml => docker-compose.gitpod.yaml | 0 docs/docs/10-intro.md | 26 ++-- docs/docs/20-usage/10-intro.md | 2 +- docs/docs/20-usage/15-terminiology/index.md | 2 +- docs/docs/20-usage/20-workflow-syntax.md | 120 ++++++++-------- docs/docs/20-usage/25-workflows.md | 52 ++++--- docs/docs/20-usage/30-matrix-workflows.md | 30 ++-- docs/docs/20-usage/40-secrets.md | 108 +++++++------- docs/docs/20-usage/41-registries.md | 2 +- docs/docs/20-usage/50-environment.md | 126 ++++++++-------- .../{10-plugins.md => 10-overview.md} | 0 .../20-usage/51-plugins/_category_.yaml} | 2 +- docs/docs/20-usage/60-services.md | 62 ++++---- docs/docs/20-usage/70-volumes.md | 24 ++-- docs/docs/20-usage/71-project-settings.md | 2 +- docs/docs/20-usage/80-badges.md | 2 +- docs/docs/20-usage/90-advanced-usage.md | 13 +- .../{_category_.yml => _category_.yaml} | 0 .../00-deployment/10-docker-compose.md | 114 +++++++-------- .../{_category_.yml => _category_.yaml} | 0 .../30-administration/10-server-config.md | 135 +++++++----------- .../100-external-configuration-api.md | 8 +- .../30-administration/11-forges/20-github.md | 2 +- .../30-administration/11-forges/30-gitea.md | 41 ++---- .../30-administration/11-forges/40-gitlab.md | 19 +-- .../11-forges/50-bitbucket.md | 36 ++--- .../{_category_.yml => _category_.yaml} | 0 .../docs/30-administration/15-agent-config.md | 34 ++--- .../22-backends/10-docker.md | 6 +- .../30-administration/22-backends/20-local.md | 85 ++--------- .../22-backends/40-kubernetes.md | 6 +- .../{_category_.yml => _category_.yaml} | 0 docs/docs/30-administration/30-database.md | 42 ++---- docs/docs/30-administration/60-ssl.md | 130 +++++++---------- docs/docs/30-administration/70-proxy.md | 46 +++--- .../75-addons/00-overview.md | 13 +- .../75-addons/20-creating-addons.md | 39 +++-- .../{_category_.yml => _category_.yaml} | 0 docs/docs/30-administration/80-autoscaler.md | 2 +- docs/docs/30-administration/90-prometheus.md | 32 ++--- .../{_category_.yml => _category_.yaml} | 0 docs/docs/92-awesome.md | 9 +- .../docs/92-development/01-getting-started.md | 36 +++-- .../{_category_.yml => _category_.yaml} | 0 docs/docusaurus.config.ts | 16 ++- docs/src/pages/faq.md | 9 +- docs/static/.nojekyll | 0 .../{_category_.yml => _category_.yaml} | 0 .../{_category_.yml => _category_.yaml} | 0 .../{_category_.yml => _category_.yaml} | 0 .../{_category_.yml => _category_.yaml} | 0 .../{_category_.yml => _category_.yaml} | 0 .../{_category_.yml => _category_.yaml} | 0 .../{_category_.yml => _category_.yaml} | 0 .../{_category_.yml => _category_.yaml} | 0 .../{_category_.yml => _category_.yaml} | 0 .../{_category_.yml => _category_.yaml} | 0 .../{_category_.yml => _category_.yaml} | 0 .../{_category_.yml => _category_.yaml} | 0 .../{_category_.yml => _category_.yaml} | 0 .../{_category_.yml => _category_.yaml} | 0 .../{_category_.yml => _category_.yaml} | 0 .../{_category_.yml => _category_.yaml} | 0 .../{_category_.yml => _category_.yaml} | 0 .../{_category_.yml => _category_.yaml} | 0 .../20-usage/51-plugins/_category_.yaml} | 0 .../{_category_.yml => _category_.yaml} | 0 .../{_category_.yml => _category_.yaml} | 0 .../{_category_.yml => _category_.yaml} | 0 .../{_category_.yml => _category_.yaml} | 0 .../{_category_.yml => _category_.yaml} | 0 .../{_category_.yml => _category_.yaml} | 0 .../{_category_.yml => _category_.yaml} | 0 nfpm/{nfpm-agent.yml => agent.yaml} | 0 nfpm/{nfpm-cli.yml => cli.yaml} | 0 nfpm/{nfpm-server.yml => server.yaml} | 0 ...rray-syntax.yml => test-array-syntax.yaml} | 0 ...hes-array.yml => test-branches-array.yaml} | 0 ...yml => test-branches-exclude-include.yaml} | 0 .../{test-branches.yml => test-branches.yaml} | 0 .../{test-broken.yml => test-broken.yaml} | 0 ...st-clone-skip.yml => test-clone-skip.yaml} | 0 .../{test-clone.yml => test-clone.yaml} | 0 .../{test-labels.yml => test-labels.yaml} | 0 .../{test-matrix.yml => test-matrix.yaml} | 0 ...e.yml => test-merge-map-and-sequence.yaml} | 0 .../{test-multi.yml => test-multi.yaml} | 0 ...eline-when.yml => test-pipeline-when.yaml} | 0 .../{test-platform.yml => test-platform.yaml} | 0 .../{test-plugin.yml => test-plugin.yaml} | 0 .../{test-run-on.yml => test-run-on.yaml} | 0 .../{test-service.yml => test-service.yaml} | 0 .../{test-step.yml => test-step.yaml} | 0 .../{test-when.yml => test-when.yaml} | 0 ...test-workspace.yml => test-workspace.yaml} | 0 .../yaml/linter/schema/schema_test.go | 36 ++--- 117 files changed, 658 insertions(+), 846 deletions(-) rename .github/{FUNDING.yml => FUNDING.yaml} (100%) rename .github/ISSUE_TEMPLATE/{bug_report.yml => bug_report.yaml} (100%) rename .github/ISSUE_TEMPLATE/{config.yml => config.yaml} (100%) rename .github/ISSUE_TEMPLATE/{feature_request.yml => feature_request.yaml} (100%) rename .golangci.yml => .golangci.yaml (100%) rename .hadolint.yml => .hadolint.yaml (100%) rename .woodpecker/{binaries.yml => binaries.yaml} (100%) rename .woodpecker/{docker.yml => docker.yaml} (100%) rename .woodpecker/{docs.yml => docs.yaml} (99%) rename .woodpecker/{release-helper.yml => release-helper.yaml} (100%) rename .woodpecker/{securityscan.yml => securityscan.yaml} (100%) rename .woodpecker/{test.yml => test.yaml} (99%) rename .woodpecker/{web.yml => web.yaml} (97%) rename contrib/woodpecker-test-repo/.woodpecker/{demo.yml => demo.yaml} (100%) rename contrib/woodpecker-test-repo/.woodpecker/{test.yml => test.yaml} (100%) rename docker-compose.example.yml => docker-compose.example.yaml (100%) rename docker-compose.gitpod.yml => docker-compose.gitpod.yaml (100%) rename docs/docs/20-usage/51-plugins/{10-plugins.md => 10-overview.md} (100%) rename docs/{versioned_docs/version-2.1/20-usage/51-plugins/_category_.yml => docs/20-usage/51-plugins/_category_.yaml} (83%) rename docs/docs/20-usage/{_category_.yml => _category_.yaml} (100%) rename docs/docs/30-administration/00-deployment/{_category_.yml => _category_.yaml} (100%) rename docs/docs/30-administration/11-forges/{_category_.yml => _category_.yaml} (100%) rename docs/docs/30-administration/22-backends/{_category_.yml => _category_.yaml} (100%) rename docs/docs/30-administration/75-addons/{_category_.yml => _category_.yaml} (100%) rename docs/docs/30-administration/{_category_.yml => _category_.yaml} (100%) rename docs/docs/92-development/{_category_.yml => _category_.yaml} (100%) delete mode 100644 docs/static/.nojekyll rename docs/versioned_docs/version-0.15/20-usage/51-plugins/{_category_.yml => _category_.yaml} (100%) rename docs/versioned_docs/version-0.15/20-usage/{_category_.yml => _category_.yaml} (100%) rename docs/versioned_docs/version-0.15/30-administration/11-vcs/{_category_.yml => _category_.yaml} (100%) rename docs/versioned_docs/version-0.15/30-administration/{_category_.yml => _category_.yaml} (100%) rename docs/versioned_docs/version-0.15/92-development/{_category_.yml => _category_.yaml} (100%) rename docs/versioned_docs/version-1.0/20-usage/51-plugins/{_category_.yml => _category_.yaml} (100%) rename docs/versioned_docs/version-1.0/20-usage/{_category_.yml => _category_.yaml} (100%) rename docs/versioned_docs/version-1.0/30-administration/11-forges/{_category_.yml => _category_.yaml} (100%) rename docs/versioned_docs/version-1.0/30-administration/22-backends/{_category_.yml => _category_.yaml} (100%) rename docs/versioned_docs/version-1.0/30-administration/{_category_.yml => _category_.yaml} (100%) rename docs/versioned_docs/version-1.0/92-development/{_category_.yml => _category_.yaml} (100%) rename docs/versioned_docs/version-2.0/20-usage/51-plugins/{_category_.yml => _category_.yaml} (100%) rename docs/versioned_docs/version-2.0/20-usage/{_category_.yml => _category_.yaml} (100%) rename docs/versioned_docs/version-2.0/30-administration/00-deployment/{_category_.yml => _category_.yaml} (100%) rename docs/versioned_docs/version-2.0/30-administration/11-forges/{_category_.yml => _category_.yaml} (100%) rename docs/versioned_docs/version-2.0/30-administration/22-backends/{_category_.yml => _category_.yaml} (100%) rename docs/versioned_docs/version-2.0/30-administration/{_category_.yml => _category_.yaml} (100%) rename docs/versioned_docs/version-2.0/92-development/{_category_.yml => _category_.yaml} (100%) rename docs/{docs/20-usage/51-plugins/_category_.yml => versioned_docs/version-2.1/20-usage/51-plugins/_category_.yaml} (100%) rename docs/versioned_docs/version-2.1/20-usage/{_category_.yml => _category_.yaml} (100%) rename docs/versioned_docs/version-2.1/30-administration/00-deployment/{_category_.yml => _category_.yaml} (100%) rename docs/versioned_docs/version-2.1/30-administration/11-forges/{_category_.yml => _category_.yaml} (100%) rename docs/versioned_docs/version-2.1/30-administration/22-backends/{_category_.yml => _category_.yaml} (100%) rename docs/versioned_docs/version-2.1/30-administration/75-addons/{_category_.yml => _category_.yaml} (100%) rename docs/versioned_docs/version-2.1/30-administration/{_category_.yml => _category_.yaml} (100%) rename docs/versioned_docs/version-2.1/92-development/{_category_.yml => _category_.yaml} (100%) rename nfpm/{nfpm-agent.yml => agent.yaml} (100%) rename nfpm/{nfpm-cli.yml => cli.yaml} (100%) rename nfpm/{nfpm-server.yml => server.yaml} (100%) rename pipeline/frontend/yaml/linter/schema/.woodpecker/{test-array-syntax.yml => test-array-syntax.yaml} (100%) rename pipeline/frontend/yaml/linter/schema/.woodpecker/{test-branches-array.yml => test-branches-array.yaml} (100%) rename pipeline/frontend/yaml/linter/schema/.woodpecker/{test-branches-exclude-include.yml => test-branches-exclude-include.yaml} (100%) rename pipeline/frontend/yaml/linter/schema/.woodpecker/{test-branches.yml => test-branches.yaml} (100%) rename pipeline/frontend/yaml/linter/schema/.woodpecker/{test-broken.yml => test-broken.yaml} (100%) rename pipeline/frontend/yaml/linter/schema/.woodpecker/{test-clone-skip.yml => test-clone-skip.yaml} (100%) rename pipeline/frontend/yaml/linter/schema/.woodpecker/{test-clone.yml => test-clone.yaml} (100%) rename pipeline/frontend/yaml/linter/schema/.woodpecker/{test-labels.yml => test-labels.yaml} (100%) rename pipeline/frontend/yaml/linter/schema/.woodpecker/{test-matrix.yml => test-matrix.yaml} (100%) rename pipeline/frontend/yaml/linter/schema/.woodpecker/{test-merge-map-and-sequence.yml => test-merge-map-and-sequence.yaml} (100%) rename pipeline/frontend/yaml/linter/schema/.woodpecker/{test-multi.yml => test-multi.yaml} (100%) rename pipeline/frontend/yaml/linter/schema/.woodpecker/{test-pipeline-when.yml => test-pipeline-when.yaml} (100%) rename pipeline/frontend/yaml/linter/schema/.woodpecker/{test-platform.yml => test-platform.yaml} (100%) rename pipeline/frontend/yaml/linter/schema/.woodpecker/{test-plugin.yml => test-plugin.yaml} (100%) rename pipeline/frontend/yaml/linter/schema/.woodpecker/{test-run-on.yml => test-run-on.yaml} (100%) rename pipeline/frontend/yaml/linter/schema/.woodpecker/{test-service.yml => test-service.yaml} (100%) rename pipeline/frontend/yaml/linter/schema/.woodpecker/{test-step.yml => test-step.yaml} (100%) rename pipeline/frontend/yaml/linter/schema/.woodpecker/{test-when.yml => test-when.yaml} (100%) rename pipeline/frontend/yaml/linter/schema/.woodpecker/{test-workspace.yml => test-workspace.yaml} (100%) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yaml similarity index 100% rename from .github/FUNDING.yml rename to .github/FUNDING.yaml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yaml similarity index 100% rename from .github/ISSUE_TEMPLATE/bug_report.yml rename to .github/ISSUE_TEMPLATE/bug_report.yaml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yaml similarity index 100% rename from .github/ISSUE_TEMPLATE/config.yml rename to .github/ISSUE_TEMPLATE/config.yaml diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yaml similarity index 100% rename from .github/ISSUE_TEMPLATE/feature_request.yml rename to .github/ISSUE_TEMPLATE/feature_request.yaml diff --git a/.gitpod.yml b/.gitpod.yml index 5eaee9bbf..e0bc90840 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -37,7 +37,7 @@ tasks: go run go.woodpecker-ci.org/woodpecker/v2/cmd/agent - name: Gitea command: | - export DOCKER_COMPOSE_CMD="docker-compose -f docker-compose.gitpod.yml -p woodpecker" + export DOCKER_COMPOSE_CMD="docker-compose -f docker-compose.gitpod.yaml -p woodpecker" export GITEA_CLI_CMD="$DOCKER_COMPOSE_CMD exec -u git gitea gitea" $DOCKER_COMPOSE_CMD up -d until curl --output /dev/null --silent --head --fail http://localhost:3000; do printf '.'; sleep 1; done diff --git a/.golangci.yml b/.golangci.yaml similarity index 100% rename from .golangci.yml rename to .golangci.yaml diff --git a/.hadolint.yml b/.hadolint.yaml similarity index 100% rename from .hadolint.yml rename to .hadolint.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8e849831f..993882dcb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,6 +35,14 @@ repos: hooks: - id: yamllint args: [--strict, -c=.yamllint.yaml] + - repo: local + hooks: + - id: yaml-file-extension + name: Check if YAML files has *.yaml extension. + entry: YAML filenames must have .yaml extension. + language: fail + files: .yml$ + exclude: '^.gitpod.yml$' ci: autofix_commit_msg: | diff --git a/.woodpecker/binaries.yml b/.woodpecker/binaries.yaml similarity index 100% rename from .woodpecker/binaries.yml rename to .woodpecker/binaries.yaml diff --git a/.woodpecker/docker.yml b/.woodpecker/docker.yaml similarity index 100% rename from .woodpecker/docker.yml rename to .woodpecker/docker.yaml diff --git a/.woodpecker/docs.yml b/.woodpecker/docs.yaml similarity index 99% rename from .woodpecker/docs.yml rename to .woodpecker/docs.yaml index ecb299a42..6a1095f64 100644 --- a/.woodpecker/docs.yml +++ b/.woodpecker/docs.yaml @@ -4,7 +4,7 @@ variables: - &alpine_image 'docker.io/alpine:3.19' - path: &when_path - 'docs/**' - - '.woodpecker/docs.yml' + - '.woodpecker/docs.yaml' # since we generate docs for cli tool we have to watch this too - 'cli/**' - 'cmd/cli/**' diff --git a/.woodpecker/release-helper.yml b/.woodpecker/release-helper.yaml similarity index 100% rename from .woodpecker/release-helper.yml rename to .woodpecker/release-helper.yaml diff --git a/.woodpecker/securityscan.yml b/.woodpecker/securityscan.yaml similarity index 100% rename from .woodpecker/securityscan.yml rename to .woodpecker/securityscan.yaml diff --git a/.woodpecker/test.yml b/.woodpecker/test.yaml similarity index 99% rename from .woodpecker/test.yml rename to .woodpecker/test.yaml index d652af081..3423f58ff 100644 --- a/.woodpecker/test.yml +++ b/.woodpecker/test.yaml @@ -9,7 +9,7 @@ variables: - &golang_image 'docker.io/golang:1.21.5' - &when - path: &when_path # related config files - - '.woodpecker/test.yml' + - '.woodpecker/test.yaml' - '.golangci.yaml' # go source code - '**/*.go' diff --git a/.woodpecker/web.yml b/.woodpecker/web.yaml similarity index 97% rename from .woodpecker/web.yml rename to .woodpecker/web.yaml index c120f515e..1e629c274 100644 --- a/.woodpecker/web.yml +++ b/.woodpecker/web.yaml @@ -8,7 +8,7 @@ variables: - &when path: # related config files - - '.woodpecker/web.yml' + - '.woodpecker/web.yaml' # web source code - 'web/**' # api source code diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7689517b6..e9235ef9f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -77,8 +77,3 @@ As of semver guidelines, breaking changes will be released as a major version. W breaking changes to not release many majors each containing just a few breaking changes. Prior to the release of a major version, a release candidate (RC) will be published to allow easy testing, the actual release will be about a week later. - -## Development - -[pre-commit](https://pre-commit.com/) is used in this repository. -To apply it during local development, take a look at [`pre-commit`s documentation](https://pre-commit.com/#usage) diff --git a/Makefile b/Makefile index 54bb41f3d..0ef22575e 100644 --- a/Makefile +++ b/Makefile @@ -276,16 +276,16 @@ bundle-prepare: ## Prepare the bundles go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.6.0 bundle-agent: bundle-prepare ## Create bundles for agent - VERSION_NUMBER=$(VERSION_NUMBER) nfpm package --config ./nfpm/nfpm-agent.yml --target ./dist --packager deb - VERSION_NUMBER=$(VERSION_NUMBER) nfpm package --config ./nfpm/nfpm-agent.yml --target ./dist --packager rpm + VERSION_NUMBER=$(VERSION_NUMBER) nfpm package --config ./nfpm/agent.yaml --target ./dist --packager deb + VERSION_NUMBER=$(VERSION_NUMBER) nfpm package --config ./nfpm/agent.yaml --target ./dist --packager rpm bundle-server: bundle-prepare ## Create bundles for server - VERSION_NUMBER=$(VERSION_NUMBER) nfpm package --config ./nfpm/nfpm-server.yml --target ./dist --packager deb - VERSION_NUMBER=$(VERSION_NUMBER) nfpm package --config ./nfpm/nfpm-server.yml --target ./dist --packager rpm + VERSION_NUMBER=$(VERSION_NUMBER) nfpm package --config ./nfpm/server.yaml --target ./dist --packager deb + VERSION_NUMBER=$(VERSION_NUMBER) nfpm package --config ./nfpm/server.yaml --target ./dist --packager rpm bundle-cli: bundle-prepare ## Create bundles for cli - VERSION_NUMBER=$(VERSION_NUMBER) nfpm package --config ./nfpm/nfpm-cli.yml --target ./dist --packager deb - VERSION_NUMBER=$(VERSION_NUMBER) nfpm package --config ./nfpm/nfpm-cli.yml --target ./dist --packager rpm + VERSION_NUMBER=$(VERSION_NUMBER) nfpm package --config ./nfpm/cli.yaml --target ./dist --packager deb + VERSION_NUMBER=$(VERSION_NUMBER) nfpm package --config ./nfpm/cli.yaml --target ./dist --packager rpm .PHONY: bundle bundle: bundle-agent bundle-server bundle-cli ## Create all bundles diff --git a/SECURITY.md b/SECURITY.md index 2491fe0cc..24517c843 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,7 +1,7 @@ # Security We take security seriously. -If you discover a security issue, please bring it to their attention right away! +If you discover a security issue, please bring it to our attention right away! ## Reporting a Vulnerability diff --git a/contrib/woodpecker-test-repo/.woodpecker/demo.yml b/contrib/woodpecker-test-repo/.woodpecker/demo.yaml similarity index 100% rename from contrib/woodpecker-test-repo/.woodpecker/demo.yml rename to contrib/woodpecker-test-repo/.woodpecker/demo.yaml diff --git a/contrib/woodpecker-test-repo/.woodpecker/test.yml b/contrib/woodpecker-test-repo/.woodpecker/test.yaml similarity index 100% rename from contrib/woodpecker-test-repo/.woodpecker/test.yml rename to contrib/woodpecker-test-repo/.woodpecker/test.yaml diff --git a/docker-compose.example.yml b/docker-compose.example.yaml similarity index 100% rename from docker-compose.example.yml rename to docker-compose.example.yaml diff --git a/docker-compose.gitpod.yml b/docker-compose.gitpod.yaml similarity index 100% rename from docker-compose.gitpod.yml rename to docker-compose.gitpod.yaml diff --git a/docs/docs/10-intro.md b/docs/docs/10-intro.md index 5a36deb65..087fbe7ff 100644 --- a/docs/docs/10-intro.md +++ b/docs/docs/10-intro.md @@ -5,13 +5,13 @@ If you are already using containers in your daily workflow, you'll for sure love ![woodpecker](woodpecker.png) -## .woodpecker.yml +## `.woodpecker.yaml` -- Place your pipeline in a file named `.woodpecker.yml` in your repository +- Place your pipeline in a file named `.woodpecker.yaml` in your repository - Pipeline steps can be named as you like - Run any command in the commands section -```yaml title=".woodpecker.yml" +```yaml title=".woodpecker.yaml" steps: build: image: debian @@ -31,12 +31,12 @@ steps: - List the commands that should be executed in the container ```diff -steps: - build: -- image: debian -+ image: mycompany/image-with-awscli - commands: - - aws help + steps: + build: +- image: debian ++ image: mycompany/image-with-awscli + commands: + - aws help ``` ### File changes are incremental @@ -44,7 +44,7 @@ steps: - Woodpecker clones the source code in the beginning - File changes are persisted throughout individual steps as the same volume is being mounted in all steps -```yaml title=".woodpecker.yml" +```yaml title=".woodpecker.yaml" steps: build: image: debian @@ -73,15 +73,15 @@ ENTRYPOINT ["/usr/local/deploy"] kubectl apply -f $PLUGIN_TEMPLATE ``` -```yaml title=".woodpecker.yml" +```yaml title=".woodpecker.yaml" steps: deploy-to-k8s: image: laszlocloud/my-k8s-plugin settings: - template: config/k8s/service.yml + template: config/k8s/service.yaml ``` -See [plugin docs](./20-usage/51-plugins/10-plugins.md). +See [plugin docs](./20-usage/51-plugins/10-overview.md). ## Continue reading diff --git a/docs/docs/20-usage/10-intro.md b/docs/docs/20-usage/10-intro.md index 789369668..d5eaeed89 100644 --- a/docs/docs/20-usage/10-intro.md +++ b/docs/docs/20-usage/10-intro.md @@ -19,7 +19,7 @@ This is because webhooks are signed using a per-repository secret key which is n ## Configuration -To configure your pipeline you must create a `.woodpecker.yml` file in the root of your repository. The `.woodpecker.yml` file is used to define your pipeline steps. +To configure your pipeline you must create a `.woodpecker.yaml` file in the root of your repository. The `.woodpecker.yaml` file is used to define your pipeline steps. :::note We support most of YAML 1.2, but preserve some behavior from 1.1 for backward compatibility. diff --git a/docs/docs/20-usage/15-terminiology/index.md b/docs/docs/20-usage/15-terminiology/index.md index 18e015d14..9f24e4617 100644 --- a/docs/docs/20-usage/15-terminiology/index.md +++ b/docs/docs/20-usage/15-terminiology/index.md @@ -54,7 +54,7 @@ Sometimes there are multiple terms that can be used to describe something. This [Pipeline]: ../20-workflow-syntax.md [Workflow]: ../25-workflows.md [Forge]: ../../30-administration/11-forges/10-overview.md -[Plugin]: ../51-plugins/10-plugins.md +[Plugin]: ../51-plugins/10-overview.md [Workspace]: ../20-workflow-syntax.md#workspace [Matrix]: ../30-matrix-workflows.md [Docker]: ../../30-administration/22-backends/10-docker.md diff --git a/docs/docs/20-usage/20-workflow-syntax.md b/docs/docs/20-usage/20-workflow-syntax.md index 9afaab9b4..e0a141b42 100644 --- a/docs/docs/20-usage/20-workflow-syntax.md +++ b/docs/docs/20-usage/20-workflow-syntax.md @@ -67,7 +67,7 @@ The associated commit is checked out with git to a workspace which is mounted to - Woodpecker clones the source code in the beginning of the workflow - Changes to files are persisted through steps as the same volume is mounted to all steps -```yaml title=".woodpecker.yml" +```yaml title=".woodpecker.yaml" steps: build: image: debian @@ -104,7 +104,7 @@ When using the `local` backend, the `image` entry is used to specify the shell, Woodpecker supports any valid Docker image from any Docker registry: -```text +```yaml image: golang image: golang:1.7 image: library/golang:1.7 @@ -152,7 +152,9 @@ The above shell script is then executed as the container entrypoint. The below d docker run --entrypoint=build.sh golang ``` -> Please note that only build steps can define commands. You cannot use commands with plugins or services. +:::note +Only build steps can define commands. You cannot use commands with plugins or services. +::: ### `environment` @@ -220,13 +222,13 @@ Branch conditions are not applied to tags. Example conditional execution by branch: ```diff -steps: - slack: - image: plugins/slack - settings: - channel: dev -+ when: -+ - branch: main + steps: + slack: + image: plugins/slack + settings: + channel: dev ++ when: ++ - branch: main ``` > The step now triggers on main branch, but also if the target branch of a pull request is `main`. Add an event condition to limit it further to pushes on main only. @@ -317,13 +319,13 @@ when: There are use cases for executing steps on failure, such as sending notifications for failed workflow / pipeline. Use the status constraint to execute steps even when the workflow fails: ```diff -steps: - slack: - image: plugins/slack - settings: - channel: dev -+ when: -+ - status: [ success, failure ] + steps: + slack: + image: plugins/slack + settings: + channel: dev ++ when: ++ - status: [ success, failure ] ``` #### `platform` @@ -395,12 +397,14 @@ You can use [glob patterns](https://github.com/bmatcuk/doublestar#patterns) to m ```yaml when: - path: - include: ['.woodpecker/*.yml', '*.ini'] + include: ['.woodpecker/*.yaml', '*.ini'] exclude: ['*.md', 'docs/**'] ignore_message: '[ALL]' ``` -**Hint:** Passing a defined ignore-message like `[ALL]` inside the commit message will ignore all path conditions. +:::info +Passing a defined ignore-message like `[ALL]` inside the commit message will ignore all path conditions. +::: #### `evaluate` @@ -490,11 +494,7 @@ For more details check the [services docs](./60-services.md). ## `workspace` -The workspace defines the shared volume and working directory shared by all workflow steps. The default workspace matches the below pattern, based on your repository URL. - -```txt -/woodpecker/src/github.com/octocat/hello-world -``` +The workspace defines the shared volume and working directory shared by all workflow steps. The default workspace matches the pattern `/woodpecker/src/github.com/octocat/hello-world`, based on your repository URL. The workspace can be customized using the workspace block in the YAML file: @@ -547,7 +547,7 @@ The path attribute defines the working directory of your build. This is where yo + path: src/github.com/octocat/hello-world ``` -```text +```bash git clone https://github.com/octocat/hello-world \ /go/src/github.com/octocat/hello-world ``` @@ -575,12 +575,12 @@ You can add additional labels as a key value map: + weather: sun + hostname: "" # this label will be ignored as it is empty -steps: - build: - image: golang - commands: - - go build - - go test + steps: + build: + image: golang + commands: + - go build + - go test ``` ### Filter by platform @@ -596,8 +596,8 @@ Assuming we have two agents, one `linux/arm` and one `linux/amd64`. Previously t +labels: + platform: linux/arm64 -steps: - [...] + steps: + [...] ``` ## `variables` @@ -639,9 +639,9 @@ Example configuration to override depth: Example configuration to use a custom clone plugin: ```diff -clone: - git: -+ image: octocat/custom-git-plugin + clone: + git: ++ image: octocat/custom-git-plugin ``` Example configuration to clone Mercurial repository: @@ -726,36 +726,36 @@ Example conditional execution by branch: channel: dev ``` -> The step now triggers on main, but also if the target branch of a pull request is `main`. Add an event condition to limit it further to pushes on main only. +The step now triggers on `main`, but also if the target branch of a pull request is `main`. Add an event condition to limit it further to pushes on main only. Execute a step if the branch is `main` or `develop`: -```diff +```yaml when: branch: [main, develop] ``` Execute a step if the branch starts with `prefix/*`: -```diff +```yaml when: branch: prefix/* ``` Execute a step using custom include and exclude logic: -```diff +```yaml when: branch: - include: [ main, release/* ] - exclude: [ release/1.0.0, release/1.1.* ] + include: [main, release/*] + exclude: [release/1.0.0, release/1.1.*] ``` ### `event` Execute a step if the build event is a `tag`: -```diff +```yaml when: event: tag ``` @@ -763,21 +763,21 @@ when: Execute a step if the pipeline event is a `push` to a specified branch: ```diff -when: - event: push -+ branch: main + when: + event: push ++ branch: main ``` Execute a step for all non-pull request events: -```diff +```yaml when: event: [push, tag, deployment] ``` Execute a step for all build events: -```diff +```yaml when: event: [push, pull_request, tag, deployment] ``` @@ -797,7 +797,7 @@ when: Execute a step for deployment events matching the target deployment environment: -```diff +```yaml when: environment: production event: deployment @@ -807,7 +807,7 @@ when: Execute a step only on a certain Woodpecker instance matching the specified hostname: -```diff +```yaml when: instance: stage.woodpecker.company.com ``` @@ -821,22 +821,24 @@ It is currently **only available** for GitHub, GitLab and Gitea (version 1.18.0 Execute a step only on a pipeline with certain files being changed: -```diff +```yaml when: - path: "src/*" + path: 'src/*' ``` You can use [glob patterns](https://github.com/bmatcuk/doublestar#patterns) to match the changed files and specify if the step should run if a file matching that pattern has been changed `include` or if some files have **not** been changed `exclude`. -```diff +```yaml when: path: - include: [ '.woodpecker/*.yml', '*.ini' ] - exclude: [ '*.md', 'docs/**' ] - ignore_message: "[ALL]" + include: ['.woodpecker/*.yaml', '*.ini'] + exclude: ['*.md', 'docs/**'] + ignore_message: '[ALL]' ``` -**Hint:** Passing a defined ignore-message like `[ALL]` inside the commit message will ignore all path conditions. +:::info +Passing a defined ignore-message like `[ALL]` inside the commit message will ignore all path conditions. +::: ## `depends_on` @@ -850,7 +852,9 @@ Workflows that should run even on failure should set the `runs_on` tag. See [her Woodpecker gives the ability to configure privileged mode in the YAML. You can use this parameter to launch containers with escalated capabilities. -> Privileged mode is only available to trusted repositories and for security reasons should only be used in private environments. See [project settings](./71-project-settings.md#trusted) to enable trusted mode. +:::info +Privileged mode is only available to trusted repositories and for security reasons should only be used in private environments. See [project settings](./71-project-settings.md#trusted) to enable trusted mode. +::: ```diff steps: diff --git a/docs/docs/20-usage/25-workflows.md b/docs/docs/20-usage/25-workflows.md index 76d33f429..d1f8a0c44 100644 --- a/docs/docs/20-usage/25-workflows.md +++ b/docs/docs/20-usage/25-workflows.md @@ -1,14 +1,10 @@ # Workflows -:::info -This Feature is only available for GitHub, Gitea & GitLab repositories. Follow [this](https://github.com/woodpecker-ci/woodpecker/issues/1138) issue to support further development. -::: - A pipeline has at least one workflow. A workflow is a set of steps that are executed in sequence using the same workspace which is a shared folder containing the repository and all the generated data from previous steps. -Incase there is a single configuration in `.woodpecker.yml` Woodpecker will create a pipeline with a single workflow. +In case there is a single configuration in `.woodpecker.yaml` Woodpecker will create a pipeline with a single workflow. -By placing the configurations in a folder which is by default named `.woodpecker/` Woodpecker will create a pipeline with multiple workflows each named by the file they are defined in. Only `.yml` and `.yaml` files will be used and files in any subfolders like `.woodpecker/sub-folder/test.yml` will be ignored. +By placing the configurations in a folder which is by default named `.woodpecker/` Woodpecker will create a pipeline with multiple workflows each named by the file they are defined in. Only `.yml` and `.yaml` files will be used and files in any subfolders like `.woodpecker/sub-folder/test.yaml` will be ignored. You can also set some custom path like `.my-ci/pipelines/` instead of `.woodpecker/` in the [project settings](./71-project-settings.md). @@ -22,18 +18,18 @@ You can also set some custom path like `.my-ci/pipelines/` instead of `.woodpeck :::warning Please note that files are only shared between steps of the same workflow (see [File changes are incremental](./20-workflow-syntax.md#file-changes-are-incremental)). That means you cannot access artifacts e.g. from the `build` workflow in the `deploy` workflow. -If you still need to pass artifacts between the workflows you need use some storage [plugin](./51-plugins/10-plugins.md) (e.g. one which stores files in an Amazon S3 bucket). +If you still need to pass artifacts between the workflows you need use some storage [plugin](./51-plugins/10-overview.md) (e.g. one which stores files in an Amazon S3 bucket). ::: ```bash .woodpecker/ -├── .build.yml -├── .deploy.yml -├── .lint.yml -└── .test.yml +├── .build.yaml +├── .deploy.yaml +├── .lint.yaml +└── .test.yaml ``` -```yaml title=".woodpecker/.build.yml" +```yaml title=".woodpecker/.build.yaml" steps: build: image: debian:stable-slim @@ -42,7 +38,7 @@ steps: - sleep 5 ``` -```yaml title=".woodpecker/.deploy.yml" +```yaml title=".woodpecker/.deploy.yaml" steps: deploy: image: debian:stable-slim @@ -55,7 +51,7 @@ depends_on: - test ``` -```yaml title=".woodpecker/.test.yml" +```yaml title=".woodpecker/.test.yaml" steps: test: image: debian:stable-slim @@ -67,7 +63,7 @@ depends_on: - build ``` -```yaml title=".woodpecker/.lint.yml" +```yaml title=".woodpecker/.lint.yaml" steps: lint: image: debian:stable-slim @@ -86,14 +82,14 @@ The workflows run in parallel on separate agents and share nothing. Dependencies between workflows can be set with the `depends_on` element. A workflow doesn't execute until all of its dependencies finished successfully. -The name for a `depends_on` entry is the filename without the path, leading dots and without the file extension `.yml` or `.yaml`. If the project config for example uses `.woodpecker/` as path for CI files with a file named `.woodpecker/.lint.yml` the corresponding `depends_on` entry would be `lint`. +The name for a `depends_on` entry is the filename without the path, leading dots and without the file extension `.yml` or `.yaml`. If the project config for example uses `.woodpecker/` as path for CI files with a file named `.woodpecker/.lint.yaml` the corresponding `depends_on` entry would be `lint`. ```diff -steps: - deploy: - image: debian:stable-slim - commands: - - echo deploying + steps: + deploy: + image: debian:stable-slim + commands: + - echo deploying +depends_on: + - lint @@ -104,14 +100,14 @@ steps: Workflows that need to run even on failures should set the `runs_on` tag. ```diff -steps: - notify: - image: debian:stable-slim - commands: - - echo notifying + steps: + notify: + image: debian:stable-slim + commands: + - echo notifying -depends_on: - - deploy + depends_on: + - deploy +runs_on: [ success, failure ] ``` diff --git a/docs/docs/20-usage/30-matrix-workflows.md b/docs/docs/20-usage/30-matrix-workflows.md index 9ec885184..c1c62c324 100644 --- a/docs/docs/20-usage/30-matrix-workflows.md +++ b/docs/docs/20-usage/30-matrix-workflows.md @@ -58,22 +58,22 @@ services: Example YAML file after injecting the matrix parameters: ```diff -steps: - build: -- image: golang:${GO_VERSION} -+ image: golang:1.4 - commands: - - go get - - go build - - go test -+ environment: -+ - GO_VERSION=1.4 -+ - DATABASE=mysql:8 + steps: + build: +- image: golang:${GO_VERSION} ++ image: golang:1.4 + commands: + - go get + - go build + - go test ++ environment: ++ - GO_VERSION=1.4 ++ - DATABASE=mysql:8 -services: - database: -- image: ${DATABASE} -+ image: mysql:8 + services: + database: +- image: ${DATABASE} ++ image: mysql:8 ``` ## Examples diff --git a/docs/docs/20-usage/40-secrets.md b/docs/docs/20-usage/40-secrets.md index 1518d17a8..6c8465a58 100644 --- a/docs/docs/20-usage/40-secrets.md +++ b/docs/docs/20-usage/40-secrets.md @@ -17,13 +17,13 @@ Secrets are exposed to your pipeline steps and plugins as uppercase environment once their usage is declared in the `secrets` section: ```diff -steps: - docker: - image: docker - commands: -+ - echo $DOCKER_USERNAME -+ - echo $DOCKER_PASSWORD -+ secrets: [ docker_username, docker_password ] + steps: + docker: + image: docker + commands: ++ - echo $DOCKER_USERNAME ++ - echo $DOCKER_PASSWORD ++ secrets: [ docker_username, docker_password ] ``` ### Use secrets in settings @@ -34,12 +34,12 @@ In this example, the secret named `secret_token` would be passed to the setting **NOTE:** the `from_secret` syntax only works with the newer `settings` block. ```diff -steps: - docker: - image: my-plugin - settings: -+ token: -+ from_secret: secret_token + steps: + docker: + image: my-plugin + settings: ++ token: ++ from_secret: secret_token ``` ### Note about parameter pre-processing @@ -47,15 +47,15 @@ steps: Please note parameter expressions are subject to pre-processing. When using secrets in parameter expressions they should be escaped. ```diff -steps: - docker: - image: docker - commands: -- - echo ${DOCKER_USERNAME} -- - echo ${DOCKER_PASSWORD} -+ - echo $${DOCKER_USERNAME} -+ - echo $${DOCKER_PASSWORD} - secrets: [ docker_username, docker_password ] + steps: + docker: + image: docker + commands: +- - echo ${DOCKER_USERNAME} +- - echo ${DOCKER_PASSWORD} ++ - echo $${DOCKER_USERNAME} ++ - echo $${DOCKER_PASSWORD} + secrets: [ docker_username, docker_password ] ``` ### Alternate Names @@ -63,14 +63,14 @@ steps: There may be scenarios where you are required to store secrets using alternate names. You can map the alternate secret name to the expected name using the below syntax: ```diff -steps: - docker: - image: plugins/docker - repo: octocat/hello-world - tags: latest -+ secrets: -+ - source: docker_prod_password -+ target: docker_password + steps: + docker: + image: plugins/docker + repo: octocat/hello-world + tags: latest ++ secrets: ++ - source: docker_prod_password ++ target: docker_password ``` ### Use in Pull Requests events @@ -91,7 +91,7 @@ Secrets are added to the Woodpecker in the UI or with the CLI. Create the secret using default settings. The secret will be available to all images in your pipeline, and will be available to all push, tag, and deployment events (not pull request events). -```diff +```bash woodpecker-cli secret add \ -repository octocat/hello-world \ -name aws_access_key_id \ @@ -101,42 +101,42 @@ woodpecker-cli secret add \ Create the secret and limit to a single image: ```diff -woodpecker-cli secret add \ - -repository octocat/hello-world \ -+ -image plugins/s3 \ - -name aws_access_key_id \ - -value + woodpecker-cli secret add \ + -repository octocat/hello-world \ ++ -image plugins/s3 \ + -name aws_access_key_id \ + -value ``` Create the secrets and limit to a set of images: ```diff -woodpecker-cli secret add \ - -repository octocat/hello-world \ -+ -image plugins/s3 \ -+ -image peloton/woodpecker-ecs \ - -name aws_access_key_id \ - -value + woodpecker-cli secret add \ + -repository octocat/hello-world \ ++ -image plugins/s3 \ ++ -image peloton/woodpecker-ecs \ + -name aws_access_key_id \ + -value ``` Create the secret and enable for multiple hook events: ```diff -woodpecker-cli secret add \ - -repository octocat/hello-world \ - -image plugins/s3 \ -+ -event pull_request \ -+ -event push \ -+ -event tag \ - -name aws_access_key_id \ - -value + woodpecker-cli secret add \ + -repository octocat/hello-world \ + -image plugins/s3 \ ++ -event pull_request \ ++ -event push \ ++ -event tag \ + -name aws_access_key_id \ + -value ``` Loading secrets from file using curl `@` syntax. This is the recommended approach for loading secrets from file to preserve newlines: ```diff -woodpecker-cli secret add \ - -repository octocat/hello-world \ - -name ssh_key \ -+ -value @/root/ssh/id_rsa + woodpecker-cli secret add \ + -repository octocat/hello-world \ + -name ssh_key \ ++ -value @/root/ssh/id_rsa ``` diff --git a/docs/docs/20-usage/41-registries.md b/docs/docs/20-usage/41-registries.md index f0a69d6b6..9711c3519 100644 --- a/docs/docs/20-usage/41-registries.md +++ b/docs/docs/20-usage/41-registries.md @@ -53,7 +53,7 @@ It's possible to build a local image by mounting the docker socket as a volume. With a `Dockerfile` at the root of the project: -```diff +```yaml steps: build-image: image: docker diff --git a/docs/docs/20-usage/50-environment.md b/docs/docs/20-usage/50-environment.md index cf3352791..32096c5da 100644 --- a/docs/docs/20-usage/50-environment.md +++ b/docs/docs/20-usage/50-environment.md @@ -3,43 +3,45 @@ Woodpecker provides the ability to pass environment variables to individual pipeline steps. Note that these can't overwrite any existing, built-in variables. Example pipeline step with custom environment variables: ```diff -steps: - build: - image: golang -+ environment: -+ - CGO=0 -+ - GOOS=linux -+ - GOARCH=amd64 - commands: - - go build - - go test + steps: + build: + image: golang ++ environment: ++ - CGO=0 ++ - GOOS=linux ++ - GOARCH=amd64 + commands: + - go build + - go test ``` Please note that the environment section is not able to expand environment variables. If you need to expand variables they should be exported in the commands section. ```diff -steps: - build: - image: golang -- environment: -- - PATH=$PATH:/go - commands: -+ - export PATH=$PATH:/go - - go build - - go test + steps: + build: + image: golang +- environment: +- - PATH=$PATH:/go + commands: ++ - export PATH=$PATH:/go + - go build + - go test ``` -> Please be warned that `${variable}` expressions are subject to pre-processing. If you do not want the pre-processor to evaluate your expression it must be escaped: +:::warning +`${variable}` expressions are subject to pre-processing. If you do not want the pre-processor to evaluate your expression it must be escaped: +::: ```diff -steps: - build: - image: golang - commands: -- - export PATH=${PATH}:/go -+ - export PATH=$${PATH}:/go - - go build - - go test + steps: + build: + image: golang + commands: +- - export PATH=${PATH}:/go ++ - export PATH=$${PATH}:/go + - go build + - go test ``` ## Built-in environment variables @@ -139,27 +141,23 @@ This is the reference list of all environment variables available to your pipeli If you want specific environment variables to be available in all of your pipelines use the `WOODPECKER_ENVIRONMENT` setting on the Woodpecker server. Note that these can't overwrite any existing, built-in variables. -```diff -services: - woodpecker-server: - [...] - environment: - - [...] -+ - WOODPECKER_ENVIRONMENT=first_var:value1,second_var:value2 +```ini +WOODPECKER_ENVIRONMENT=first_var:value1,second_var:value2 ``` These can be used, for example, to manage the image tag used by multiple projects. +```ini +WOODPECKER_ENVIRONMENT=GOLANG_VERSION:1.18 +``` + ```diff -steps: - build: -- image: golang:1.18 -+ image: golang:${GOLANG_VERSION} - commands: - - [...] - environment: - - [...] -+ - WOODPECKER_ENVIRONMENT=GOLANG_VERSION:1.18 + steps: + build: +- image: golang:1.18 ++ image: golang:${GOLANG_VERSION} + commands: + - [...] ``` ## String Substitution @@ -169,21 +167,21 @@ Woodpecker provides the ability to substitute environment variables at runtime. Example commit substitution: ```diff -steps: - docker: - image: plugins/docker - settings: -+ tags: ${CI_COMMIT_SHA} + steps: + docker: + image: plugins/docker + settings: ++ tags: ${CI_COMMIT_SHA} ``` Example tag substitution: ```diff -steps: - docker: - image: plugins/docker - settings: -+ tags: ${CI_COMMIT_TAG} + steps: + docker: + image: plugins/docker + settings: ++ tags: ${CI_COMMIT_TAG} ``` ## String Operations @@ -207,19 +205,19 @@ Woodpecker also emulates bash string operations. This gives us the ability to ma Example variable substitution with substring: ```diff -steps: - docker: - image: plugins/docker - settings: -+ tags: ${CI_COMMIT_SHA:0:8} + steps: + docker: + image: plugins/docker + settings: ++ tags: ${CI_COMMIT_SHA:0:8} ``` Example variable substitution strips `v` prefix from `v.1.0.0`: ```diff -steps: - docker: - image: plugins/docker - settings: -+ tags: ${CI_COMMIT_TAG##v} + steps: + docker: + image: plugins/docker + settings: ++ tags: ${CI_COMMIT_TAG##v} ``` diff --git a/docs/docs/20-usage/51-plugins/10-plugins.md b/docs/docs/20-usage/51-plugins/10-overview.md similarity index 100% rename from docs/docs/20-usage/51-plugins/10-plugins.md rename to docs/docs/20-usage/51-plugins/10-overview.md diff --git a/docs/versioned_docs/version-2.1/20-usage/51-plugins/_category_.yml b/docs/docs/20-usage/51-plugins/_category_.yaml similarity index 83% rename from docs/versioned_docs/version-2.1/20-usage/51-plugins/_category_.yml rename to docs/docs/20-usage/51-plugins/_category_.yaml index e24478e85..ecdc198db 100644 --- a/docs/versioned_docs/version-2.1/20-usage/51-plugins/_category_.yml +++ b/docs/docs/20-usage/51-plugins/_category_.yaml @@ -4,4 +4,4 @@ collapsible: true collapsed: true link: type: 'doc' - id: 'plugins' + id: 'overview' diff --git a/docs/docs/20-usage/60-services.md b/docs/docs/20-usage/60-services.md index f2f157e07..3c8985f41 100644 --- a/docs/docs/20-usage/60-services.md +++ b/docs/docs/20-usage/60-services.md @@ -27,15 +27,15 @@ services: Service containers generally expose environment variables to customize service startup such as default usernames, passwords and ports. Please see the official image documentation to learn more. ```diff -services: - database: - image: mysql -+ environment: -+ - MYSQL_DATABASE=test -+ - MYSQL_ALLOW_EMPTY_PASSWORD=yes + services: + database: + image: mysql ++ environment: ++ - MYSQL_DATABASE=test ++ - MYSQL_ALLOW_EMPTY_PASSWORD=yes - cache: - image: redis + cache: + image: redis ``` ## Detachment @@ -43,21 +43,21 @@ services: Service and long running containers can also be included in the pipeline section of the configuration using the detach parameter without blocking other steps. This should be used when explicit control over startup order is required. ```diff -steps: - build: - image: golang - commands: - - go build - - go test + steps: + build: + image: golang + commands: + - go build + - go test - database: - image: redis -+ detach: true + database: + image: redis ++ detach: true - test: - image: golang - commands: - - go test + test: + image: golang + commands: + - go test ``` Containers from detached steps will terminate when the pipeline ends. @@ -67,17 +67,17 @@ Containers from detached steps will terminate when the pipeline ends. Service containers require time to initialize and begin to accept connections. If you are unable to connect to a service you may need to wait a few seconds or implement a backoff. ```diff -steps: - test: - image: golang - commands: -+ - sleep 15 - - go get - - go test + steps: + test: + image: golang + commands: ++ - sleep 15 + - go get + - go test -services: - database: - image: mysql + services: + database: + image: mysql ``` ## Complete Pipeline Example diff --git a/docs/docs/20-usage/70-volumes.md b/docs/docs/20-usage/70-volumes.md index 297f14ec0..989f416e1 100644 --- a/docs/docs/20-usage/70-volumes.md +++ b/docs/docs/20-usage/70-volumes.md @@ -7,21 +7,21 @@ Volumes are only available to trusted repositories and for security reasons shou ::: ```diff -steps: - build: - image: docker - commands: - - docker build --rm -t octocat/hello-world . - - docker run --rm octocat/hello-world --test - - docker push octocat/hello-world - - docker rmi octocat/hello-world - volumes: -+ - /var/run/docker.sock:/var/run/docker.sock + steps: + build: + image: docker + commands: + - docker build --rm -t octocat/hello-world . + - docker run --rm octocat/hello-world --test + - docker push octocat/hello-world + - docker rmi octocat/hello-world + volumes: ++ - /var/run/docker.sock:/var/run/docker.sock ``` Please note that Woodpecker mounts volumes on the host machine. This means you must use absolute paths when you configure volumes. Attempting to use relative paths will result in an error. ```diff -- volumes: [ ./certs:/etc/ssl/certs ] -+ volumes: [ /etc/ssl/certs:/etc/ssl/certs ] +-volumes: [ ./certs:/etc/ssl/certs ] ++volumes: [ /etc/ssl/certs:/etc/ssl/certs ] ``` diff --git a/docs/docs/20-usage/71-project-settings.md b/docs/docs/20-usage/71-project-settings.md index 41bab0dd5..f09402b61 100644 --- a/docs/docs/20-usage/71-project-settings.md +++ b/docs/docs/20-usage/71-project-settings.md @@ -6,7 +6,7 @@ As the owner of a project in Woodpecker you can change project related settings ## Pipeline path -The path to the pipeline config file or folder. By default it is left empty which will use the following configuration resolution `.woodpecker/*.yml` -> `.woodpecker/*.yaml` -> `.woodpecker.yml` -> `.woodpecker.yaml`. If you set a custom path Woodpecker tries to load your configuration or fails if no configuration could be found at the specified location. To use a [multiple workflows](./25-workflows.md) with a custom path you have to change it to a folder path ending with a `/` like `.woodpecker/`. +The path to the pipeline config file or folder. By default it is left empty which will use the following configuration resolution `.woodpecker/*.{yaml,yml}` -> `.woodpecker.yaml` -> `.woodpecker.yml`. If you set a custom path Woodpecker tries to load your configuration or fails if no configuration could be found at the specified location. To use a [multiple workflows](./25-workflows.md) with a custom path you have to change it to a folder path ending with a `/` like `.woodpecker/`. ## Repository hooks diff --git a/docs/docs/20-usage/80-badges.md b/docs/docs/20-usage/80-badges.md index 1edfcfd49..1bee62a58 100644 --- a/docs/docs/20-usage/80-badges.md +++ b/docs/docs/20-usage/80-badges.md @@ -4,7 +4,7 @@ Woodpecker has integrated support for repository status badges. These badges can ## Badge endpoint -```text +```uri :///api/badges//status.svg ``` diff --git a/docs/docs/20-usage/90-advanced-usage.md b/docs/docs/20-usage/90-advanced-usage.md index 56b1a153d..8855e4430 100644 --- a/docs/docs/20-usage/90-advanced-usage.md +++ b/docs/docs/20-usage/90-advanced-usage.md @@ -118,17 +118,12 @@ steps: - echo $FOO ``` -## Declaring global variables in `docker-compose.yml` +## Declaring global variables -As described in [Global environment variables](./50-environment.md#global-environment-variables), one can define global variables: +As described in [Global environment variables](./50-environment.md#global-environment-variables), you can define global variables: -```yaml -services: - woodpecker-server: - # ... - environment: - - WOODPECKER_ENVIRONMENT=first_var:value1,second_var:value2 - # ... +```ini +WOODPECKER_ENVIRONMENT=first_var:value1,second_var:value2 ``` Note that this tightly couples the server and app configurations (where the app is a completely separate application). But this is a good option for truly global variables which should apply to all steps in all pipelines for all apps. diff --git a/docs/docs/20-usage/_category_.yml b/docs/docs/20-usage/_category_.yaml similarity index 100% rename from docs/docs/20-usage/_category_.yml rename to docs/docs/20-usage/_category_.yaml diff --git a/docs/docs/30-administration/00-deployment/10-docker-compose.md b/docs/docs/30-administration/00-deployment/10-docker-compose.md index ea78f1ca1..2212f7b2f 100644 --- a/docs/docs/30-administration/00-deployment/10-docker-compose.md +++ b/docs/docs/30-administration/00-deployment/10-docker-compose.md @@ -4,7 +4,7 @@ The below [docker-compose](https://docs.docker.com/compose/) configuration can b It relies on a number of environment variables that you must set before running `docker-compose up`. The variables are described below. -```yaml title="docker-compose.yml" +```yaml title="docker-compose.yaml" version: '3' services: @@ -42,85 +42,85 @@ volumes: Woodpecker needs to know its own address. You must therefore provide the public address of it in `://` format. Please omit trailing slashes: -```diff title="docker-compose.yml" -version: '3' +```diff title="docker-compose.yaml" + version: '3' -services: - woodpecker-server: - [...] - environment: - - [...] -+ - WOODPECKER_HOST=${WOODPECKER_HOST} + services: + woodpecker-server: + [...] + environment: + - [...] ++ - WOODPECKER_HOST=${WOODPECKER_HOST} ``` Woodpecker can also have its port's configured. It uses a separate port for gRPC and for HTTP. The agent performs gRPC calls and connects to the gRPC port. -They can be configured with ADDR variables: +They can be configured with `*_ADDR` variables: -```diff title="docker-compose.yml" -version: '3' -services: - woodpecker-server: - [...] - environment: - - [...] -+ - WOODPECKER_GRPC_ADDR=${WOODPECKER_GRPC_ADDR} -+ - WOODPECKER_SERVER_ADDR=${WOODPECKER_HTTP_ADDR} +```diff title="docker-compose.yaml" + version: '3' + services: + woodpecker-server: + [...] + environment: + - [...] ++ - WOODPECKER_GRPC_ADDR=${WOODPECKER_GRPC_ADDR} ++ - WOODPECKER_SERVER_ADDR=${WOODPECKER_HTTP_ADDR} ``` Reverse proxying can also be [configured for gRPC](../proxy#caddy). If the agents are connecting over the internet, it should also be SSL encrypted. The agent then needs to be configured to be secure: -```diff title="docker-compose.yml" -version: '3' -services: - woodpecker-server: - [...] - environment: - - [...] -+ - WOODPECKER_GRPC_SECURE=true # defaults to false -+ - WOODPECKER_GRPC_VERIFY=true # default +```diff title="docker-compose.yaml" + version: '3' + services: + woodpecker-server: + [...] + environment: + - [...] ++ - WOODPECKER_GRPC_SECURE=true # defaults to false ++ - WOODPECKER_GRPC_VERIFY=true # default ``` As agents run pipeline steps as docker containers they require access to the host machine's Docker daemon: -```diff title="docker-compose.yml" -version: '3' +```diff title="docker-compose.yaml" + version: '3' -services: - [...] - woodpecker-agent: - [...] -+ volumes: -+ - /var/run/docker.sock:/var/run/docker.sock + services: + [...] + woodpecker-agent: + [...] ++ volumes: ++ - /var/run/docker.sock:/var/run/docker.sock ``` Agents require the server address for agent-to-server communication. The agent connects to the server's gRPC port: -```diff title="docker-compose.yml" -version: '3' +```diff title="docker-compose.yaml" + version: '3' -services: - woodpecker-agent: - [...] - environment: -+ - WOODPECKER_SERVER=woodpecker-server:9000 + services: + woodpecker-agent: + [...] + environment: ++ - WOODPECKER_SERVER=woodpecker-server:9000 ``` 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 title="docker-compose.yml" -version: '3' +```diff title="docker-compose.yaml" + version: '3' -services: - woodpecker-server: - [...] - environment: - - [...] -+ - WOODPECKER_AGENT_SECRET=${WOODPECKER_AGENT_SECRET} - woodpecker-agent: - [...] - environment: - - [...] -+ - WOODPECKER_AGENT_SECRET=${WOODPECKER_AGENT_SECRET} + services: + woodpecker-server: + [...] + environment: + - [...] ++ - WOODPECKER_AGENT_SECRET=${WOODPECKER_AGENT_SECRET} + woodpecker-agent: + [...] + environment: + - [...] ++ - WOODPECKER_AGENT_SECRET=${WOODPECKER_AGENT_SECRET} ``` ## Docker images @@ -130,7 +130,7 @@ Image variants: - The `latest` image is the latest stable release - The `vX.X.X` images are stable releases - 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 +- The `next` images are based on the current `main` branch ```bash # server diff --git a/docs/docs/30-administration/00-deployment/_category_.yml b/docs/docs/30-administration/00-deployment/_category_.yaml similarity index 100% rename from docs/docs/30-administration/00-deployment/_category_.yml rename to docs/docs/30-administration/00-deployment/_category_.yaml diff --git a/docs/docs/30-administration/10-server-config.md b/docs/docs/30-administration/10-server-config.md index af96f5bcc..be40ddb7d 100644 --- a/docs/docs/30-administration/10-server-config.md +++ b/docs/docs/30-administration/10-server-config.md @@ -12,63 +12,36 @@ Registration is closed by default (`WOODPECKER_OPEN=false`). If registration is To open registration: -```diff title="docker-compose.yml" -version: '3' - -services: - woodpecker-server: - [...] - environment: - - [...] -+ - WOODPECKER_OPEN=true +```ini +WOODPECKER_OPEN=true ``` -You can **also restrict** registration, by keep registration closed and ...\ -... **adding** new **users manually** via the CLI: `woodpecker-cli user add`, or\ -... allowing specific **admin users** via the `WOODPECKER_ADMIN` setting, or\ -by open registration and **filter by organization** membership through the `WOODPECKER_ORGS` setting. +You can **also restrict** registration, by keep registration closed and: -### To close registration, but allow specific admin users +- **adding** new **users manually** via the CLI: `woodpecker-cli user add` +- allowing specific **admin users** via the `WOODPECKER_ADMIN` setting +- by open registration and **filter by organization** membership through the `WOODPECKER_ORGS` setting -```diff title="docker-compose.yml" -version: '3' +### Close registration, but allow specific admin users -services: - woodpecker-server: - [...] - environment: - - [...] -+ - WOODPECKER_OPEN=false -+ - WOODPECKER_ADMIN=johnsmith,janedoe +```ini +WOODPECKER_OPEN=false +WOODPECKER_ADMIN=johnsmith,janedoe ``` -### To only allow registration of users, who are members of approved organizations +### Only allow registration of users, who are members of approved organizations -```diff title="docker-compose.yml" -version: '3' - -services: - woodpecker-server: - [...] - environment: - - [...] -+ - WOODPECKER_OPEN=true -+ - WOODPECKER_ORGS=dolores,dogpatch +```ini +WOODPECKER_OPEN=true +WOODPECKER_ORGS=dolores,dogpatch ``` ## Administrators Administrators should also be enumerated in your configuration. -```diff title="docker-compose.yml" -version: '3' - -services: - woodpecker-server: - [...] - environment: - - [...] -+ - WOODPECKER_ADMIN=johnsmith,janedoe +```ini +WOODPECKER_ADMIN=johnsmith,janedoe ``` ## Filtering repositories @@ -77,15 +50,8 @@ 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. -```diff title="docker-compose.yml" -version: '3' - -services: - woodpecker-server: - [...] - environment: - - [...] -+ - WOODPECKER_REPO_OWNERS=mycompany,mycompanyossgithubuser +```ini +WOODPECKER_REPO_OWNERS=mycompany,mycompanyossgithubuser ``` ## Global registry setting @@ -93,67 +59,62 @@ services: If you want to make available a specific private registry to all pipelines, use the `WOODPECKER_DOCKER_CONFIG` server configuration. Point it to your server's docker config. -```diff title="docker-compose.yml" -version: '3' - -services: - woodpecker-server: - [...] - volumes: - - [...] -+ - /home/user/.docker/config.json:/root/.docker/config.json:ro - environment: - - [...] -+ - WOODPECKER_DOCKER_CONFIG=/root/.docker/config.json +```ini +WOODPECKER_DOCKER_CONFIG=/root/.docker/config.json ``` ## Handling sensitive data in docker-compose and docker-swarm To handle sensitive data in docker-compose or docker-swarm configurations there are several options: -For docker-compose you can use a .env file next to your compose configuration to store the secrets outside of the compose file. While this separates configuration from secrets it is still not very secure. +For docker-compose you can use a `.env` file next to your compose configuration to store the secrets outside of the compose file. While this separates configuration from secrets it is still not very secure. Alternatively use docker-secrets. As it may be difficult to use docker secrets for environment variables woodpecker allows to read sensible data from files by providing a `*_FILE` option of all sensible configuration variables. Woodpecker will try to read the value directly from this file. Keep in mind that when the original environment variable gets specified at the same time it will override the value read from the file. -```diff title="docker-compose.yml" -version: '3' +```diff title="docker-compose.yaml" + version: '3' -services: - woodpecker-server: - [...] - environment: - - [...] -+ - WOODPECKER_AGENT_SECRET_FILE=/run/secrets/woodpecker-agent-secret -+ secrets: -+ - woodpecker-agent-secret + services: + woodpecker-server: + [...] + environment: + - [...] ++ - WOODPECKER_AGENT_SECRET_FILE=/run/secrets/woodpecker-agent-secret ++ secrets: ++ - woodpecker-agent-secret + -+secrets: -+ woodpecker-agent-secret: -+ external: true ++ secrets: ++ woodpecker-agent-secret: ++ external: true ``` Store a value to a docker secret like this: -`echo "my_agent_secret_key" | docker secret create woodpecker-agent-secret -` + +```bash +echo "my_agent_secret_key" | docker secret create woodpecker-agent-secret - +``` or generate a random one like this: -`openssl rand -hex 32 | docker secret create woodpecker-agent-secret -` +```bash +openssl rand -hex 32 | docker secret create woodpecker-agent-secret - +``` -## Custom Javascript and CSS Styling (a.k.a. white-labeling) +## Custom JavaScript and CSS -Woodpecker supports custom styling of the Web UI by providing custom JS and CSS files. +Woodpecker supports custom JS and CSS files. These files must be present in the server's filesystem. They can be backed in a Docker image or mounted from a ConfigMap inside a Kubernetes environment. The configuration variables are independent of each other, which means it can be just one file present, or both. -```text +```ini WOODPECKER_CUSTOM_CSS_FILE=/usr/local/www/woodpecker.css -WOODPECKER_CUSTOM_CSS_FILE=/usr/local/www/woodpecker.js +WOODPECKER_CUSTOM_JS_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 +### `woodpecker.css` ```css .banner-message { @@ -169,7 +130,7 @@ The examples below show how to place a banner message in the top navigation bar } ``` -### woodpecker.js +### `woodpecker.js` ```javascript // place/copy a minified version of jQuery or ZeptoJS here ... @@ -532,7 +493,7 @@ Supported variables: - `owner`: the repo's owner - `repo`: the repo's name -### WOODPECKER_ADDONS +### `WOODPECKER_ADDONS` > Default: empty diff --git a/docs/docs/30-administration/100-external-configuration-api.md b/docs/docs/30-administration/100-external-configuration-api.md index 47e6277ac..a5e216159 100644 --- a/docs/docs/30-administration/100-external-configuration-api.md +++ b/docs/docs/30-administration/100-external-configuration-api.md @@ -13,9 +13,7 @@ You need to trust the external config service as it is getting secret informatio ## Config -```bash -# Server -# ... +```ini title="Server" WOODPECKER_CONFIG_SERVICE_ENDPOINT=https://example.com/ciconfig ``` @@ -85,8 +83,8 @@ WOODPECKER_CONFIG_SERVICE_ENDPOINT=https://example.com/ciconfig }, "configs": [ { - "name": ".woodpecker.yml", - "data": "steps:\n backend:\n image: alpine\n commands:\n - echo \"Hello there from Repo (.woodpecker.yml)\"\n" + "name": ".woodpecker.yaml", + "data": "steps:\n backend:\n image: alpine\n commands:\n - echo \"Hello there from Repo (.woodpecker.yaml)\"\n" } ] } diff --git a/docs/docs/30-administration/11-forges/20-github.md b/docs/docs/30-administration/11-forges/20-github.md index f2c474ce3..a3e4abded 100644 --- a/docs/docs/30-administration/11-forges/20-github.md +++ b/docs/docs/30-administration/11-forges/20-github.md @@ -3,7 +3,7 @@ Woodpecker comes with built-in support for GitHub and GitHub Enterprise. To use Woodpecker with GitHub the following environment variables should be set for the server component: -```bash +```ini WOODPECKER_GITHUB=true WOODPECKER_GITHUB_CLIENT=YOUR_GITHUB_CLIENT_ID WOODPECKER_GITHUB_SECRET=YOUR_GITHUB_CLIENT_SECRET diff --git a/docs/docs/30-administration/11-forges/30-gitea.md b/docs/docs/30-administration/11-forges/30-gitea.md index a9b91838d..1bae1bd38 100644 --- a/docs/docs/30-administration/11-forges/30-gitea.md +++ b/docs/docs/30-administration/11-forges/30-gitea.md @@ -2,24 +2,14 @@ Woodpecker comes with built-in support for Gitea and the "soft" fork Forgejo. To enable Gitea you should configure the Woodpecker container using the following environment variables: -```diff title="docker-compose.yml" -version: '3' - -services: - woodpecker-server: - [...] - environment: - - [...] -+ - WOODPECKER_GITEA=true -+ - WOODPECKER_GITEA_URL=${WOODPECKER_GITEA_URL} -+ - WOODPECKER_GITEA_CLIENT=${WOODPECKER_GITEA_CLIENT} -+ - WOODPECKER_GITEA_SECRET=${WOODPECKER_GITEA_SECRET} - - woodpecker-agent: - [...] +```ini +WOODPECKER_GITEA=true +WOODPECKER_GITEA_URL=YOUR_GITEA_URL +WOODPECKER_GITEA_CLIENT=YOUR_GITEA_CLIENT +WOODPECKER_GITEA_SECRET=YOUR_GITEA_CLIENT_SECRET ``` -## Gitea on the same host +## Gitea on the same host with containers If you have Gitea also running on the same host within a container, make sure the agent does have access to it. The agent tries to clone using the URL which Gitea reports through its API. For simplified connectivity, you should add the woodpecker agent to the same docker network as Gitea is in. @@ -27,16 +17,16 @@ Otherwise, the communication should go via the `docker0` gateway (usually 172.17 To configure the Docker network if the network's name is `gitea`, configure it like this: -```diff title="docker-compose.yml" -version: '3' +```diff title="docker-compose.yaml" + version: '3' -services: - [...] - woodpecker-agent: - [...] - environment: - - [...] -+ - WOODPECKER_BACKEND_DOCKER_NETWORK=gitea + services: + [...] + woodpecker-agent: + [...] + environment: + - [...] ++ - WOODPECKER_BACKEND_DOCKER_NETWORK=gitea ``` ## Registration @@ -46,7 +36,6 @@ Register your application with Gitea to create your client id and secret. You ca 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 ``` diff --git a/docs/docs/30-administration/11-forges/40-gitlab.md b/docs/docs/30-administration/11-forges/40-gitlab.md index a3934489d..7c55d6263 100644 --- a/docs/docs/30-administration/11-forges/40-gitlab.md +++ b/docs/docs/30-administration/11-forges/40-gitlab.md @@ -2,20 +2,11 @@ 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 title="docker-compose.yml" -version: '3' - -services: - woodpecker-server: - [...] - environment: -+ - WOODPECKER_GITLAB=true -+ - WOODPECKER_GITLAB_URL=http://gitlab.mycompany.com -+ - WOODPECKER_GITLAB_CLIENT=95c0282573633eb25e82 -+ - WOODPECKER_GITLAB_SECRET=30f5064039e6b359e075 - - woodpecker-agent: - [...] +```ini +WOODPECKER_GITLAB=true +WOODPECKER_GITLAB_URL=http://gitlab.mycompany.com +WOODPECKER_GITLAB_CLIENT=95c0282573633eb25e82 +WOODPECKER_GITLAB_SECRET=30f5064039e6b359e075 ``` ## Registration diff --git a/docs/docs/30-administration/11-forges/50-bitbucket.md b/docs/docs/30-administration/11-forges/50-bitbucket.md index 05912c1ce..8d153258a 100644 --- a/docs/docs/30-administration/11-forges/50-bitbucket.md +++ b/docs/docs/30-administration/11-forges/50-bitbucket.md @@ -2,20 +2,10 @@ 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 title="docker-compose.yml" -version: '3' - -services: - woodpecker-server: - [...] - environment: - - [...] -+ - WOODPECKER_BITBUCKET=true -+ - WOODPECKER_BITBUCKET_CLIENT=... # called "Key" in Bitbucket -+ - WOODPECKER_BITBUCKET_SECRET=... - - woodpecker-agent: - [...] +```ini +WOODPECKER_BITBUCKET=true +WOODPECKER_BITBUCKET_CLIENT=... # called "Key" in Bitbucket +WOODPECKER_BITBUCKET_SECRET=... ``` ## Registration @@ -24,7 +14,7 @@ You must register an OAuth application at Bitbucket in order to get a key and se Please set a name and set the `Callback URL` like this: -```nohighlight +```uri https:///authorize ``` @@ -32,14 +22,12 @@ https:///authorize Please also be sure to check the following permissions: -```nohighlight -Account: Email, Read -Workspace membership: Read -Projects: Read -Repositories: Read -Pull requests: Read -Webhooks: Read and Write -``` +- Account: Email, Read +- Workspace membership: Read +- Projects: Read +- Repositories: Read +- Pull requests: Read +- Webhooks: Read and Write ![bitbucket permissions](bitbucket_permissions.png) @@ -79,5 +67,5 @@ Read the value for `WOODPECKER_BITBUCKET_SECRET` from the specified filepath ## Missing Features -Merge requests are not currently supported. We are interested in patches to include this functionality. +Path filters for pull requests are not 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** via [Discord](https://discord.gg/fcMQqSMXJy) or [Matrix](https://matrix.to/#/#WoodpeckerCI-Develop:obermui.de). diff --git a/docs/docs/30-administration/11-forges/_category_.yml b/docs/docs/30-administration/11-forges/_category_.yaml similarity index 100% rename from docs/docs/30-administration/11-forges/_category_.yml rename to docs/docs/30-administration/11-forges/_category_.yaml diff --git a/docs/docs/30-administration/15-agent-config.md b/docs/docs/30-administration/15-agent-config.md index 89bb6f9a8..26005eaf5 100644 --- a/docs/docs/30-administration/15-agent-config.md +++ b/docs/docs/30-administration/15-agent-config.md @@ -6,38 +6,24 @@ toc_max_heading_level: 2 Agents are configured by the command line or environment variables. At the minimum you need the following information: -```diff title="docker-compose.yml" -version: '3' - -services: - woodpecker-agent: - [...] - volumes: - - woodpecker-agent-config:/etc/woodpecker - environment: -+ - WOODPECKER_SERVER=localhost:9000 -+ - WOODPECKER_AGENT_SECRET="your-shared-secret-goes-here" +```ini +WOODPECKER_SERVER=localhost:9000 +WOODPECKER_AGENT_SECRET="your-shared-secret-goes-here" ``` The following are automatically set and can be overridden: -- WOODPECKER_HOSTNAME if not set, becomes the OS' hostname -- WOODPECKER_MAX_WORKFLOWS if not set, defaults to 1 +- `WOODPECKER_HOSTNAME` if not set, becomes the OS' hostname +- `WOODPECKER_MAX_WORKFLOWS` if not set, defaults to 1 ## Workflows per agent By default, the maximum workflows that are executed in parallel on an agent is 1. If required, you can add `WOODPECKER_MAX_WORKFLOWS` to increase your parallel processing for an agent. -```diff title="docker-compose.yml" -version: '3' - -services: - woodpecker-agent: - [...] - environment: - - WOODPECKER_SERVER=localhost:9000 - - WOODPECKER_AGENT_SECRET="your-shared-secret-goes-here" -+ - WOODPECKER_MAX_WORKFLOWS=4 +```ini +WOODPECKER_SERVER=localhost:9000 +WOODPECKER_AGENT_SECRET="your-shared-secret-goes-here" +WOODPECKER_MAX_WORKFLOWS=4 ``` ## Agent registration @@ -182,7 +168,7 @@ Configures if the gRPC server certificate should be verified, only valid when `W Configures the backend engine to run pipelines on. Possible values are `auto-detect`, `docker`, `local` or `kubernetes`. -### WOODPECKER_ADDONS +### `WOODPECKER_ADDONS` > Default: empty diff --git a/docs/docs/30-administration/22-backends/10-docker.md b/docs/docs/30-administration/22-backends/10-docker.md index 482d6caa7..faa9e3d91 100644 --- a/docs/docs/30-administration/22-backends/10-docker.md +++ b/docs/docs/30-administration/22-backends/10-docker.md @@ -22,14 +22,12 @@ RUN apk add -U --no-cache docker-credential-ecr-login While the agent was developed with Docker/Moby, Podman can also be used by setting the environment variable `DOCKER_HOST` to point to the Podman socket. In order to work without workarounds, Podman 4.0 (or above) is required. -## Image Cleanup +## Image cleanup The agent **will not** automatically remove images from the host. This task should be managed by the host system. For example, you can use a cron job to periodically do clean-up tasks for the CI runner. :::danger - The following commands **are destructive** and **irreversible** it is highly recommended that you test these commands on your system before running them in production via a cron job or other automation. - ::: ### Remove all unused images @@ -38,7 +36,7 @@ The following commands **are destructive** and **irreversible** it is highly rec docker image rm $(docker images --filter "dangling=true" -q --no-trunc) ``` -### Remove Woodpecker Volumes +### Remove Woodpecker volumes ```bash docker volume rm $(docker volume ls --filter name=^wp_* --filter dangling=true -q) diff --git a/docs/docs/30-administration/22-backends/20-local.md b/docs/docs/30-administration/22-backends/20-local.md index 70dc57864..c2d229d57 100644 --- a/docs/docs/30-administration/22-backends/20-local.md +++ b/docs/docs/30-administration/22-backends/20-local.md @@ -29,65 +29,29 @@ In order to use this backend, you need to download (or build) the [binary](https://github.com/woodpecker-ci/woodpecker/releases/latest) of the agent, configure it and run it on the host machine. -## Configuration +## Usage -### Server - -Enable connection to the server from the outside of the docker environment by -exposing the port 9000: - -```yaml title="docker-compose.yml" for the server -version: '3' - -services: - woodpecker-server: - [...] - ports: - - 9000:9000 - [...] - environment: - - [...] -``` - -### Agent - -You can use the `.env` file to store environmental variables for configuration. -At the minimum you need the following information: +To enable the local backend, add this to your configuration: ```ini -# .env for the agent -WOODPECKER_AGENT_SECRET=replace_with_your_server_secret -WOODPECKER_SERVER=replace_with_your_server_address:9000 +WOODPECKER_BACKEND=local ``` -## Running the agent - -Start the agent from the directory with the `.env` file: - -`woodpecker-agent` - -:::note -When using the `local` backend, the -[plugin-git](https://github.com/woodpecker-ci/plugin-git) binary must be in -your `$PATH` for the default clone step to work. If not, you can still write a -manual clone step. -::: - -## Further configuration - -### Specify the shell to be used for a pipeline step +### Shell The `image` entry is used to specify the shell, such as Bash or Fish, that is used to run the commands. -```yaml title=".woodpecker.yml" +```yaml title=".woodpecker.yaml" steps: build: image: bash commands: [...] ``` -### Plugins as Executable Binaries +### Plugins + +Plugins are just executable binaries: ```yaml steps: @@ -98,35 +62,10 @@ steps: If no commands are provided, we treat them as plugins in the usual manner. In the context of the local backend, plugins are simply executable binaries, which can be located using their name if they are listed in `$PATH`, or through an absolute path. -### Using labels to filter tasks +### Options -You can use the [agent configuration options](../15-agent-config.md#woodpecker_filter_labels) -and the [pipeline syntax](../../20-usage/20-workflow-syntax.md#labels) to only run certain -pipelines on certain agents. Example: +#### `WOODPECKER_BACKEND_LOCAL_TEMP_DIR` -Define a `label` `type` with value `exec` for a particular agent: +> Default: default temp directory -```ini -# .env for the agent - -WOODPECKER_FILTER_LABELS=type=exec -``` - -Then, use this `label` `type` with value `exec` in the pipeline definition, to -only run on this agent: - -```yaml title=".woodpecker.yml" -labels: - type: exec - -steps: [...] -``` - -### Change temp directory - -We use the default temp directory to create folders for workflows. -This directory can be changed by: - -```env -WOODPECKER_BACKEND_LOCAL_TEMP_DIR=/some/other/dir -``` +Directory to create folders for workflows. diff --git a/docs/docs/30-administration/22-backends/40-kubernetes.md b/docs/docs/30-administration/22-backends/40-kubernetes.md index d2e5cc37a..b4cba009a 100644 --- a/docs/docs/30-administration/22-backends/40-kubernetes.md +++ b/docs/docs/30-administration/22-backends/40-kubernetes.md @@ -32,12 +32,12 @@ steps: cpu: 1000m ``` -### serviceAccountName +### `serviceAccountName` Specify the name of the ServiceAccount which the build pod will mount. This serviceAccount must be created externally. See the [kubernetes documentation](https://kubernetes.io/docs/concepts/security/service-accounts/) for more information on using serviceAccounts. -### nodeSelector +### `nodeSelector` Specifies the label which is used to select the node on which the job will be executed. @@ -66,7 +66,7 @@ And then overwrite the `nodeSelector` in the `backend_options` section of the st kubernetes.io/arch: "${ARCH}" ``` -### tolerations +### `tolerations` When you use nodeSelector and the node pool is configured with Taints, you need to specify the Tolerations. Tolerations allow the scheduler to schedule pods with matching taints. See the [kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) for more information on using tolerations. diff --git a/docs/docs/30-administration/22-backends/_category_.yml b/docs/docs/30-administration/22-backends/_category_.yaml similarity index 100% rename from docs/docs/30-administration/22-backends/_category_.yml rename to docs/docs/30-administration/22-backends/_category_.yaml diff --git a/docs/docs/30-administration/30-database.md b/docs/docs/30-administration/30-database.md index 1da4bc185..e3e33ba7d 100644 --- a/docs/docs/30-administration/30-database.md +++ b/docs/docs/30-administration/30-database.md @@ -4,16 +4,16 @@ The default database engine of Woodpecker is an embedded SQLite database which r ## Configure SQLite -By default Woodpecker uses a SQLite database stored under `/var/lib/woodpecker/`. 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/woodpecker/`. If using containers, you can mount a [data volume](https://docs.docker.com/storage/volumes/#create-and-manage-volumes) to persist the SQLite database. -```diff title="docker-compose.yml" -version: '3' +```diff title="docker-compose.yaml" + version: '3' -services: - woodpecker-server: - [...] -+ volumes: -+ - woodpecker-server-data:/var/lib/woodpecker/ + services: + woodpecker-server: + [...] ++ volumes: ++ - woodpecker-server-data:/var/lib/woodpecker/ ``` ## Configure MySQL/MariaDB @@ -21,15 +21,9 @@ 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 minimum version of MySQL/MariaDB required is determined by the `go-sql-driver/mysql` - see [it's README](https://github.com/go-sql-driver/mysql#requirements) for more information. -```diff title="docker-compose.yml" -version: '3' - -services: - woodpecker-server: - [...] - environment: -+ - WOODPECKER_DATABASE_DRIVER=mysql -+ - WOODPECKER_DATABASE_DATASOURCE=root:password@tcp(1.2.3.4:3306)/woodpecker?parseTime=true +```ini +WOODPECKER_DATABASE_DRIVER=mysql +WOODPECKER_DATABASE_DATASOURCE=root:password@tcp(1.2.3.4:3306)/woodpecker?parseTime=true ``` ## Configure Postgres @@ -37,20 +31,14 @@ 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. Please use Postgres versions equal or higher than **11**. -```diff title="docker-compose.yml" -version: '3' - -services: - woodpecker-server: - [...] - environment: -+ - WOODPECKER_DATABASE_DRIVER=postgres -+ - WOODPECKER_DATABASE_DATASOURCE=postgres://root:password@1.2.3.4:5432/postgres?sslmode=disable +```ini +WOODPECKER_DATABASE_DRIVER=postgres +WOODPECKER_DATABASE_DATASOURCE=postgres://root:password@1.2.3.4:5432/postgres?sslmode=disable ``` ## Database Creation -Woodpecker does not create your database automatically. If you are using the MySQL or Postgres driver you will need to manually create your database using `CREATE DATABASE` +Woodpecker does not create your database automatically. If you are using the MySQL or Postgres driver you will need to manually create your database using `CREATE DATABASE`. ## Database Migration diff --git a/docs/docs/30-administration/60-ssl.md b/docs/docs/30-administration/60-ssl.md index 8b6a3315e..74de21023 100644 --- a/docs/docs/30-administration/60-ssl.md +++ b/docs/docs/30-administration/60-ssl.md @@ -9,20 +9,9 @@ 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: -```diff title="docker-compose.yml" -version: '3' - -services: - woodpecker-server: - [...] - ports: -+ - 80:80 -+ - 443:443 - - 9000:9000 - environment: - - [...] -+ - WOODPECKER_LETS_ENCRYPT=true -+ - WOODPECKER_LETS_ENCRYPT_EMAIL=ssl-admin@example.tld +```ini +WOODPECKER_LETS_ENCRYPT=true +WOODPECKER_LETS_ENCRYPT_EMAIL=ssl-admin@example.tld ``` Note that Woodpecker uses the hostname from the `WOODPECKER_HOST` environment variable when requesting certificates. For example, if `WOODPECKER_HOST=https://example.com` is set the certificate is requested for `example.com`. To receive emails before certificates expire Let's Encrypt requires an email address. You can set it with `WOODPECKER_LETS_ENCRYPT_EMAIL=ssl-admin@example.tld`. @@ -43,74 +32,9 @@ Woodpecker uses the official Go acme library which will handle certificate upgra Woodpecker supports SSL configuration by mounting certificates into your container. -```diff title="docker-compose.yml" -version: '3' - -services: - woodpecker-server: - [...] - ports: -+ - 80:80 -+ - 443:443 - - 9000:9000 - volumes: -+ - /etc/certs/woodpecker.example.com/server.crt:/etc/certs/woodpecker.example.com/server.crt -+ - /etc/certs/woodpecker.example.com/server.key:/etc/certs/woodpecker.example.com/server.key - environment: - - [...] -+ - WOODPECKER_SERVER_CERT=/etc/certs/woodpecker.example.com/server.crt -+ - WOODPECKER_SERVER_KEY=/etc/certs/woodpecker.example.com/server.key -``` - -Update your configuration to expose the following ports: - -```diff title="docker-compose.yml" -version: '3' - -services: - woodpecker-server: - [...] - ports: -+ - 80:80 -+ - 443:443 - - 9000:9000 -``` - -Update your configuration to mount your certificate and key: - -```diff title="docker-compose.yml" -version: '3' - -services: - woodpecker-server: - [...] - ports: - - 80:80 - - 443:443 - - 9000:9000 - volumes: -+ - /etc/certs/woodpecker.example.com/server.crt:/etc/certs/woodpecker.example.com/server.crt -+ - /etc/certs/woodpecker.example.com/server.key:/etc/certs/woodpecker.example.com/server.key -``` - -Update your configuration to provide the paths of your certificate and key: - -```yaml title="docker-compose.yml" -version: '3' - -services: - woodpecker-server: - [...] - ports: - - 80:80 - - 443:443 - - 9000:9000 - volumes: - - /etc/certs/woodpecker.example.com/server.crt:/etc/certs/woodpecker.example.com/server.crt - - /etc/certs/woodpecker.example.com/server.key:/etc/certs/woodpecker.example.com/server.key - environment: -+ - WOODPECKER_SERVER_CERT=/etc/certs/woodpecker.example.com/server.crt -+ - WOODPECKER_SERVER_KEY=/etc/certs/woodpecker.example.com/server.key +```ini +WOODPECKER_SERVER_CERT=/etc/certs/woodpecker.example.com/server.crt +WOODPECKER_SERVER_KEY=/etc/certs/woodpecker.example.com/server.key ``` ### Certificate Chain @@ -122,3 +46,45 @@ The most common problem encountered is providing a certificate file without the ### Certificate Errors SSL support is provided using the [ListenAndServeTLS](https://golang.org/pkg/net/http/#ListenAndServeTLS) function from the Go standard library. If you receive certificate errors or warnings please examine your configuration more closely. + +### Running in containers + +Update your configuration to expose the following ports: + +```diff title="docker-compose.yaml" + version: '3' + + services: + woodpecker-server: + [...] + ports: ++ - 80:80 ++ - 443:443 + - 9000:9000 +``` + +Update your configuration to mount your certificate and key: + +```diff title="docker-compose.yaml" + version: '3' + + services: + woodpecker-server: + [...] + volumes: ++ - /etc/certs/woodpecker.example.com/server.crt:/etc/certs/woodpecker.example.com/server.crt ++ - /etc/certs/woodpecker.example.com/server.key:/etc/certs/woodpecker.example.com/server.key +``` + +Update your configuration to provide the paths of your certificate and key: + +```yaml title="docker-compose.yaml" + version: '3' + + services: + woodpecker-server: + [...] + environment: ++ - WOODPECKER_SERVER_CERT=/etc/certs/woodpecker.example.com/server.crt ++ - WOODPECKER_SERVER_KEY=/etc/certs/woodpecker.example.com/server.key +``` diff --git a/docs/docs/30-administration/70-proxy.md b/docs/docs/30-administration/70-proxy.md index b39b87a98..4aae2fbe1 100644 --- a/docs/docs/30-administration/70-proxy.md +++ b/docs/docs/30-administration/70-proxy.md @@ -13,22 +13,20 @@ ProxyPass / http://127.0.0.1:8000/ ProxyPassReverse / http://127.0.0.1:8000/ ``` -You must have the below Apache modules installed. +You must have these Apache modules installed: -```nohighlight -a2enmod proxy -a2enmod proxy_http -``` +- `proxy` +- `proxy_http` You must configure Apache to set `X-Forwarded-Proto` when using https. ```diff -ProxyPreserveHost On + ProxyPreserveHost On +RequestHeader set X-Forwarded-Proto "https" -ProxyPass / http://127.0.0.1:8000/ -ProxyPassReverse / http://127.0.0.1:8000/ + ProxyPass / http://127.0.0.1:8000/ + ProxyPassReverse / http://127.0.0.1:8000/ ``` ## Nginx @@ -60,22 +58,22 @@ server { You must configure the proxy to set `X-Forwarded` proxy headers: ```diff -server { - listen 80; - server_name woodpecker.example.com; + server { + listen 80; + server_name woodpecker.example.com; - location / { -+ proxy_set_header X-Forwarded-For $remote_addr; -+ proxy_set_header X-Forwarded-Proto $scheme; + location / { ++ proxy_set_header X-Forwarded-For $remote_addr; ++ proxy_set_header X-Forwarded-Proto $scheme; - proxy_pass http://127.0.0.1:8000; - proxy_redirect off; - proxy_http_version 1.1; - proxy_buffering off; + proxy_pass http://127.0.0.1:8000; + proxy_redirect off; + proxy_http_version 1.1; + proxy_buffering off; - chunked_transfer_encoding off; - } -} + chunked_transfer_encoding off; + } + } ``` ## Caddy @@ -95,7 +93,7 @@ woodpeckeragent.example.com { ``` :::note -Above configuration shows how to create reverse-proxies for web and agent communication. If your agent uses SSL do not forget to enable [WOODPECKER_GRPC_SECURE](./15-agent-config.md#woodpecker_grpc_secure). +Above configuration shows how to create reverse-proxies for web and agent communication. If your agent uses SSL do not forget to enable [`WOODPECKER_GRPC_SECURE`](./15-agent-config.md#woodpecker_grpc_secure). ::: ## Tunnelmole @@ -118,7 +116,7 @@ http://bvdo5f-ip-49-183-170-144.tunnelmole.net is forwarding to localhost:8000 https://bvdo5f-ip-49-183-170-144.tunnelmole.net is forwarding to localhost:8000 ``` -Set `WOODPECKER_HOST` (for example in `docker-compose.yml`) to the Tunnelmole URL (`xxx.tunnelmole.net`) and start the server. +Set `WOODPECKER_HOST` to the Tunnelmole URL (`xxx.tunnelmole.net`) and start the server. ## Ngrok @@ -128,7 +126,7 @@ Set `WOODPECKER_HOST` (for example in `docker-compose.yml`) to the Tunnelmole UR ngrok http 8000 ``` -Set `WOODPECKER_HOST` (for example in `docker-compose.yml`) to the ngrok URL (usually xxx.ngrok.io) and start the server. +Set `WOODPECKER_HOST` to the ngrok URL (usually xxx.ngrok.io) and start the server. ## Traefik diff --git a/docs/docs/30-administration/75-addons/00-overview.md b/docs/docs/30-administration/75-addons/00-overview.md index 615d116ca..485f9ce84 100644 --- a/docs/docs/30-administration/75-addons/00-overview.md +++ b/docs/docs/30-administration/75-addons/00-overview.md @@ -23,22 +23,15 @@ Addons can be used for: Addons are restricted by how Go plugins work. This includes the following restrictions: -- only supported on Linux, FreeBSD and macOS +- only supported on Linux, FreeBSD, and macOS - addons must have been built for the correct Woodpecker version. If an addon is not provided specifically for this version, you likely won't be able to use it. ## Usage To use an addon, download the addon version built for your Woodpecker version. Then, you can add the following to your configuration: -```diff -# docker-compose.yml -version: '3' - -services: - woodpecker-server: - [...] - environment: -+ - WOODPECKER_ADDONS=/path/to/your/addon/file.so +```ini +WOODPECKER_ADDONS=/path/to/your/addon/file.so ``` In case you run Woodpecker as container, you probably want to mount the addon binaries to `/opt/addons/`. diff --git a/docs/docs/30-administration/75-addons/20-creating-addons.md b/docs/docs/30-administration/75-addons/20-creating-addons.md index dbad5490f..0fd6d2fe0 100644 --- a/docs/docs/30-administration/75-addons/20-creating-addons.md +++ b/docs/docs/30-administration/75-addons/20-creating-addons.md @@ -8,7 +8,7 @@ An addon consists of two variables/functions in Go. 1. The `Type` variable. Specifies the type of the addon and must be directly accessed from `shared/addons/types/types.go`. 2. The `Addon` function which is the main point of your addon. - This function takes the zerolog logger you should use to log errors, warnings etc. as argument. + This function takes the `zerolog` logger you should use to log errors, warnings, etc. as argument. It returns two values: @@ -23,11 +23,22 @@ Directly import Woodpecker's Go package (`go.woodpecker-ci.org/woodpecker/woodpe | -------------------- | -------------------------------------------------------------------------------- | | `Forge` | `"go.woodpecker-ci.org/woodpecker/woodpecker/v2/server/forge".Forge` | | `Backend` | `"go.woodpecker-ci.org/woodpecker/woodpecker/v2/pipeline/backend/types".Backend` | -| `ConfigService` | `"go.woodpecker-ci.org/woodpecker/v2/server/plugins/config".ConfigService` | +| `ConfigService` | `"go.woodpecker-ci.org/woodpecker/v2/server/plugins/config".Extension` | | `SecretService` | `"go.woodpecker-ci.org/woodpecker/v2/server/model".SecretService` | | `EnvironmentService` | `"go.woodpecker-ci.org/woodpecker/v2/server/model".EnvironmentService` | | `RegistryService` | `"go.woodpecker-ci.org/woodpecker/v2/server/model".RegistryService` | +### Using configurations + +If you write a plugin for the server (`Forge` and the services), you can access the server config. + +Therefore, use the `"go.woodpecker-ci.org/woodpecker/v2/server".Config` variable. + +:::warning +The config is not available when your addon is initialized, i.e., the `Addon` function is called. +Only use the config in the interface methods. +::: + ## Compiling After you write your addon code, compile your addon: @@ -36,23 +47,25 @@ After you write your addon code, compile your addon: go build -buildmode plugin ``` -The output file is your addon which is now ready to be used. +The output file is your addon that is now ready to be used. ## Restrictions Addons must directly depend on Woodpecker's core (`go.woodpecker-ci.org/woodpecker/woodpecker/v2`). -The addon must have been built with **excatly the same code** as the Woodpecker instance you'd like to use it on. This means: If you build your addon with a specific commit from Woodpecker `next`, you can likely only use it with the Woodpecker version compiled from this commit. -Also, if you change something inside of Woodpecker without committing, it might fail because you need to recompile your addon with this code first. +The addon must have been built with **exactly the same code** as the Woodpecker instance you'd like to use it on. This means: If you build your addon with a specific commit from Woodpecker `next`, you can likely only use it with the Woodpecker version compiled from this commit. +Also, if you change something inside Woodpecker without committing, it might fail because you need to recompile your addon with this code first. -In addition to this, addons are only supported on Linux, FreeBSD and macOS. +In addition to this, addons are only supported on Linux, FreeBSD, and macOS. :::info -It is recommended to at least support the latest released version of Woodpecker. +It is recommended to at least support the latest version of Woodpecker. ::: ### Compile for different versions -As long as there are no changes to Woodpecker's interfaces or they are backwards-compatible, you can easily compile the addon for multiple version by changing the version of `go.woodpecker-ci.org/woodpecker/woodpecker/v2` using `go get` before compiling. +As long as there are no changes to Woodpecker's interfaces, +or they are backwards-compatible, you can compile the addon for multiple versions +by changing the version of `go.woodpecker-ci.org/woodpecker/woodpecker/v2` using `go get` before compiling. ## Logging @@ -68,10 +81,10 @@ import ( "net/http" "github.com/rs/zerolog" - "go.woodpecker-ci.org/woodpecker/woodpecker/v2/server/forge" - forge_types "go.woodpecker-ci.org/woodpecker/woodpecker/v2/server/forge/types" - "go.woodpecker-ci.org/woodpecker/woodpecker/v2/server/model" - addon_types "go.woodpecker-ci.org/woodpecker/woodpecker/v2/shared/addon/types" + "go.woodpecker-ci.org/woodpecker/v2/server/forge" + forge_types "go.woodpecker-ci.org/woodpecker/v2/server/forge/types" + "go.woodpecker-ci.org/woodpecker/v2/server/model" + addon_types "go.woodpecker-ci.org/woodpecker/v2/shared/addon/types" ) var Type = addon_types.TypeForge @@ -85,5 +98,5 @@ type config struct { l zerolog.Logger } -// ... in this case, `config` must implement `forge.Forge`. You must directly use Woodpecker's packages - see imports above. +// In this case, `config` must implement `forge.Forge`. You must directly use Woodpecker's packages - see imports above. ``` diff --git a/docs/docs/30-administration/75-addons/_category_.yml b/docs/docs/30-administration/75-addons/_category_.yaml similarity index 100% rename from docs/docs/30-administration/75-addons/_category_.yml rename to docs/docs/30-administration/75-addons/_category_.yaml diff --git a/docs/docs/30-administration/80-autoscaler.md b/docs/docs/30-administration/80-autoscaler.md index 86e92d1a2..6ac581c2e 100644 --- a/docs/docs/30-administration/80-autoscaler.md +++ b/docs/docs/30-administration/80-autoscaler.md @@ -8,7 +8,7 @@ Please note that the autoscaler is not feature-complete yet. You can follow the ### docker-compose -If you are using docker-compose you can add the following to your docker-compose.yml file: +If you are using docker-compose you can add the following to your `docker-compose.yaml` file: ```yaml version: '3' diff --git a/docs/docs/30-administration/90-prometheus.md b/docs/docs/30-administration/90-prometheus.md index 2b3ba3d8a..567f270d3 100644 --- a/docs/docs/30-administration/90-prometheus.md +++ b/docs/docs/30-administration/90-prometheus.md @@ -19,35 +19,31 @@ scrape_configs: An administrator will need to generate a user API token and configure in the Prometheus configuration file as a bearer token. Please see the following example: ```diff -global: - scrape_interval: 60s + global: + scrape_interval: 60s -scrape_configs: - - job_name: 'woodpecker' -+ bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + scrape_configs: + - job_name: 'woodpecker' ++ bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... - static_configs: - - targets: ['woodpecker.domain.com'] + static_configs: + - targets: ['woodpecker.domain.com'] ``` As an alternative, the token can also be read from a file: ```diff -global: - scrape_interval: 60s + global: + scrape_interval: 60s -scrape_configs: - - job_name: 'woodpecker' -+ bearer_token_file: /etc/secrets/woodpecker-monitoring-token + scrape_configs: + - job_name: 'woodpecker' ++ bearer_token_file: /etc/secrets/woodpecker-monitoring-token - static_configs: - - targets: ['woodpecker.domain.com'] + static_configs: + - targets: ['woodpecker.domain.com'] ``` -## Unauthenticated Access - -Alternatively, the unprotected `/metrics` endpoint might be exposed on the internal port (Port is configurable via the `WOODPECKER_METRICS_SERVER_ADDR` environment variable, e.g. `:9001`). - ## Metric Reference List of Prometheus metrics specific to Woodpecker: diff --git a/docs/docs/30-administration/_category_.yml b/docs/docs/30-administration/_category_.yaml similarity index 100% rename from docs/docs/30-administration/_category_.yml rename to docs/docs/30-administration/_category_.yaml diff --git a/docs/docs/92-awesome.md b/docs/docs/92-awesome.md index 4eaf81ede..18f36ce71 100644 --- a/docs/docs/92-awesome.md +++ b/docs/docs/92-awesome.md @@ -7,11 +7,10 @@ If you have some missing resources, please feel free to [open a pull-request](ht ## Official Resources - [Woodpecker CI pipeline configs](https://github.com/woodpecker-ci/woodpecker/tree/main/.woodpecker) - Complex setup containing different kind of pipelines - - [Golang tests](https://github.com/woodpecker-ci/woodpecker/blob/main/.woodpecker/test.yml) - - [Typescript, eslint & Vue](https://github.com/woodpecker-ci/woodpecker/blob/main/.woodpecker/web.yml) - - [Docusaurus & publishing to GitHub Pages](https://github.com/woodpecker-ci/woodpecker/blob/main/.woodpecker/docs.yml) - - [Docker container building](https://github.com/woodpecker-ci/woodpecker/blob/main/.woodpecker/docker.yml) - - [Helm chart linting & releasing](https://github.com/woodpecker-ci/woodpecker/blob/main/.woodpecker/helm.yml) + - [Golang tests](https://github.com/woodpecker-ci/woodpecker/blob/main/.woodpecker/test.yaml) + - [Typescript, eslint & Vue](https://github.com/woodpecker-ci/woodpecker/blob/main/.woodpecker/web.yaml) + - [Docusaurus & publishing to GitHub Pages](https://github.com/woodpecker-ci/woodpecker/blob/main/.woodpecker/docs.yaml) + - [Docker container building](https://github.com/woodpecker-ci/woodpecker/blob/main/.woodpecker/docker.yaml) ## Projects using Woodpecker diff --git a/docs/docs/92-development/01-getting-started.md b/docs/docs/92-development/01-getting-started.md index 06bfe0ec2..0889afa5b 100644 --- a/docs/docs/92-development/01-getting-started.md +++ b/docs/docs/92-development/01-getting-started.md @@ -4,7 +4,7 @@ You can develop on your local computer by following the [steps below](#preparati ## Gitpod -If you want to start development or updating docs as easy as possible you can use our preconfigured setup for Woodpecker using [Gitpod](https://github.com/gitpod-io/gitpod). Gitpod starts a complete development setup in the cloud containing: +If you want to start development or updating docs as easy as possible, you can use our preconfigured setup for Woodpecker using [Gitpod](https://github.com/gitpod-io/gitpod). Gitpod starts a complete development setup in the cloud containing: - An IDE in the browser or bridged to your local VS-Code or Jetbrains - A preconfigured [Gitea](https://github.com/go-gitea/gitea) instance as forge @@ -12,7 +12,7 @@ If you want to start development or updating docs as easy as possible you can us - A single preconfigured Woodpecker agent node - Our docs preview server -Simply start Woodpecker in Gitpod by clicking on the following badge. You can login with `woodpecker` and `password`. +Start Woodpecker in Gitpod by clicking on the following badge. You can log in with `woodpecker` and `password`. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/woodpecker-ci/woodpecker) @@ -32,11 +32,17 @@ Install make on: - [Windows](https://stackoverflow.com/a/32127632/8461267) - Mac OS: `brew install make` -### Install Node.js & pnpm +### Install Node.js & `pnpm` -Install [Node.js (>=14)](https://nodejs.org/en/download/) if you want to build Woodpeckers UI or documentation. +Install [Node.js (>=14)](https://nodejs.org/en/download/) if you want to build Woodpecker's UI or documentation. -For dependencies installation (node_modules) for the UI and documentation of Woodpecker the package-manager pnpm is used. The installation of pnpm is described by [this guide](https://pnpm.io/installation). +For dependency installation (`node_modules`) of UI and documentation of Woodpecker the package manager pnpm is used. +[This guide](https://pnpm.io/installation) describes the installation of `pnpm`. + +### Install `pre-commit` (optional) + +Woodpecker uses [`pre-commit`](https://pre-commit.com/) to allow you to easily autofix your code. +To apply it during local development, take a look at [`pre-commit`s documentation](https://pre-commit.com/#usage). ### Create a `.env` file with your development configuration @@ -74,28 +80,28 @@ WOODPECKER_HEALTHCHECK=false # WOODPECKER_LOG_LEVEL=trace ``` -### Setup O-Auth +### Setup OAuth -Create an O-Auth app for your forge as describe in the [forges documentation](../30-administration/11-forges/10-overview.md). If you set `WOODPECKER_DEV_OAUTH_HOST=http://localhost:8000` you can use that address with the path as explained for the specific forge to login without the need for a public address. For example for GitHub you would use `http://localhost:8000/authorize` as authorization callback URL. +Create an OAuth app for your forge as described in the [forges documentation](../30-administration/11-forges/10-overview.md). If you set `WOODPECKER_DEV_OAUTH_HOST=http://localhost:8000` you can use that address with the path as explained for the specific forge to login without the need for a public address. For example for GitHub you would use `http://localhost:8000/authorize` as authorization callback URL. -## Developing with VS-Code +## Developing with VS Code You can use different methods for debugging the Woodpecker applications. One of the currently recommended ways to debug and test the Woodpecker application is using [VS-Code](https://code.visualstudio.com/) or [VS-Codium](https://vscodium.com/) (Open-Source binaries of VS-Code) as most maintainers are using it and Woodpecker already includes the needed debug configurations for it. -To launch all needed services for local development you can use "Woodpecker CI" debugging configuration that will launch UI, server and agent in debugging mode. Then open `http://localhost:8000` to access it. +To launch all needed services for local development, you can use "Woodpecker CI" debugging configuration that will launch UI, server and agent in debugging mode. Then open `http://localhost:8000` to access it. -As a starting guide for programming Go with VS-Code you can use this video guide: -[![Getting started with Go in VS-Code](https://img.youtube.com/vi/1MXIGYrMk80/0.jpg)](https://www.youtube.com/watch?v=1MXIGYrMk80) +As a starting guide for programming Go with VS Code, you can use this video guide: +[![Getting started with Go in VS Code](https://img.youtube.com/vi/1MXIGYrMk80/0.jpg)](https://www.youtube.com/watch?v=1MXIGYrMk80) ### Debugging Woodpecker The Woodpecker source code already includes launch configurations for the Woodpecker server and agent. To start debugging you can click on the debug icon in the navigation bar of VS-Code (ctrl-shift-d). On that page you will see the existing launch jobs at the top. Simply select the agent or server and click on the play button. You can set breakpoints in the source files to stop at specific points. -![Woodpecker debugging with VS-Code](./vscode-debug.png) +![Woodpecker debugging with VS Code](./vscode-debug.png) ## Testing & linting code -To test or lint parts of Woodpecker you can run one of the following commands: +To test or lint parts of Woodpecker, you can run one of the following commands: ```bash # test server code @@ -120,7 +126,7 @@ make lint-frontend make test-frontend ``` -If you want to test a specific go file you can also use: +If you want to test a specific Go file, you can also use: ```bash go test -race -timeout 30s go.woodpecker-ci.org/woodpecker/v2/ @@ -132,7 +138,7 @@ Or you can open the test-file inside [VS-Code](#developing-with-vs-code) and run ## Run applications from terminal -If you want to run a Woodpecker applications from your terminal you can use one of the following commands from the base of the Woodpecker project. They will execute Woodpecker in a similar way as described in [debugging Woodpecker](#debugging-woodpecker) without the ability to really debug it in your editor. +If you want to run a Woodpecker applications from your terminal, you can use one of the following commands from the base of the Woodpecker project. They will execute Woodpecker in a similar way as described in [debugging Woodpecker](#debugging-woodpecker) without the ability to really debug it in your editor. ```bash title="start server" go run ./cmd/server diff --git a/docs/docs/92-development/_category_.yml b/docs/docs/92-development/_category_.yaml similarity index 100% rename from docs/docs/92-development/_category_.yml rename to docs/docs/92-development/_category_.yaml diff --git a/docs/docusaurus.config.ts b/docs/docusaurus.config.ts index 183fc5d55..5da7c4dd8 100644 --- a/docs/docusaurus.config.ts +++ b/docs/docusaurus.config.ts @@ -132,7 +132,7 @@ const config: Config = { href: 'https://github.com/woodpecker-ci/woodpecker', }, { - href: 'https://ci.woodpecker-ci.org/woodpecker-ci/woodpecker', + href: 'https://ci.woodpecker-ci.org/repos/3780', label: 'CI', }, ], @@ -143,7 +143,19 @@ const config: Config = { prism: { theme: themes.github, darkTheme: themes.dracula, - additionalLanguages: ['diff', 'json', 'docker', 'javascript', 'css', 'bash', 'nginx', 'apacheconf', 'ini', 'nix'], + additionalLanguages: [ + 'diff', + 'json', + 'docker', + 'javascript', + 'css', + 'bash', + 'nginx', + 'apacheconf', + 'ini', + 'nix', + 'uri', + ], }, announcementBar: { id: 'github-star', diff --git a/docs/src/pages/faq.md b/docs/src/pages/faq.md index 550e0e1ef..8a9d552ff 100644 --- a/docs/src/pages/faq.md +++ b/docs/src/pages/faq.md @@ -28,13 +28,8 @@ If you want all (new) features of Woodpecker and are willing to accept some poss This error can have multiple causes. If you use internal repositories you might have to enable `WOODPECKER_AUTHENTICATE_PUBLIC_REPOS`: -```yaml -services: - woodpecker-server: - [...] - environment: - - [...] - - WOODPECKER_AUTHENTICATE_PUBLIC_REPOS=true +```ini +WOODPECKER_AUTHENTICATE_PUBLIC_REPOS=true ``` If that does not work, try to make sure the container can reach your git server. In order to do that disable git checkout and make the container "hang": diff --git a/docs/static/.nojekyll b/docs/static/.nojekyll deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/versioned_docs/version-0.15/20-usage/51-plugins/_category_.yml b/docs/versioned_docs/version-0.15/20-usage/51-plugins/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-0.15/20-usage/51-plugins/_category_.yml rename to docs/versioned_docs/version-0.15/20-usage/51-plugins/_category_.yaml diff --git a/docs/versioned_docs/version-0.15/20-usage/_category_.yml b/docs/versioned_docs/version-0.15/20-usage/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-0.15/20-usage/_category_.yml rename to docs/versioned_docs/version-0.15/20-usage/_category_.yaml diff --git a/docs/versioned_docs/version-0.15/30-administration/11-vcs/_category_.yml b/docs/versioned_docs/version-0.15/30-administration/11-vcs/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-0.15/30-administration/11-vcs/_category_.yml rename to docs/versioned_docs/version-0.15/30-administration/11-vcs/_category_.yaml diff --git a/docs/versioned_docs/version-0.15/30-administration/_category_.yml b/docs/versioned_docs/version-0.15/30-administration/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-0.15/30-administration/_category_.yml rename to docs/versioned_docs/version-0.15/30-administration/_category_.yaml diff --git a/docs/versioned_docs/version-0.15/92-development/_category_.yml b/docs/versioned_docs/version-0.15/92-development/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-0.15/92-development/_category_.yml rename to docs/versioned_docs/version-0.15/92-development/_category_.yaml diff --git a/docs/versioned_docs/version-1.0/20-usage/51-plugins/_category_.yml b/docs/versioned_docs/version-1.0/20-usage/51-plugins/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-1.0/20-usage/51-plugins/_category_.yml rename to docs/versioned_docs/version-1.0/20-usage/51-plugins/_category_.yaml diff --git a/docs/versioned_docs/version-1.0/20-usage/_category_.yml b/docs/versioned_docs/version-1.0/20-usage/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-1.0/20-usage/_category_.yml rename to docs/versioned_docs/version-1.0/20-usage/_category_.yaml diff --git a/docs/versioned_docs/version-1.0/30-administration/11-forges/_category_.yml b/docs/versioned_docs/version-1.0/30-administration/11-forges/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-1.0/30-administration/11-forges/_category_.yml rename to docs/versioned_docs/version-1.0/30-administration/11-forges/_category_.yaml diff --git a/docs/versioned_docs/version-1.0/30-administration/22-backends/_category_.yml b/docs/versioned_docs/version-1.0/30-administration/22-backends/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-1.0/30-administration/22-backends/_category_.yml rename to docs/versioned_docs/version-1.0/30-administration/22-backends/_category_.yaml diff --git a/docs/versioned_docs/version-1.0/30-administration/_category_.yml b/docs/versioned_docs/version-1.0/30-administration/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-1.0/30-administration/_category_.yml rename to docs/versioned_docs/version-1.0/30-administration/_category_.yaml diff --git a/docs/versioned_docs/version-1.0/92-development/_category_.yml b/docs/versioned_docs/version-1.0/92-development/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-1.0/92-development/_category_.yml rename to docs/versioned_docs/version-1.0/92-development/_category_.yaml diff --git a/docs/versioned_docs/version-2.0/20-usage/51-plugins/_category_.yml b/docs/versioned_docs/version-2.0/20-usage/51-plugins/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-2.0/20-usage/51-plugins/_category_.yml rename to docs/versioned_docs/version-2.0/20-usage/51-plugins/_category_.yaml diff --git a/docs/versioned_docs/version-2.0/20-usage/_category_.yml b/docs/versioned_docs/version-2.0/20-usage/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-2.0/20-usage/_category_.yml rename to docs/versioned_docs/version-2.0/20-usage/_category_.yaml diff --git a/docs/versioned_docs/version-2.0/30-administration/00-deployment/_category_.yml b/docs/versioned_docs/version-2.0/30-administration/00-deployment/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-2.0/30-administration/00-deployment/_category_.yml rename to docs/versioned_docs/version-2.0/30-administration/00-deployment/_category_.yaml diff --git a/docs/versioned_docs/version-2.0/30-administration/11-forges/_category_.yml b/docs/versioned_docs/version-2.0/30-administration/11-forges/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-2.0/30-administration/11-forges/_category_.yml rename to docs/versioned_docs/version-2.0/30-administration/11-forges/_category_.yaml diff --git a/docs/versioned_docs/version-2.0/30-administration/22-backends/_category_.yml b/docs/versioned_docs/version-2.0/30-administration/22-backends/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-2.0/30-administration/22-backends/_category_.yml rename to docs/versioned_docs/version-2.0/30-administration/22-backends/_category_.yaml diff --git a/docs/versioned_docs/version-2.0/30-administration/_category_.yml b/docs/versioned_docs/version-2.0/30-administration/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-2.0/30-administration/_category_.yml rename to docs/versioned_docs/version-2.0/30-administration/_category_.yaml diff --git a/docs/versioned_docs/version-2.0/92-development/_category_.yml b/docs/versioned_docs/version-2.0/92-development/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-2.0/92-development/_category_.yml rename to docs/versioned_docs/version-2.0/92-development/_category_.yaml diff --git a/docs/docs/20-usage/51-plugins/_category_.yml b/docs/versioned_docs/version-2.1/20-usage/51-plugins/_category_.yaml similarity index 100% rename from docs/docs/20-usage/51-plugins/_category_.yml rename to docs/versioned_docs/version-2.1/20-usage/51-plugins/_category_.yaml diff --git a/docs/versioned_docs/version-2.1/20-usage/_category_.yml b/docs/versioned_docs/version-2.1/20-usage/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-2.1/20-usage/_category_.yml rename to docs/versioned_docs/version-2.1/20-usage/_category_.yaml diff --git a/docs/versioned_docs/version-2.1/30-administration/00-deployment/_category_.yml b/docs/versioned_docs/version-2.1/30-administration/00-deployment/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-2.1/30-administration/00-deployment/_category_.yml rename to docs/versioned_docs/version-2.1/30-administration/00-deployment/_category_.yaml diff --git a/docs/versioned_docs/version-2.1/30-administration/11-forges/_category_.yml b/docs/versioned_docs/version-2.1/30-administration/11-forges/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-2.1/30-administration/11-forges/_category_.yml rename to docs/versioned_docs/version-2.1/30-administration/11-forges/_category_.yaml diff --git a/docs/versioned_docs/version-2.1/30-administration/22-backends/_category_.yml b/docs/versioned_docs/version-2.1/30-administration/22-backends/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-2.1/30-administration/22-backends/_category_.yml rename to docs/versioned_docs/version-2.1/30-administration/22-backends/_category_.yaml diff --git a/docs/versioned_docs/version-2.1/30-administration/75-addons/_category_.yml b/docs/versioned_docs/version-2.1/30-administration/75-addons/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-2.1/30-administration/75-addons/_category_.yml rename to docs/versioned_docs/version-2.1/30-administration/75-addons/_category_.yaml diff --git a/docs/versioned_docs/version-2.1/30-administration/_category_.yml b/docs/versioned_docs/version-2.1/30-administration/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-2.1/30-administration/_category_.yml rename to docs/versioned_docs/version-2.1/30-administration/_category_.yaml diff --git a/docs/versioned_docs/version-2.1/92-development/_category_.yml b/docs/versioned_docs/version-2.1/92-development/_category_.yaml similarity index 100% rename from docs/versioned_docs/version-2.1/92-development/_category_.yml rename to docs/versioned_docs/version-2.1/92-development/_category_.yaml diff --git a/nfpm/nfpm-agent.yml b/nfpm/agent.yaml similarity index 100% rename from nfpm/nfpm-agent.yml rename to nfpm/agent.yaml diff --git a/nfpm/nfpm-cli.yml b/nfpm/cli.yaml similarity index 100% rename from nfpm/nfpm-cli.yml rename to nfpm/cli.yaml diff --git a/nfpm/nfpm-server.yml b/nfpm/server.yaml similarity index 100% rename from nfpm/nfpm-server.yml rename to nfpm/server.yaml diff --git a/pipeline/frontend/yaml/linter/schema/.woodpecker/test-array-syntax.yml b/pipeline/frontend/yaml/linter/schema/.woodpecker/test-array-syntax.yaml similarity index 100% rename from pipeline/frontend/yaml/linter/schema/.woodpecker/test-array-syntax.yml rename to pipeline/frontend/yaml/linter/schema/.woodpecker/test-array-syntax.yaml diff --git a/pipeline/frontend/yaml/linter/schema/.woodpecker/test-branches-array.yml b/pipeline/frontend/yaml/linter/schema/.woodpecker/test-branches-array.yaml similarity index 100% rename from pipeline/frontend/yaml/linter/schema/.woodpecker/test-branches-array.yml rename to pipeline/frontend/yaml/linter/schema/.woodpecker/test-branches-array.yaml diff --git a/pipeline/frontend/yaml/linter/schema/.woodpecker/test-branches-exclude-include.yml b/pipeline/frontend/yaml/linter/schema/.woodpecker/test-branches-exclude-include.yaml similarity index 100% rename from pipeline/frontend/yaml/linter/schema/.woodpecker/test-branches-exclude-include.yml rename to pipeline/frontend/yaml/linter/schema/.woodpecker/test-branches-exclude-include.yaml diff --git a/pipeline/frontend/yaml/linter/schema/.woodpecker/test-branches.yml b/pipeline/frontend/yaml/linter/schema/.woodpecker/test-branches.yaml similarity index 100% rename from pipeline/frontend/yaml/linter/schema/.woodpecker/test-branches.yml rename to pipeline/frontend/yaml/linter/schema/.woodpecker/test-branches.yaml diff --git a/pipeline/frontend/yaml/linter/schema/.woodpecker/test-broken.yml b/pipeline/frontend/yaml/linter/schema/.woodpecker/test-broken.yaml similarity index 100% rename from pipeline/frontend/yaml/linter/schema/.woodpecker/test-broken.yml rename to pipeline/frontend/yaml/linter/schema/.woodpecker/test-broken.yaml diff --git a/pipeline/frontend/yaml/linter/schema/.woodpecker/test-clone-skip.yml b/pipeline/frontend/yaml/linter/schema/.woodpecker/test-clone-skip.yaml similarity index 100% rename from pipeline/frontend/yaml/linter/schema/.woodpecker/test-clone-skip.yml rename to pipeline/frontend/yaml/linter/schema/.woodpecker/test-clone-skip.yaml diff --git a/pipeline/frontend/yaml/linter/schema/.woodpecker/test-clone.yml b/pipeline/frontend/yaml/linter/schema/.woodpecker/test-clone.yaml similarity index 100% rename from pipeline/frontend/yaml/linter/schema/.woodpecker/test-clone.yml rename to pipeline/frontend/yaml/linter/schema/.woodpecker/test-clone.yaml diff --git a/pipeline/frontend/yaml/linter/schema/.woodpecker/test-labels.yml b/pipeline/frontend/yaml/linter/schema/.woodpecker/test-labels.yaml similarity index 100% rename from pipeline/frontend/yaml/linter/schema/.woodpecker/test-labels.yml rename to pipeline/frontend/yaml/linter/schema/.woodpecker/test-labels.yaml diff --git a/pipeline/frontend/yaml/linter/schema/.woodpecker/test-matrix.yml b/pipeline/frontend/yaml/linter/schema/.woodpecker/test-matrix.yaml similarity index 100% rename from pipeline/frontend/yaml/linter/schema/.woodpecker/test-matrix.yml rename to pipeline/frontend/yaml/linter/schema/.woodpecker/test-matrix.yaml diff --git a/pipeline/frontend/yaml/linter/schema/.woodpecker/test-merge-map-and-sequence.yml b/pipeline/frontend/yaml/linter/schema/.woodpecker/test-merge-map-and-sequence.yaml similarity index 100% rename from pipeline/frontend/yaml/linter/schema/.woodpecker/test-merge-map-and-sequence.yml rename to pipeline/frontend/yaml/linter/schema/.woodpecker/test-merge-map-and-sequence.yaml diff --git a/pipeline/frontend/yaml/linter/schema/.woodpecker/test-multi.yml b/pipeline/frontend/yaml/linter/schema/.woodpecker/test-multi.yaml similarity index 100% rename from pipeline/frontend/yaml/linter/schema/.woodpecker/test-multi.yml rename to pipeline/frontend/yaml/linter/schema/.woodpecker/test-multi.yaml diff --git a/pipeline/frontend/yaml/linter/schema/.woodpecker/test-pipeline-when.yml b/pipeline/frontend/yaml/linter/schema/.woodpecker/test-pipeline-when.yaml similarity index 100% rename from pipeline/frontend/yaml/linter/schema/.woodpecker/test-pipeline-when.yml rename to pipeline/frontend/yaml/linter/schema/.woodpecker/test-pipeline-when.yaml diff --git a/pipeline/frontend/yaml/linter/schema/.woodpecker/test-platform.yml b/pipeline/frontend/yaml/linter/schema/.woodpecker/test-platform.yaml similarity index 100% rename from pipeline/frontend/yaml/linter/schema/.woodpecker/test-platform.yml rename to pipeline/frontend/yaml/linter/schema/.woodpecker/test-platform.yaml diff --git a/pipeline/frontend/yaml/linter/schema/.woodpecker/test-plugin.yml b/pipeline/frontend/yaml/linter/schema/.woodpecker/test-plugin.yaml similarity index 100% rename from pipeline/frontend/yaml/linter/schema/.woodpecker/test-plugin.yml rename to pipeline/frontend/yaml/linter/schema/.woodpecker/test-plugin.yaml diff --git a/pipeline/frontend/yaml/linter/schema/.woodpecker/test-run-on.yml b/pipeline/frontend/yaml/linter/schema/.woodpecker/test-run-on.yaml similarity index 100% rename from pipeline/frontend/yaml/linter/schema/.woodpecker/test-run-on.yml rename to pipeline/frontend/yaml/linter/schema/.woodpecker/test-run-on.yaml diff --git a/pipeline/frontend/yaml/linter/schema/.woodpecker/test-service.yml b/pipeline/frontend/yaml/linter/schema/.woodpecker/test-service.yaml similarity index 100% rename from pipeline/frontend/yaml/linter/schema/.woodpecker/test-service.yml rename to pipeline/frontend/yaml/linter/schema/.woodpecker/test-service.yaml diff --git a/pipeline/frontend/yaml/linter/schema/.woodpecker/test-step.yml b/pipeline/frontend/yaml/linter/schema/.woodpecker/test-step.yaml similarity index 100% rename from pipeline/frontend/yaml/linter/schema/.woodpecker/test-step.yml rename to pipeline/frontend/yaml/linter/schema/.woodpecker/test-step.yaml diff --git a/pipeline/frontend/yaml/linter/schema/.woodpecker/test-when.yml b/pipeline/frontend/yaml/linter/schema/.woodpecker/test-when.yaml similarity index 100% rename from pipeline/frontend/yaml/linter/schema/.woodpecker/test-when.yml rename to pipeline/frontend/yaml/linter/schema/.woodpecker/test-when.yaml diff --git a/pipeline/frontend/yaml/linter/schema/.woodpecker/test-workspace.yml b/pipeline/frontend/yaml/linter/schema/.woodpecker/test-workspace.yaml similarity index 100% rename from pipeline/frontend/yaml/linter/schema/.woodpecker/test-workspace.yml rename to pipeline/frontend/yaml/linter/schema/.woodpecker/test-workspace.yaml diff --git a/pipeline/frontend/yaml/linter/schema/schema_test.go b/pipeline/frontend/yaml/linter/schema/schema_test.go index 6b1dfd1d4..1ae068091 100644 --- a/pipeline/frontend/yaml/linter/schema/schema_test.go +++ b/pipeline/frontend/yaml/linter/schema/schema_test.go @@ -34,76 +34,76 @@ func TestSchema(t *testing.T) { }{ { name: "Branches", - testFile: ".woodpecker/test-branches.yml", + testFile: ".woodpecker/test-branches.yaml", }, { name: "Branches Array", - testFile: ".woodpecker/test-branches-array.yml", + testFile: ".woodpecker/test-branches-array.yaml", }, { name: "Branches exclude & include", - testFile: ".woodpecker/test-branches-exclude-include.yml", + testFile: ".woodpecker/test-branches-exclude-include.yaml", }, { name: "Clone", - testFile: ".woodpecker/test-clone.yml", + testFile: ".woodpecker/test-clone.yaml", }, { name: "Clone skip", - testFile: ".woodpecker/test-clone-skip.yml", + testFile: ".woodpecker/test-clone-skip.yaml", }, { name: "Matrix", - testFile: ".woodpecker/test-matrix.yml", + testFile: ".woodpecker/test-matrix.yaml", }, { name: "Multi Pipeline", - testFile: ".woodpecker/test-multi.yml", + testFile: ".woodpecker/test-multi.yaml", }, { name: "Plugin", - testFile: ".woodpecker/test-plugin.yml", + testFile: ".woodpecker/test-plugin.yaml", }, { name: "Run on", - testFile: ".woodpecker/test-run-on.yml", + testFile: ".woodpecker/test-run-on.yaml", }, { name: "Service", - testFile: ".woodpecker/test-service.yml", + testFile: ".woodpecker/test-service.yaml", }, { name: "Step", - testFile: ".woodpecker/test-step.yml", + testFile: ".woodpecker/test-step.yaml", }, { name: "When", - testFile: ".woodpecker/test-when.yml", + testFile: ".woodpecker/test-when.yaml", }, { name: "Workspace", - testFile: ".woodpecker/test-workspace.yml", + testFile: ".woodpecker/test-workspace.yaml", }, { name: "Platform", - testFile: ".woodpecker/test-platform.yml", + testFile: ".woodpecker/test-platform.yaml", }, { name: "Labels", - testFile: ".woodpecker/test-labels.yml", + testFile: ".woodpecker/test-labels.yaml", }, { name: "Map and Sequence Merge", // https://woodpecker-ci.org/docs/next/usage/advanced-yaml-syntax - testFile: ".woodpecker/test-merge-map-and-sequence.yml", + testFile: ".woodpecker/test-merge-map-and-sequence.yaml", }, { name: "Broken Config", - testFile: ".woodpecker/test-broken.yml", + testFile: ".woodpecker/test-broken.yaml", fail: true, }, { name: "Array syntax", - testFile: ".woodpecker/test-array-syntax.yml", + testFile: ".woodpecker/test-array-syntax.yaml", fail: false, }, }