Rename yaml pipeline to steps (#1833)

Adjust pipeline-config to match
[Terminology](https://woodpecker-ci.org/docs/next/usage/terminology)
This commit is contained in:
6543 2023-06-07 12:04:37 +02:00 committed by GitHub
parent 101e684059
commit 7e708874ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
59 changed files with 218 additions and 162 deletions

View file

@ -15,7 +15,7 @@ variables:
# web source code # web source code
- "web/**" - "web/**"
pipeline: pipeline: &legacy
build-web: build-web:
group: prepare group: prepare
image: *node_image image: *node_image
@ -98,3 +98,5 @@ pipeline:
title: ${CI_COMMIT_TAG##v} title: ${CI_COMMIT_TAG##v}
when: when:
event: tag event: tag
steps: *legacy

View file

@ -12,7 +12,7 @@ variables:
- &platforms_preview 'linux/arm/v6,linux/arm64/v8,linux/amd64,linux/riscv64,windows/amd64' - &platforms_preview 'linux/arm/v6,linux/arm64/v8,linux/amd64,linux/riscv64,windows/amd64'
- &platforms_alpine 'linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/amd64,linux/ppc64le' - &platforms_alpine 'linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/amd64,linux/ppc64le'
pipeline: pipeline: &legacy
vendor: vendor:
image: *golang_image image: *golang_image
pull: true pull: true
@ -331,3 +331,5 @@ pipeline:
tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"] tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"]
when: when:
event: tag event: tag
steps: *legacy

View file

@ -8,7 +8,7 @@ variables:
- "cli/**" - "cli/**"
- "cmd/cli/**" - "cmd/cli/**"
pipeline: pipeline: &legacy
build-cli: build-cli:
image: *golang_image image: *golang_image
commands: commands:
@ -82,3 +82,5 @@ pipeline:
path: *when_path path: *when_path
- cron: update_docs - cron: update_docs
event: cron event: cron
steps: *legacy

View file

@ -10,7 +10,7 @@ variables:
# schema changes # schema changes
- "pipeline/schema/**" - "pipeline/schema/**"
pipeline: pipeline: &legacy
vendor: vendor:
image: *golang_image image: *golang_image
group: prepare group: prepare
@ -146,3 +146,5 @@ services:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes - MYSQL_ALLOW_EMPTY_PASSWORD=yes
when: when:
path: *when_path path: *when_path
steps: *legacy

View file

@ -6,7 +6,7 @@ variables:
# web source code # web source code
- "web/**" - "web/**"
pipeline: pipeline: &legacy
deps: deps:
image: *node_image image: *node_image
directory: web/ directory: web/
@ -64,3 +64,5 @@ pipeline:
- pnpm test - pnpm test
when: when:
path: *when_path path: *when_path
steps: *legacy

View file

@ -12,7 +12,7 @@ Woodpecker is a simple CI engine with great extensibility. It runs your pipeline
```yaml ```yaml
# .woodpecker.yml # .woodpecker.yml
pipeline: steps:
build: build:
image: debian image: debian
commands: commands:
@ -23,7 +23,7 @@ pipeline:
- echo "Testing.." - echo "Testing.."
``` ```
### Pipeline steps are containers ### Steps are containers
- Define any container image as context - Define any container image as context
- either use your own and install the needed tools in custom image or - either use your own and install the needed tools in custom image or
@ -31,7 +31,7 @@ pipeline:
- List the commands that should be executed in your container, in order to build or test your application - List the commands that should be executed in your container, in order to build or test your application
```diff ```diff
pipeline: steps:
build: build:
- image: debian - image: debian
+ image: mycompany/image-with-awscli + image: mycompany/image-with-awscli
@ -41,12 +41,12 @@ pipeline:
### File changes are incremental ### File changes are incremental
- Woodpecker clones the source code in the beginning pipeline - Woodpecker clones the source code in the beginning
- Changes to files are persisted through steps as the same volume is mounted to all steps - Changes to files are persisted through steps as the same volume is mounted to all steps
```yaml ```yaml
# .woodpecker.yml # .woodpecker.yml
pipeline: steps:
build: build:
image: debian image: debian
commands: commands:
@ -78,7 +78,7 @@ kubectl apply -f $PLUGIN_TEMPLATE
```yaml ```yaml
# .woodpecker.yml # .woodpecker.yml
pipeline: steps:
deploy-to-k8s: deploy-to-k8s:
image: laszlocloud/my-k8s-plugin image: laszlocloud/my-k8s-plugin
settings: settings:

View file

@ -32,7 +32,7 @@ Read more at: [https://github.com/go-yaml/yaml](https://github.com/go-yaml/yaml/
Example pipeline configuration: Example pipeline configuration:
```yaml ```yaml
pipeline: steps:
build: build:
image: golang image: golang
commands: commands:
@ -50,7 +50,7 @@ services:
Example pipeline configuration with multiple, serial steps: Example pipeline configuration with multiple, serial steps:
```yaml ```yaml
pipeline: steps:
backend: backend:
image: golang image: golang
commands: commands:

View file

@ -37,6 +37,6 @@ Sometimes there exist multiple terms that can be used for a thing, we try to def
[Forge]: ../30-administration/11-forges/10-overview.md [Forge]: ../30-administration/11-forges/10-overview.md
[Plugin]: ./51-plugins/10-plugins.md [Plugin]: ./51-plugins/10-plugins.md
[Workspace]: ./20-pipeline-syntax.md#workspace [Workspace]: ./20-pipeline-syntax.md#workspace
[Matrix]: ./30-matrix-pipelines.md [Matrix]: ./30-matrix-workflows.md
[Docker]: ../30-administration/22-backends/10-docker.md [Docker]: ../30-administration/22-backends/10-docker.md
[Local]: ../30-administration/22-backends/20-local.md [Local]: ../30-administration/22-backends/20-local.md

View file

@ -2,10 +2,10 @@
The pipeline section defines a list of steps to build, test and deploy your code. Pipeline steps are executed serially, in the order in which they are defined. If a step returns a non-zero exit code, the pipeline immediately aborts and returns a failure status. The pipeline section defines a list of steps to build, test and deploy your code. Pipeline steps are executed serially, in the order in which they are defined. If a step returns a non-zero exit code, the pipeline immediately aborts and returns a failure status.
Example pipeline: Example steps:
```yaml ```yaml
pipeline: steps:
backend: backend:
image: golang image: golang
commands: commands:
@ -24,7 +24,7 @@ In the above example we define two pipeline steps, `frontend` and `backend`. The
Another way to name a step is by using the name keyword: Another way to name a step is by using the name keyword:
```yaml ```yaml
pipeline: steps:
- name: backend - name: backend
image: golang image: golang
commands: commands:
@ -54,7 +54,7 @@ Every step of your pipeline executes arbitrary commands inside a specified conta
The associated commit of a current pipeline run is checked out with git to a workspace which is mounted to every step of the pipeline as the working directory. The associated commit of a current pipeline run is checked out with git to a workspace which is mounted to every step of the pipeline as the working directory.
```diff ```diff
pipeline: steps:
backend: backend:
image: golang image: golang
commands: commands:
@ -69,7 +69,7 @@ The associated commit of a current pipeline run is checked out with git to a wor
```yaml ```yaml
# .woodpecker.yml # .woodpecker.yml
pipeline: steps:
build: build:
image: debian image: debian
commands: commands:
@ -87,7 +87,7 @@ Woodpecker pulls the defined image and uses it as environment to execute the pip
When using the `local` backend, the `image` entry is used to specify the shell, such as Bash or Fish, that is used to run the commands. When using the `local` backend, the `image` entry is used to specify the shell, such as Bash or Fish, that is used to run the commands.
```diff ```diff
pipeline: steps:
build: build:
+ image: golang:1.6 + image: golang:1.6
commands: commands:
@ -116,7 +116,7 @@ image: index.docker.io/library/golang:1.7
Woodpecker does not automatically upgrade container images. Example configuration to always pull the latest image when updates are available: Woodpecker does not automatically upgrade container images. Example configuration to always pull the latest image when updates are available:
```diff ```diff
pipeline: steps:
build: build:
image: golang:latest image: golang:latest
+ pull: true + pull: true
@ -131,7 +131,7 @@ These credentials are never exposed to your pipeline, which means they cannot be
Example configuration using a private image: Example configuration using a private image:
```diff ```diff
pipeline: steps:
build: build:
+ image: gcr.io/custom/golang + image: gcr.io/custom/golang
commands: commands:
@ -168,7 +168,7 @@ For specific details on configuring access to Google Container Registry, please
Commands of every pipeline step are executed serially as if you would enter them into your local shell. Commands of every pipeline step are executed serially as if you would enter them into your local shell.
```diff ```diff
pipeline: steps:
backend: backend:
image: golang image: golang
commands: commands:
@ -211,7 +211,7 @@ For more details check the [secrets docs](./40-secrets.md).
Some of the pipeline steps may be allowed to fail without causing the whole pipeline to report a failure (e.g., a step executing a linting check). To enable this, add `failure: ignore` to your pipeline step. If Woodpecker encounters an error while executing the step, it will report it as failed but still execute the next steps of the pipeline, if any, without affecting the status of the pipeline. Some of the pipeline steps may be allowed to fail without causing the whole pipeline to report a failure (e.g., a step executing a linting check). To enable this, add `failure: ignore` to your pipeline step. If Woodpecker encounters an error while executing the step, it will report it as failed but still execute the next steps of the pipeline, if any, without affecting the status of the pipeline.
```diff ```diff
pipeline: steps:
backend: backend:
image: golang image: golang
commands: commands:
@ -225,7 +225,7 @@ Some of the pipeline steps may be allowed to fail without causing the whole pipe
Woodpecker supports defining a list of conditions for a pipeline step by using a `when` block. If at least one of the conditions in the `when` block evaluate to true the step is executed, otherwise it is skipped. A condition can be a check like: Woodpecker supports defining a list of conditions for a pipeline step by using a `when` block. If at least one of the conditions in the `when` block evaluate to true the step is executed, otherwise it is skipped. A condition can be a check like:
```diff ```diff
pipeline: steps:
slack: slack:
image: plugins/slack image: plugins/slack
settings: settings:
@ -242,7 +242,7 @@ Woodpecker supports defining a list of conditions for a pipeline step by using a
Example conditional execution by repository: Example conditional execution by repository:
```diff ```diff
pipeline: steps:
slack: slack:
image: plugins/slack image: plugins/slack
settings: settings:
@ -260,7 +260,7 @@ Branch conditions are not applied to tags.
Example conditional execution by branch: Example conditional execution by branch:
```diff ```diff
pipeline: steps:
slack: slack:
image: plugins/slack image: plugins/slack
settings: settings:
@ -363,7 +363,7 @@ when:
There are use cases for executing pipeline steps on failure, such as sending notifications for failed pipelines. Use the status constraint to execute steps even when the pipeline fails: There are use cases for executing pipeline steps on failure, such as sending notifications for failed pipelines. Use the status constraint to execute steps even when the pipeline fails:
```diff ```diff
pipeline: steps:
slack: slack:
image: plugins/slack image: plugins/slack
settings: settings:
@ -375,7 +375,7 @@ pipeline:
#### `platform` #### `platform`
:::note :::note
This condition should be used in conjunction with a [matrix](./30-matrix-pipelines.md#example-matrix-pipeline-using-multiple-platforms) pipeline as a regular pipeline will only executed by a single agent which only has one arch. This condition should be used in conjunction with a [matrix](./30-matrix-workflows.md#example-matrix-pipeline-using-multiple-platforms) pipeline as a regular pipeline will only executed by a single agent which only has one arch.
::: :::
Execute a step for a specific platform: Execute a step for a specific platform:
@ -489,7 +489,7 @@ Woodpecker supports parallel step execution for same-machine fan-in and fan-out.
Example parallel configuration: Example parallel configuration:
```diff ```diff
pipeline: steps:
backend: backend:
+ group: build + group: build
image: golang image: golang
@ -547,7 +547,7 @@ The workspace can be customized using the workspace block in the YAML file:
+ base: /go + base: /go
+ path: src/github.com/octocat/hello-world + path: src/github.com/octocat/hello-world
pipeline: steps:
build: build:
image: golang:latest image: golang:latest
commands: commands:
@ -562,7 +562,7 @@ The base attribute defines a shared base volume available to all pipeline steps.
+ base: /go + base: /go
path: src/github.com/octocat/hello-world path: src/github.com/octocat/hello-world
pipeline: steps:
deps: deps:
image: golang:latest image: golang:latest
commands: commands:
@ -600,7 +600,7 @@ git clone https://github.com/octocat/hello-world \
Woodpecker has integrated support for matrix builds. Woodpecker executes a separate build task for each combination in the matrix, allowing you to build and test a single commit against multiple configurations. Woodpecker has integrated support for matrix builds. Woodpecker executes a separate build task for each combination in the matrix, allowing you to build and test a single commit against multiple configurations.
For more details check the [matrix build docs](./30-matrix-pipelines.md). For more details check the [matrix build docs](./30-matrix-workflows.md).
## `platform` ## `platform`
@ -614,7 +614,7 @@ Assuming we have two agents, one `arm` and one `amd64`. Previously this pipeline
```diff ```diff
+platform: linux/arm64 +platform: linux/arm64
pipeline: steps:
build: build:
image: golang image: golang
commands: commands:
@ -639,7 +639,7 @@ You can add additional labels as a key value map:
+ weather: sun + weather: sun
+ hostname: "" # this label will be ignored as it is empty + hostname: "" # this label will be ignored as it is empty
pipeline: steps:
build: build:
image: golang image: golang
commands: commands:
@ -664,7 +664,7 @@ You can manually configure the clone step in your pipeline for customization:
+ git: + git:
+ image: woodpeckerci/plugin-git + image: woodpeckerci/plugin-git
pipeline: steps:
build: build:
image: golang image: golang
commands: commands:
@ -723,7 +723,7 @@ To use the ssh git url in `.gitmodules` for users cloning with ssh, and also use
+ submodule_override: + submodule_override:
+ my-module: https://github.com/octocat/my-module.git + my-module: https://github.com/octocat/my-module.git
pipeline: steps:
... ...
``` ```
@ -747,7 +747,7 @@ Example conditional execution by repository:
+when: +when:
+ repo: test/test + repo: test/test
+ +
pipeline: steps:
slack: slack:
image: plugins/slack image: plugins/slack
settings: settings:
@ -766,7 +766,7 @@ Example conditional execution by branch:
+when: +when:
+ branch: master + branch: master
+ +
pipeline: steps:
slack: slack:
image: plugins/slack image: plugins/slack
settings: settings:
@ -896,7 +896,7 @@ Woodpecker gives the ability to configure privileged mode in the YAML. You can u
> Privileged mode is only available to trusted repositories and for security reasons should only be used in private environments. See [project settings](./71-project-settings.md#trusted) to enable trusted mode. > Privileged mode is only available to trusted repositories and for security reasons should only be used in private environments. See [project settings](./71-project-settings.md#trusted) to enable trusted mode.
```diff ```diff
pipeline: steps:
build: build:
image: docker image: docker
environment: environment:

View file

@ -36,7 +36,7 @@ If you still need to pass artifacts between the workflows you need use some stor
.woodpecker/.build.yml .woodpecker/.build.yml
```yaml ```yaml
pipeline: steps:
build: build:
image: debian:stable-slim image: debian:stable-slim
commands: commands:
@ -47,7 +47,7 @@ pipeline:
.woodpecker/.deploy.yml .woodpecker/.deploy.yml
```yaml ```yaml
pipeline: steps:
deploy: deploy:
image: debian:stable-slim image: debian:stable-slim
commands: commands:
@ -62,7 +62,7 @@ depends_on:
.woodpecker/.test.yml .woodpecker/.test.yml
```yaml ```yaml
pipeline: steps:
test: test:
image: debian:stable-slim image: debian:stable-slim
commands: commands:
@ -76,7 +76,7 @@ depends_on:
.woodpecker/.lint.yml .woodpecker/.lint.yml
```yaml ```yaml
pipeline: steps:
lint: lint:
image: debian:stable-slim image: debian:stable-slim
commands: commands:
@ -97,7 +97,7 @@ Dependencies between workflows can be set with the `depends_on` element. A workf
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.yml` the corresponding `depends_on` entry would be `lint`.
```diff ```diff
pipeline: steps:
deploy: deploy:
image: debian:stable-slim image: debian:stable-slim
commands: commands:
@ -112,7 +112,7 @@ pipeline:
Workflows that need to run even on failures should set the `runs_on` tag. Workflows that need to run even on failures should set the `runs_on` tag.
```diff ```diff
pipeline: steps:
notify: notify:
image: debian:stable-slim image: debian:stable-slim
commands: commands:

View file

@ -1,4 +1,4 @@
# Matrix pipelines # Matrix workflows
Woodpecker has integrated support for matrix workflows. Woodpecker executes a separate workflow for each combination in the matrix, allowing you to build and test a single commit against multiple configurations. Woodpecker has integrated support for matrix workflows. Woodpecker executes a separate workflow for each combination in the matrix, allowing you to build and test a single commit against multiple configurations.
@ -42,7 +42,7 @@ matrix:
- mysql:6.5 - mysql:6.5
- mariadb:10.1 - mariadb:10.1
pipeline: steps:
build: build:
image: golang:${GO_VERSION} image: golang:${GO_VERSION}
commands: commands:
@ -58,7 +58,7 @@ services:
Example YAML file after injecting the matrix parameters: Example YAML file after injecting the matrix parameters:
```diff ```diff
pipeline: steps:
build: build:
- image: golang:${GO_VERSION} - image: golang:${GO_VERSION}
+ image: golang:1.4 + image: golang:1.4
@ -87,7 +87,7 @@ matrix:
- 1.8 - 1.8
- latest - latest
pipeline: steps:
build: build:
image: golang:${TAG} image: golang:${TAG}
commands: commands:
@ -104,7 +104,7 @@ matrix:
- golang:1.8 - golang:1.8
- golang:latest - golang:latest
pipeline: steps:
build: build:
image: ${IMAGE} image: ${IMAGE}
commands: commands:
@ -122,7 +122,7 @@ matrix:
platform: ${platform} platform: ${platform}
pipeline: steps:
test: test:
image: alpine image: alpine
commands: commands:

View file

@ -6,7 +6,7 @@ You can use [YAML anchors & aliases](https://yaml.org/spec/1.2.2/#3222-anchors-a
To convert this: To convert this:
```yml ```yml
pipeline: steps:
test: test:
image: golang:1.18 image: golang:1.18
commands: go test ./... commands: go test ./...
@ -21,7 +21,7 @@ Just add a new section called **variables** like this:
+variables: +variables:
+ - &golang_image 'golang:1.18' + - &golang_image 'golang:1.18'
pipeline: steps:
test: test:
- image: golang:1.18 - image: golang:1.18
+ image: *golang_image + image: *golang_image
@ -44,7 +44,7 @@ variables:
special: true special: true
- &some-plugin codeberg.org/6543/docker-images/print_env - &some-plugin codeberg.org/6543/docker-images/print_env
pipeline: steps:
develop: develop:
image: *some-plugin image: *some-plugin
settings: settings:
@ -74,7 +74,7 @@ variables:
hello_cmd: &hello_cmd hello_cmd: &hello_cmd
- echo hello - echo hello
pipeline: steps:
step1: step1:
image: debian image: debian
commands: commands:

View file

@ -5,7 +5,7 @@ Woodpecker provides the ability to store named parameters external to the YAML c
Secrets are exposed to your pipeline steps and plugins as uppercase environment variables and can therefore be referenced in the commands section of your pipeline. Secrets are exposed to your pipeline steps and plugins as uppercase environment variables and can therefore be referenced in the commands section of your pipeline.
```diff ```diff
pipeline: steps:
docker: docker:
image: docker image: docker
commands: commands:
@ -20,7 +20,7 @@ In this example, the secret named `secret_token` would be passed to the pipeline
**NOTE:** the `from_secret` syntax only works with the newer `settings` block. **NOTE:** the `from_secret` syntax only works with the newer `settings` block.
```diff ```diff
pipeline: steps:
docker: docker:
image: my-plugin image: my-plugin
settings: settings:
@ -32,7 +32,7 @@ pipeline:
Please note parameter expressions are subject to pre-processing. When using secrets in parameter expressions they should be escaped. Please note parameter expressions are subject to pre-processing. When using secrets in parameter expressions they should be escaped.
```diff ```diff
pipeline: steps:
docker: docker:
image: docker image: docker
commands: commands:
@ -52,7 +52,7 @@ Secrets are added to the Woodpecker secret store on the UI or with the CLI.
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: 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 ```diff
pipeline: steps:
docker: docker:
image: plugins/docker image: plugins/docker
repo: octocat/hello-world repo: octocat/hello-world

View file

@ -12,7 +12,7 @@ Read more at: [pipeline-syntax#event](./20-pipeline-syntax.md#event)
1. To create a new cron job adjust your pipeline config(s) and add the event filter to all steps you would like to run by the cron job: 1. To create a new cron job adjust your pipeline config(s) and add the event filter to all steps you would like to run by the cron job:
```diff ```diff
pipeline: steps:
sync_locales: sync_locales:
image: weblate_sync image: weblate_sync
settings: settings:

View file

@ -3,7 +3,7 @@
Woodpecker provides the ability to pass environment variables to individual pipeline steps. Example pipeline step with custom environment variables: Woodpecker provides the ability to pass environment variables to individual pipeline steps. Example pipeline step with custom environment variables:
```diff ```diff
pipeline: steps:
build: build:
image: golang image: golang
+ environment: + environment:
@ -18,7 +18,7 @@ pipeline:
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. 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 ```diff
pipeline: steps:
build: build:
image: golang image: golang
- environment: - environment:
@ -32,7 +32,7 @@ pipeline:
> 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: > 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:
```diff ```diff
pipeline: steps:
build: build:
image: golang image: golang
commands: commands:
@ -146,7 +146,7 @@ services:
These can be used, for example, to manage the image tag used by multiple projects. These can be used, for example, to manage the image tag used by multiple projects.
```diff ```diff
pipeline: steps:
build: build:
- image: golang:1.18 - image: golang:1.18
+ image: golang:${GOLANG_VERSION} + image: golang:${GOLANG_VERSION}
@ -164,7 +164,7 @@ Woodpecker provides the ability to substitute environment variables at runtime.
Example commit substitution: Example commit substitution:
```diff ```diff
pipeline: steps:
docker: docker:
image: plugins/docker image: plugins/docker
settings: settings:
@ -174,7 +174,7 @@ pipeline:
Example tag substitution: Example tag substitution:
```diff ```diff
pipeline: steps:
docker: docker:
image: plugins/docker image: plugins/docker
settings: settings:
@ -202,7 +202,7 @@ Woodpecker also emulates bash string operations. This gives us the ability to ma
Example variable substitution with substring: Example variable substitution with substring:
```diff ```diff
pipeline: steps:
docker: docker:
image: plugins/docker image: plugins/docker
settings: settings:
@ -212,7 +212,7 @@ pipeline:
Example variable substitution strips `v` prefix from `v.1.0.0`: Example variable substitution strips `v` prefix from `v.1.0.0`:
```diff ```diff
pipeline: steps:
docker: docker:
image: plugins/docker image: plugins/docker
settings: settings:

View file

@ -7,7 +7,7 @@ They are automatically pulled from the default container registry the agent's ha
Example pipeline using the Docker and Slack plugins: Example pipeline using the Docker and Slack plugins:
```yaml ```yaml
pipeline: steps:
build: build:
image: golang image: golang
commands: commands:

View file

@ -7,7 +7,7 @@ This provides a brief tutorial for creating a Woodpecker webhook plugin, using s
The below example demonstrates how we might configure a webhook plugin in the YAML file: The below example demonstrates how we might configure a webhook plugin in the YAML file:
```yaml ```yaml
pipeline: steps:
webhook: webhook:
image: foo/webhook image: foo/webhook
settings: settings:

View file

@ -7,7 +7,7 @@ Services are accessed using custom hostnames.
In the example below, the MySQL service is assigned the hostname `database` and is available at `database:3306`. In the example below, the MySQL service is assigned the hostname `database` and is available at `database:3306`.
```diff ```diff
pipeline: steps:
build: build:
image: golang image: golang
commands: commands:
@ -43,7 +43,7 @@ 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. 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 ```diff
pipeline: steps:
build: build:
image: golang image: golang
commands: commands:
@ -67,7 +67,7 @@ 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. 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 ```diff
pipeline: steps:
test: test:
image: golang image: golang
commands: commands:
@ -89,7 +89,7 @@ services:
environment: environment:
- MYSQL_DATABASE=test - MYSQL_DATABASE=test
- MYSQL_ROOT_PASSWORD=example - MYSQL_ROOT_PASSWORD=example
pipeline: steps:
get-version: get-version:
image: ubuntu image: ubuntu
commands: commands:

View file

@ -7,7 +7,7 @@ Volumes are only available to trusted repositories and for security reasons shou
::: :::
```diff ```diff
pipeline: steps:
build: build:
image: docker image: docker
commands: commands:

View file

@ -84,7 +84,7 @@ WOODPECKER_CONFIG_SERVICE_ENDPOINT=https://example.com/ciconfig
"configs": [ "configs": [
{ {
"name": ".woodpecker.yml", "name": ".woodpecker.yml",
"data": "pipeline:\n backend:\n image: alpine\n commands:\n - echo \"Hello there from Repo (.woodpecker.yml)\"\n" "data": "steps:\n backend:\n image: alpine\n commands:\n - echo \"Hello there from Repo (.woodpecker.yml)\"\n"
} }
] ]
} }
@ -97,7 +97,7 @@ WOODPECKER_CONFIG_SERVICE_ENDPOINT=https://example.com/ciconfig
"configs": [ "configs": [
{ {
"name": "central-override", "name": "central-override",
"data": "pipeline:\n backend:\n image: alpine\n commands:\n - echo \"Hello there from ConfigAPI\"\n" "data": "steps:\n backend:\n image: alpine\n commands:\n - echo \"Hello there from ConfigAPI\"\n"
} }
] ]
} }

View file

@ -85,7 +85,7 @@ used to run the commands.
```yaml ```yaml
# .woodpecker.yml # .woodpecker.yml
pipeline: steps:
build: build:
image: bash image: bash
commands: commands:
@ -116,7 +116,7 @@ only run on this agent:
labels: labels:
type: exec type: exec
pipeline: steps:
[...] [...]
``` ```

View file

@ -46,7 +46,7 @@ The kubernetes backend also allows for specifying requests and limits on a per-s
Example pipeline configuration: Example pipeline configuration:
```yaml ```yaml
pipeline: steps:
build: build:
image: golang image: golang
commands: commands:

View file

@ -18,6 +18,7 @@ Some versions need some changes to the server configuration or the pipeline conf
- The pipelines are now also read from `.yaml` files, the new default order is `.woodpecker/*.yml` and `.woodpecker/*.yaml` (without any prioritization) -> `.woodpecker.yml` -> `.woodpecker.yaml` - The pipelines are now also read from `.yaml` files, the new default order is `.woodpecker/*.yml` and `.woodpecker/*.yaml` (without any prioritization) -> `.woodpecker.yml` -> `.woodpecker.yaml`
- Dropped support for [Coding](https://coding.net/) and [Gogs](https://gogs.io). - Dropped support for [Coding](https://coding.net/) and [Gogs](https://gogs.io).
- `/api/queue/resume` & `/api/queue/pause` endpoint methods were changed from `GET` to `POST` - `/api/queue/resume` & `/api/queue/pause` endpoint methods were changed from `GET` to `POST`
- rename `pipeline:` key in your workflow config to `steps:`
## 0.15.0 ## 0.15.0
@ -75,7 +76,7 @@ Some versions need some changes to the server configuration or the pipeline conf
- Plugin Settings moved into `settings` section: - Plugin Settings moved into `settings` section:
```diff ```diff
pipeline: steps:
something: something:
image: my/plugin image: my/plugin
- setting1: foo - setting1: foo

View file

@ -33,11 +33,11 @@ func TestEnvVarSubst(t *testing.T) {
want string want string
}{{ }{{
name: "simple substitution", name: "simple substitution",
yaml: `pipeline: yaml: `steps:
step1: step1:
image: ${HELLO_IMAGE}`, image: ${HELLO_IMAGE}`,
environ: map[string]string{"HELLO_IMAGE": "hello-world"}, environ: map[string]string{"HELLO_IMAGE": "hello-world"},
want: `pipeline: want: `steps:
step1: step1:
image: hello-world`, image: hello-world`,
}} }}

View file

@ -8,7 +8,7 @@ import (
func TestLint(t *testing.T) { func TestLint(t *testing.T) {
testdatas := []struct{ Title, Data string }{{Title: "map", Data: ` testdatas := []struct{ Title, Data string }{{Title: "map", Data: `
pipeline: steps:
build: build:
image: docker image: docker
privileged: true privileged: true
@ -27,7 +27,7 @@ services:
redis: redis:
image: redis image: redis
`}, {Title: "list", Data: ` `}, {Title: "list", Data: `
pipeline: steps:
- name: build - name: build
image: docker image: docker
privileged: true privileged: true
@ -50,7 +50,7 @@ variables:
commands: commands:
- go version - go version
pipeline: steps:
test base step: test base step:
<<: *base-step <<: *base-step
test base step with latest image: test base step with latest image:
@ -82,52 +82,52 @@ func TestLintErrors(t *testing.T) {
want: "Invalid or missing pipeline section", want: "Invalid or missing pipeline section",
}, },
{ {
from: "pipeline: { build: { image: '' } }", from: "steps: { build: { image: '' } }",
want: "Invalid or missing image", want: "Invalid or missing image",
}, },
{ {
from: "pipeline: { build: { image: golang, privileged: true } }", from: "steps: { build: { image: golang, privileged: true } }",
want: "Insufficient privileges to use privileged mode", want: "Insufficient privileges to use privileged mode",
}, },
{ {
from: "pipeline: { build: { image: golang, shm_size: 10gb } }", from: "steps: { build: { image: golang, shm_size: 10gb } }",
want: "Insufficient privileges to override shm_size", want: "Insufficient privileges to override shm_size",
}, },
{ {
from: "pipeline: { build: { image: golang, dns: [ 8.8.8.8 ] } }", from: "steps: { build: { image: golang, dns: [ 8.8.8.8 ] } }",
want: "Insufficient privileges to use custom dns", want: "Insufficient privileges to use custom dns",
}, },
{ {
from: "pipeline: { build: { image: golang, dns_search: [ example.com ] } }", from: "steps: { build: { image: golang, dns_search: [ example.com ] } }",
want: "Insufficient privileges to use dns_search", want: "Insufficient privileges to use dns_search",
}, },
{ {
from: "pipeline: { build: { image: golang, devices: [ '/dev/tty0:/dev/tty0' ] } }", from: "steps: { build: { image: golang, devices: [ '/dev/tty0:/dev/tty0' ] } }",
want: "Insufficient privileges to use devices", want: "Insufficient privileges to use devices",
}, },
{ {
from: "pipeline: { build: { image: golang, extra_hosts: [ 'somehost:162.242.195.82' ] } }", from: "steps: { build: { image: golang, extra_hosts: [ 'somehost:162.242.195.82' ] } }",
want: "Insufficient privileges to use extra_hosts", want: "Insufficient privileges to use extra_hosts",
}, },
{ {
from: "pipeline: { build: { image: golang, network_mode: host } }", from: "steps: { build: { image: golang, network_mode: host } }",
want: "Insufficient privileges to use network_mode", want: "Insufficient privileges to use network_mode",
}, },
{ {
from: "pipeline: { build: { image: golang, networks: [ outside, default ] } }", from: "steps: { build: { image: golang, networks: [ outside, default ] } }",
want: "Insufficient privileges to use networks", want: "Insufficient privileges to use networks",
}, },
{ {
from: "pipeline: { build: { image: golang, volumes: [ '/opt/data:/var/lib/mysql' ] } }", from: "steps: { build: { image: golang, volumes: [ '/opt/data:/var/lib/mysql' ] } }",
want: "Insufficient privileges to use volumes", want: "Insufficient privileges to use volumes",
}, },
{ {
from: "pipeline: { build: { image: golang, network_mode: 'container:name' } }", from: "steps: { build: { image: golang, network_mode: 'container:name' } }",
want: "Insufficient privileges to use network_mode", want: "Insufficient privileges to use network_mode",
}, },
{ {
from: "pipeline: { build: { image: golang, sysctls: [ net.core.somaxconn=1024 ] } }", from: "steps: { build: { image: golang, sysctls: [ net.core.somaxconn=1024 ] } }",
want: "Insufficient privileges to use sysctls", want: "Insufficient privileges to use sysctls",
}, },
} }

View file

@ -29,6 +29,12 @@ func ParseBytes(b []byte) (*types.Workflow, error) {
out.BranchesDontUseIt = nil out.BranchesDontUseIt = nil
} }
// support deprecated pipeline keyword
if len(out.PipelineDontUseIt.ContainerList) != 0 && len(out.Steps.ContainerList) == 0 {
out.Steps.ContainerList = out.PipelineDontUseIt.ContainerList
}
out.PipelineDontUseIt.ContainerList = nil
return out, nil return out, nil
} }

View file

@ -4,6 +4,7 @@ import (
"testing" "testing"
"github.com/franela/goblin" "github.com/franela/goblin"
"github.com/stretchr/testify/assert"
"github.com/woodpecker-ci/woodpecker/pipeline/frontend/metadata" "github.com/woodpecker-ci/woodpecker/pipeline/frontend/metadata"
yaml_base_types "github.com/woodpecker-ci/woodpecker/pipeline/frontend/yaml/types/base" yaml_base_types "github.com/woodpecker-ci/woodpecker/pipeline/frontend/yaml/types/base"
@ -123,6 +124,41 @@ func TestParse(t *testing.T) {
}) })
} }
func TestParseLegacy(t *testing.T) {
sampleYamlPipelineLegacy := `
pipeline:
say hello:
image: bash
commands: echo hello
`
sampleYamlPipelineLegacyIgnore := `
steps:
say hello:
image: bash
commands: echo hello
pipeline:
old crap:
image: bash
commands: meh!
`
workflow1, err := ParseString(sampleYamlPipelineLegacy)
if !assert.NoError(t, err) {
t.Fail()
}
workflow2, err := ParseString(sampleYamlPipelineLegacyIgnore)
if !assert.NoError(t, err) {
t.Fail()
}
assert.EqualValues(t, workflow1, workflow2)
assert.Len(t, workflow1.Steps.ContainerList, 1)
assert.EqualValues(t, "say hello", workflow1.Steps.ContainerList[0].Name)
}
var sampleYaml = ` var sampleYaml = `
image: hello-world image: hello-world
when: when:
@ -137,7 +173,7 @@ build:
workspace: workspace:
path: src/github.com/octocat/hello-world path: src/github.com/octocat/hello-world
base: /go base: /go
pipeline: steps:
test: test:
image: golang image: golang
commands: commands:
@ -178,7 +214,7 @@ runs_on:
var simpleYamlAnchors = ` var simpleYamlAnchors = `
vars: vars:
image: &image plugins/slack image: &image plugins/slack
pipeline: steps:
notify_success: notify_success:
image: *image image: *image
` `
@ -186,7 +222,7 @@ pipeline:
var sampleVarYaml = ` var sampleVarYaml = `
_slack: &SLACK _slack: &SLACK
image: plugins/slack image: plugins/slack
pipeline: steps:
notify_fail: *SLACK notify_fail: *SLACK
notify_success: notify_success:
<< : *SLACK << : *SLACK

View file

@ -12,7 +12,7 @@ type (
Platform string `yaml:"platform,omitempty"` Platform string `yaml:"platform,omitempty"`
Workspace Workspace `yaml:"workspace,omitempty"` Workspace Workspace `yaml:"workspace,omitempty"`
Clone ContainerList `yaml:"clone,omitempty"` Clone ContainerList `yaml:"clone,omitempty"`
Steps ContainerList `yaml:"pipeline"` // TODO: discussed if we should rename it to "steps" Steps ContainerList `yaml:"steps,omitempty"`
Services ContainerList `yaml:"services,omitempty"` Services ContainerList `yaml:"services,omitempty"`
Labels base.SliceOrMap `yaml:"labels,omitempty"` Labels base.SliceOrMap `yaml:"labels,omitempty"`
DependsOn []string `yaml:"depends_on,omitempty"` DependsOn []string `yaml:"depends_on,omitempty"`
@ -24,6 +24,8 @@ type (
Volumes WorkflowVolumes `yaml:"volumes,omitempty"` Volumes WorkflowVolumes `yaml:"volumes,omitempty"`
// Deprecated // Deprecated
BranchesDontUseIt *constraint.List `yaml:"branches,omitempty"` BranchesDontUseIt *constraint.List `yaml:"branches,omitempty"`
// Deprecated
PipelineDontUseIt ContainerList `yaml:"pipeline,omitempty"`
} }
// Workspace defines a pipeline workspace. // Workspace defines a pipeline workspace.

View file

@ -7,7 +7,7 @@ clone:
image: woodpeckerci/plugin-git image: woodpeckerci/plugin-git
depth: 50 depth: 50
pipeline: steps:
build: build:
image: golang:1.7 image: golang:1.7
commands: commands:

View file

@ -9,7 +9,7 @@ clone:
image: woodpeckerci/plugin-git:windows image: woodpeckerci/plugin-git:windows
depth: 50 depth: 50
pipeline: steps:
build: build:
image: golang:1.10.1-nanoserver-sac2016 image: golang:1.10.1-nanoserver-sac2016
commands: commands:

View file

@ -2,7 +2,7 @@ workspace:
base: /go base: /go
path: src/github.com/go-sql-driver/mysql path: src/github.com/go-sql-driver/mysql
pipeline: steps:
build: build:
image: golang:1.7 image: golang:1.7
environment: environment:

View file

@ -7,7 +7,7 @@ clone:
image: woodpeckerci/plugin-git image: woodpeckerci/plugin-git
depth: 50 depth: 50
pipeline: steps:
build: build:
image: golang:1.7 image: golang:1.7
commands: commands:

View file

@ -7,7 +7,7 @@ clone:
image: woodpeckerci/plugin-git image: woodpeckerci/plugin-git
depth: 50 depth: 50
pipeline: steps:
build: build:
image: golang:1.7 image: golang:1.7
commands: commands:

View file

@ -7,7 +7,7 @@ clone:
image: woodpeckerci/plugin-git image: woodpeckerci/plugin-git
depth: 50 depth: 50
pipeline: steps:
# these steps define a parallel execution # these steps define a parallel execution
# group and will fan out. # group and will fan out.

View file

@ -7,7 +7,7 @@ clone:
image: woodpeckerci/plugin-git image: woodpeckerci/plugin-git
depth: 50 depth: 50
pipeline: steps:
build: build:
image: golang:1.7 image: golang:1.7
commands: commands:

View file

@ -2,7 +2,7 @@ workspace:
base: /go base: /go
path: src/github.com/drone/envsubst path: src/github.com/drone/envsubst
pipeline: steps:
build: build:
image: redis:3.0 image: redis:3.0
commands: commands:

View file

@ -7,7 +7,7 @@ clone:
image: woodpeckerci/plugin-git image: woodpeckerci/plugin-git
depth: 50 depth: 50
pipeline: steps:
build: build:
image: tutum/curl image: tutum/curl
# A container named "vpn" should exist on the same docker daemon # A container named "vpn" should exist on the same docker daemon

View file

@ -1,4 +1,4 @@
pipeline: steps:
ping: ping:
image: postgres image: postgres
commands: commands:

View file

@ -1,7 +1,7 @@
cache: cache:
- node_modules - node_modules
pipeline: steps:
build: build:
image: node image: node
commands: commands:

View file

@ -1,6 +1,6 @@
branches: [master, pages] branches: [master, pages]
pipeline: steps:
build: build:
image: golang image: golang
commands: commands:

View file

@ -2,7 +2,7 @@ branches:
include: master include: master
exclude: [ develop, feature/* ] exclude: [ develop, feature/* ]
pipeline: steps:
build: build:
image: golang image: golang
commands: commands:

View file

@ -1,6 +1,6 @@
branches: master branches: master
pipeline: steps:
build: build:
image: golang image: golang
commands: commands:

View file

@ -5,7 +5,7 @@ matri:
- 1.14 - 1.14
- 1.13 - 1.13
pipeline: steps:
test: test:
image: golang:${GO_VERSION} image: golang:${GO_VERSION}
commands: commands:

View file

@ -1,4 +1,4 @@
pipeline: steps:
test: test:
image: alpine image: alpine
commands: commands:

View file

@ -7,7 +7,7 @@ clone:
submodule_override: submodule_override:
my-module: https://github.com/octocat/my-module.git my-module: https://github.com/octocat/my-module.git
pipeline: steps:
test: test:
image: alpine image: alpine
commands: commands:

View file

@ -3,7 +3,7 @@ labels:
weather: sun weather: sun
hostname: "" hostname: ""
pipeline: steps:
build: build:
image: golang:latest image: golang:latest
commands: commands:

View file

@ -1,4 +1,4 @@
pipeline: steps:
test: test:
image: golang:${GO_VERSION} image: golang:${GO_VERSION}
commands: commands:

View file

@ -5,7 +5,7 @@ variables:
- go version - go version
- whoami - whoami
pipeline: steps:
test-base-step: test-base-step:
<<: *base-step <<: *base-step
test base step with latest image: test base step with latest image:

View file

@ -1,4 +1,4 @@
pipeline: steps:
deploy: deploy:
image: golang image: golang
commands: commands:

View file

@ -11,7 +11,7 @@ when:
include: include:
- hello - hello
pipeline: steps:
echo: echo:
image: alpine image: alpine
commands: commands:

View file

@ -1,6 +1,6 @@
platform: linux/amd64 platform: linux/amd64
pipeline: steps:
build: build:
image: golang:latest image: golang:latest
commands: commands:

View file

@ -1,4 +1,4 @@
pipeline: steps:
build: build:
image: golang image: golang
commands: commands:

View file

@ -1,4 +1,4 @@
pipeline: steps:
build: build:
image: golang image: golang
commands: commands:

View file

@ -1,4 +1,4 @@
pipeline: steps:
build: build:
image: golang image: golang
commands: commands:

View file

@ -1,4 +1,4 @@
pipeline: steps:
image: image:
image: golang image: golang
commands: commands:

View file

@ -1,4 +1,4 @@
pipeline: steps:
when-branch: when-branch:
image: alpine image: alpine
commands: commands:

View file

@ -2,7 +2,7 @@ workspace:
base: /go base: /go
path: src/github.com/octocat/hello-world path: src/github.com/octocat/hello-world
pipeline: steps:
build: build:
image: golang:latest image: golang:latest
commands: commands:

View file

@ -4,7 +4,7 @@
"$id": "https://woodpecker-ci.org/schema/woodpecker.json", "$id": "https://woodpecker-ci.org/schema/woodpecker.json",
"description": "Schema of a Woodpecker pipeline file. Read more: https://woodpecker-ci.org/docs/usage/pipeline-syntax", "description": "Schema of a Woodpecker pipeline file. Read more: https://woodpecker-ci.org/docs/usage/pipeline-syntax",
"type": "object", "type": "object",
"required": ["pipeline"], "required": ["steps"],
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"$schema": { "$schema": {
@ -18,7 +18,8 @@
"skip_clone": { "type": "boolean" }, "skip_clone": { "type": "boolean" },
"branches": { "$ref": "#/definitions/branches" }, "branches": { "$ref": "#/definitions/branches" },
"when": { "$ref": "#/definitions/pipeline_when" }, "when": { "$ref": "#/definitions/pipeline_when" },
"pipeline": { "$ref": "#/definitions/pipeline" }, "steps": { "$ref": "#/definitions/step_list" },
"pipeline": { "$ref": "#/definitions/step_list", "description": "depricated, use steps" },
"services": { "$ref": "#/definitions/services" }, "services": { "$ref": "#/definitions/services" },
"workspace": { "$ref": "#/definitions/workspace" }, "workspace": { "$ref": "#/definitions/workspace" },
"matrix": { "$ref": "#/definitions/matrix" }, "matrix": { "$ref": "#/definitions/matrix" },
@ -92,8 +93,8 @@
} }
] ]
}, },
"pipeline": { "step_list": {
"description": "The pipeline section defines a list of steps which will be executed serially, in the order in which they are defined. Read more: https://woodpecker-ci.org/docs/usage/pipeline-syntax", "description": "The steps section defines a list of steps which will be executed serially, in the order in which they are defined. Read more: https://woodpecker-ci.org/docs/usage/pipeline-syntax",
"oneOf": [ "oneOf": [
{ "type": "object", "additionalProperties": { "$ref": "#/definitions/step" }, "minProperties": 1 }, { "type": "object", "additionalProperties": { "$ref": "#/definitions/step" }, "minProperties": 1 },
{ "type": "array", "items": { "$ref": "#/definitions/step" }, "minLength": 1 } { "type": "array", "items": { "$ref": "#/definitions/step" }, "minLength": 1 }

View file

@ -47,7 +47,7 @@ func TestGlobalEnvsubst(t *testing.T) {
Link: "", Link: "",
Yamls: []*forge_types.FileMeta{ Yamls: []*forge_types.FileMeta{
{Data: []byte(` {Data: []byte(`
pipeline: steps:
build: build:
image: ${IMAGE} image: ${IMAGE}
yyy: ${CI_COMMIT_MESSAGE} yyy: ${CI_COMMIT_MESSAGE}
@ -82,7 +82,7 @@ func TestMissingGlobalEnvsubst(t *testing.T) {
Link: "", Link: "",
Yamls: []*forge_types.FileMeta{ Yamls: []*forge_types.FileMeta{
{Data: []byte(` {Data: []byte(`
pipeline: steps:
build: build:
image: ${IMAGE} image: ${IMAGE}
yyy: ${CI_COMMIT_MESSAGE} yyy: ${CI_COMMIT_MESSAGE}
@ -114,13 +114,13 @@ bbb`,
Link: "", Link: "",
Yamls: []*forge_types.FileMeta{ Yamls: []*forge_types.FileMeta{
{Data: []byte(` {Data: []byte(`
pipeline: steps:
xxx: xxx:
image: scratch image: scratch
yyy: ${CI_COMMIT_MESSAGE} yyy: ${CI_COMMIT_MESSAGE}
`)}, `)},
{Data: []byte(` {Data: []byte(`
pipeline: steps:
build: build:
image: scratch image: scratch
yyy: ${CI_COMMIT_MESSAGE} yyy: ${CI_COMMIT_MESSAGE}
@ -149,12 +149,12 @@ func TestMultiPipeline(t *testing.T) {
Link: "", Link: "",
Yamls: []*forge_types.FileMeta{ Yamls: []*forge_types.FileMeta{
{Data: []byte(` {Data: []byte(`
pipeline: steps:
xxx: xxx:
image: scratch image: scratch
`)}, `)},
{Data: []byte(` {Data: []byte(`
pipeline: steps:
build: build:
image: scratch image: scratch
`)}, `)},
@ -184,17 +184,17 @@ func TestDependsOn(t *testing.T) {
Link: "", Link: "",
Yamls: []*forge_types.FileMeta{ Yamls: []*forge_types.FileMeta{
{Name: "lint", Data: []byte(` {Name: "lint", Data: []byte(`
pipeline: steps:
build: build:
image: scratch image: scratch
`)}, `)},
{Name: "test", Data: []byte(` {Name: "test", Data: []byte(`
pipeline: steps:
build: build:
image: scratch image: scratch
`)}, `)},
{Data: []byte(` {Data: []byte(`
pipeline: steps:
deploy: deploy:
image: scratch image: scratch
@ -231,7 +231,7 @@ func TestRunsOn(t *testing.T) {
Link: "", Link: "",
Yamls: []*forge_types.FileMeta{ Yamls: []*forge_types.FileMeta{
{Data: []byte(` {Data: []byte(`
pipeline: steps:
deploy: deploy:
image: scratch image: scratch
@ -268,12 +268,12 @@ func TestPipelineName(t *testing.T) {
Link: "", Link: "",
Yamls: []*forge_types.FileMeta{ Yamls: []*forge_types.FileMeta{
{Name: ".woodpecker/lint.yml", Data: []byte(` {Name: ".woodpecker/lint.yml", Data: []byte(`
pipeline: steps:
build: build:
image: scratch image: scratch
`)}, `)},
{Name: ".woodpecker/.test.yml", Data: []byte(` {Name: ".woodpecker/.test.yml", Data: []byte(`
pipeline: steps:
build: build:
image: scratch image: scratch
`)}, `)},
@ -304,13 +304,13 @@ func TestBranchFilter(t *testing.T) {
Link: "", Link: "",
Yamls: []*forge_types.FileMeta{ Yamls: []*forge_types.FileMeta{
{Data: []byte(` {Data: []byte(`
pipeline: steps:
xxx: xxx:
image: scratch image: scratch
branches: master branches: master
`)}, `)},
{Data: []byte(` {Data: []byte(`
pipeline: steps:
build: build:
image: scratch image: scratch
`)}, `)},
@ -346,7 +346,7 @@ func TestRootWhenFilter(t *testing.T) {
when: when:
event: event:
- tester - tester
pipeline: steps:
xxx: xxx:
image: scratch image: scratch
`)}, `)},
@ -354,12 +354,12 @@ pipeline:
when: when:
event: event:
- push - push
pipeline: steps:
xxx: xxx:
image: scratch image: scratch
`)}, `)},
{Data: []byte(` {Data: []byte(`
pipeline: steps:
build: build:
image: scratch image: scratch
`)}, `)},
@ -393,7 +393,7 @@ func TestZeroSteps(t *testing.T) {
Yamls: []*forge_types.FileMeta{ Yamls: []*forge_types.FileMeta{
{Data: []byte(` {Data: []byte(`
skip_clone: true skip_clone: true
pipeline: steps:
build: build:
when: when:
branch: notdev branch: notdev
@ -428,19 +428,19 @@ func TestZeroStepsAsMultiPipelineDeps(t *testing.T) {
Yamls: []*forge_types.FileMeta{ Yamls: []*forge_types.FileMeta{
{Name: "zerostep", Data: []byte(` {Name: "zerostep", Data: []byte(`
skip_clone: true skip_clone: true
pipeline: steps:
build: build:
when: when:
branch: notdev branch: notdev
image: scratch image: scratch
`)}, `)},
{Name: "justastep", Data: []byte(` {Name: "justastep", Data: []byte(`
pipeline: steps:
build: build:
image: scratch image: scratch
`)}, `)},
{Name: "shouldbefiltered", Data: []byte(` {Name: "shouldbefiltered", Data: []byte(`
pipeline: steps:
build: build:
image: scratch image: scratch
depends_on: [ zerostep ] depends_on: [ zerostep ]
@ -477,25 +477,25 @@ func TestZeroStepsAsMultiPipelineTransitiveDeps(t *testing.T) {
Yamls: []*forge_types.FileMeta{ Yamls: []*forge_types.FileMeta{
{Name: "zerostep", Data: []byte(` {Name: "zerostep", Data: []byte(`
skip_clone: true skip_clone: true
pipeline: steps:
build: build:
when: when:
branch: notdev branch: notdev
image: scratch image: scratch
`)}, `)},
{Name: "justastep", Data: []byte(` {Name: "justastep", Data: []byte(`
pipeline: steps:
build: build:
image: scratch image: scratch
`)}, `)},
{Name: "shouldbefiltered", Data: []byte(` {Name: "shouldbefiltered", Data: []byte(`
pipeline: steps:
build: build:
image: scratch image: scratch
depends_on: [ zerostep ] depends_on: [ zerostep ]
`)}, `)},
{Name: "shouldbefilteredtoo", Data: []byte(` {Name: "shouldbefilteredtoo", Data: []byte(`
pipeline: steps:
build: build:
image: scratch image: scratch
depends_on: [ shouldbefiltered ] depends_on: [ shouldbefiltered ]
@ -533,7 +533,7 @@ func TestTree(t *testing.T) {
Link: "", Link: "",
Yamls: []*forge_types.FileMeta{ Yamls: []*forge_types.FileMeta{
{Data: []byte(` {Data: []byte(`
pipeline: steps:
build: build:
image: scratch image: scratch
`)}, `)},