Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use array syntax in docs #3242

Merged
merged 7 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/docs/10-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ If you are already using containers in your daily workflow, you'll for sure love

```yaml title=".woodpecker.yaml"
steps:
build:
- name: build
image: debian
commands:
- echo "This is the build step"
a-test-step:
- name: a-test-step
image: debian
commands:
- echo "Testing.."
Expand All @@ -32,7 +32,7 @@ steps:

```diff
steps:
build:
- name: build
- image: debian
+ image: mycompany/image-with-awscli
commands:
Expand All @@ -46,11 +46,11 @@ steps:

```yaml title=".woodpecker.yaml"
steps:
build:
- name: build
image: debian
commands:
- touch myfile
a-test-step:
- name: a-test-step
image: debian
commands:
- cat myfile
Expand Down
10 changes: 5 additions & 5 deletions docs/docs/20-usage/10-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ Example pipeline configuration:

```yaml
steps:
build:
- name: build
image: golang
commands:
- go get
- go build
- go test

services:
postgres:
- name: postgres
image: postgres:9.4.5
environment:
- POSTGRES_USER=myapp
Expand All @@ -48,20 +48,20 @@ Example pipeline configuration with multiple, serial steps:

```yaml
steps:
backend:
- name: backend
image: golang
commands:
- go get
- go build
- go test

frontend:
- name: frontend
image: node:6
commands:
- npm install
- npm test

notify:
- name: notify
image: plugins/slack
channel: developers
username: woodpecker
Expand Down
70 changes: 35 additions & 35 deletions docs/docs/20-usage/20-workflow-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ Example steps:

```yaml
steps:
backend:
- name: backend
image: golang
commands:
- go build
- go test
frontend:
- name: frontend
image: node
commands:
- npm install
Expand All @@ -21,25 +21,25 @@ steps:

In the above example we define two steps, `frontend` and `backend`. The names of these steps are completely arbitrary.

Another way to name a step is by using the name keyword:
The name is optional, if not added the steps will be numerated.

Another way to name a step is by using dictionaries:

```yaml
steps:
- name: backend
backend:
image: golang
commands:
- go build
- go test
- name: frontend
frontend:
image: node
commands:
- npm install
- npm run test
- npm run build
```

Keep in mind the name is optional, if not added the steps will be numerated.

## Skip Commits

Woodpecker gives the ability to skip individual commits by adding `[SKIP CI]` or `[CI SKIP]` to the commit message. Note this is case-insensitive.
Expand All @@ -55,7 +55,7 @@ The associated commit is checked out with git to a workspace which is mounted to

```diff
steps:
backend:
- name: backend
image: golang
commands:
+ - go build
Expand All @@ -69,11 +69,11 @@ The associated commit is checked out with git to a workspace which is mounted to

```yaml title=".woodpecker.yaml"
steps:
build:
- name: build
image: debian
commands:
- echo "test content" > myfile
a-test-step:
- name: a-test-step
image: debian
commands:
- cat myfile
Expand All @@ -87,18 +87,18 @@ When using the `local` backend, the `image` entry is used to specify the shell,

```diff
steps:
build:
- name: build
+ image: golang:1.6
commands:
- go build
- go test

publish:
- name: publish
+ image: plugins/docker
repo: foo/bar

services:
database:
- name: database
+ image: mysql
```

Expand All @@ -116,7 +116,7 @@ Woodpecker does not automatically upgrade container images. Example configuratio

```diff
steps:
build:
- name: build
image: golang:latest
+ pull: true
```
Expand All @@ -129,7 +129,7 @@ Commands of every step are executed serially as if you would enter them into you

```diff
steps:
backend:
- name: backend
image: golang
commands:
+ - go build
Expand Down Expand Up @@ -178,7 +178,7 @@ Some of the steps may be allowed to fail without causing the whole workflow and

```diff
steps:
backend:
- name: backend
image: golang
commands:
- go build
Expand All @@ -192,7 +192,7 @@ Woodpecker supports defining a list of conditions for a step by using a `when` b

```diff
steps:
slack:
- name: slack
image: plugins/slack
settings:
channel: dev
Expand All @@ -209,7 +209,7 @@ Example conditional execution by repository:

```diff
steps:
slack:
- name: slack
image: plugins/slack
settings:
channel: dev
Expand All @@ -227,7 +227,7 @@ Example conditional execution by branch:

```diff
steps:
slack:
- name: slack
image: plugins/slack
settings:
channel: dev
Expand Down Expand Up @@ -324,7 +324,7 @@ There are use cases for executing steps on failure, such as sending notification

```diff
steps:
slack:
- name: slack
image: plugins/slack
settings:
channel: dev
Expand Down Expand Up @@ -457,18 +457,18 @@ Normally steps of a workflow are executed serially in the order in which they ar

```diff
steps:
build: # build will be executed immediately
- name: build # build will be executed immediately
image: golang
commands:
- go build

deploy:
- name: deploy
image: plugins/docker
settings:
repo: foo/bar
+ depends_on: [build, test] # deploy will be executed after build and test finished

test: # test will be executed immediately as no dependencies are set
- name: test # test will be executed immediately as no dependencies are set
image: golang
commands:
- go test
Expand Down Expand Up @@ -508,7 +508,7 @@ The workspace can be customized using the workspace block in the YAML file:
+ path: src/github.com/octocat/hello-world

steps:
build:
- name: build
image: golang:latest
commands:
- go get
Expand All @@ -523,12 +523,12 @@ The base attribute defines a shared base volume available to all steps. This ens
path: src/github.com/octocat/hello-world

steps:
deps:
- name: deps
image: golang:latest
commands:
- go get
- go test
build:
- name: build
image: node:latest
commands:
- go build
Expand Down Expand Up @@ -580,7 +580,7 @@ You can add additional labels as a key value map:
+ hostname: "" # this label will be ignored as it is empty

steps:
build:
- name: build
image: golang
commands:
- go build
Expand Down Expand Up @@ -622,7 +622,7 @@ You can manually configure the clone step in your workflow for customization:
+ image: woodpeckerci/plugin-git

steps:
build:
- name: build
image: golang
commands:
- go build
Expand All @@ -633,7 +633,7 @@ Example configuration to override depth:

```diff
clone:
git:
- name: git
image: woodpeckerci/plugin-git
+ settings:
+ partial: false
Expand All @@ -652,7 +652,7 @@ Example configuration to clone Mercurial repository:

```diff
clone:
hg:
- name: hg
+ image: plugins/hg
+ settings:
+ path: bitbucket.org/foo/bar
Expand All @@ -673,7 +673,7 @@ To use the ssh git url in `.gitmodules` for users cloning with ssh, and also use

```diff
clone:
git:
- name: git
image: woodpeckerci/plugin-git
settings:
recursive: true
Expand Down Expand Up @@ -705,7 +705,7 @@ Example conditional execution by repository:
+ repo: test/test
+
steps:
slack:
- name: slack
image: plugins/slack
settings:
channel: dev
Expand All @@ -724,7 +724,7 @@ Example conditional execution by branch:
+ branch: main
+
steps:
slack:
- name: slack
image: plugins/slack
settings:
channel: dev
Expand Down Expand Up @@ -862,14 +862,14 @@ Privileged mode is only available to trusted repositories and for security reaso

```diff
steps:
build:
- name: build
image: docker
environment:
- DOCKER_HOST=tcp://docker:2375
commands:
- docker --tls=false ps

services:
- name: services
docker:
image: docker:dind
commands: dockerd-entrypoint.sh --storage-driver=vfs --tls=false
Expand Down
Loading