mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-02-23 06:36:17 +00:00
declare different when statements once and reuse them (#3176)
This commit is contained in:
parent
9bbba4441d
commit
a53fe5c0ab
1 changed files with 30 additions and 58 deletions
|
@ -3,6 +3,7 @@ when:
|
||||||
- event: push
|
- event: push
|
||||||
branch:
|
branch:
|
||||||
- ${CI_REPO_DEFAULT_BRANCH}
|
- ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
- release/*
|
||||||
- renovate/*
|
- renovate/*
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
|
@ -60,6 +61,7 @@ steps:
|
||||||
path: *when_path
|
path: *when_path
|
||||||
- branch:
|
- branch:
|
||||||
- ${CI_REPO_DEFAULT_BRANCH}
|
- ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
- release/*
|
||||||
- renovate/*
|
- renovate/*
|
||||||
event: [push, tag]
|
event: [push, tag]
|
||||||
path: *when_path
|
path: *when_path
|
||||||
|
@ -81,6 +83,7 @@ steps:
|
||||||
path: *when_path
|
path: *when_path
|
||||||
- branch:
|
- branch:
|
||||||
- ${CI_REPO_DEFAULT_BRANCH}
|
- ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
- release/*
|
||||||
- renovate/*
|
- renovate/*
|
||||||
event: [push, tag]
|
event: [push, tag]
|
||||||
path: *when_path
|
path: *when_path
|
||||||
|
@ -105,8 +108,10 @@ steps:
|
||||||
- event: pull_request
|
- event: pull_request
|
||||||
path: *when_path
|
path: *when_path
|
||||||
- event: push
|
- event: push
|
||||||
branch: renovate/*
|
|
||||||
path: *when_path
|
path: *when_path
|
||||||
|
branch:
|
||||||
|
- release/*
|
||||||
|
- renovate/*
|
||||||
|
|
||||||
cross-compile-server:
|
cross-compile-server:
|
||||||
depends_on:
|
depends_on:
|
||||||
|
@ -138,7 +143,7 @@ steps:
|
||||||
platforms: *platforms_preview
|
platforms: *platforms_preview
|
||||||
tag: pull_${CI_COMMIT_PULL_REQUEST}
|
tag: pull_${CI_COMMIT_PULL_REQUEST}
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
when:
|
when: &when-preview
|
||||||
evaluate: 'CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images"'
|
evaluate: 'CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images"'
|
||||||
event: pull_request
|
event: pull_request
|
||||||
|
|
||||||
|
@ -152,11 +157,9 @@ steps:
|
||||||
platforms: *platforms_preview
|
platforms: *platforms_preview
|
||||||
tag: pull_${CI_COMMIT_PULL_REQUEST}-alpine
|
tag: pull_${CI_COMMIT_PULL_REQUEST}-alpine
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
when:
|
when: *when-preview
|
||||||
evaluate: 'CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images"'
|
|
||||||
event: pull_request
|
|
||||||
|
|
||||||
build-server:
|
build-server-dryrun:
|
||||||
depends_on:
|
depends_on:
|
||||||
- vendor
|
- vendor
|
||||||
- build-web
|
- build-web
|
||||||
|
@ -168,13 +171,15 @@ steps:
|
||||||
dockerfile: docker/Dockerfile.server.multiarch
|
dockerfile: docker/Dockerfile.server.multiarch
|
||||||
platforms: *platforms_preview
|
platforms: *platforms_preview
|
||||||
tag: pull_${CI_COMMIT_PULL_REQUEST}
|
tag: pull_${CI_COMMIT_PULL_REQUEST}
|
||||||
when:
|
when: &when-dryrun
|
||||||
- evaluate: 'not (CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images")'
|
- evaluate: 'not (CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images")'
|
||||||
event: pull_request
|
event: pull_request
|
||||||
path: *when_path
|
path: *when_path
|
||||||
- event: push
|
- event: push
|
||||||
branch: renovate/*
|
|
||||||
path: *when_path
|
path: *when_path
|
||||||
|
branch:
|
||||||
|
- release/*
|
||||||
|
- renovate/*
|
||||||
|
|
||||||
publish-next-server:
|
publish-next-server:
|
||||||
depends_on:
|
depends_on:
|
||||||
|
@ -186,7 +191,7 @@ steps:
|
||||||
platforms: *platforms_server
|
platforms: *platforms_server
|
||||||
tag: [next, 'next-${CI_COMMIT_SHA:0:10}']
|
tag: [next, 'next-${CI_COMMIT_SHA:0:10}']
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
when:
|
when: &when-publish-next
|
||||||
branch: ${CI_REPO_DEFAULT_BRANCH}
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||||
event: push
|
event: push
|
||||||
path: *when_path
|
path: *when_path
|
||||||
|
@ -201,10 +206,7 @@ steps:
|
||||||
platforms: *platforms_alpine
|
platforms: *platforms_alpine
|
||||||
tag: [next-alpine, 'next-${CI_COMMIT_SHA:0:10}-alpine']
|
tag: [next-alpine, 'next-${CI_COMMIT_SHA:0:10}-alpine']
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
when:
|
when: *when-publish-next
|
||||||
branch: ${CI_REPO_DEFAULT_BRANCH}
|
|
||||||
event: push
|
|
||||||
path: *when_path
|
|
||||||
|
|
||||||
release-server:
|
release-server:
|
||||||
depends_on:
|
depends_on:
|
||||||
|
@ -217,7 +219,7 @@ steps:
|
||||||
# remove 'latest' on older version branches to avoid accidental downgrade
|
# remove 'latest' on older version branches to avoid accidental downgrade
|
||||||
tag: [latest, '${CI_COMMIT_TAG}']
|
tag: [latest, '${CI_COMMIT_TAG}']
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
when:
|
when: &when-release
|
||||||
event: tag
|
event: tag
|
||||||
|
|
||||||
release-server-alpine:
|
release-server-alpine:
|
||||||
|
@ -231,8 +233,7 @@ steps:
|
||||||
# remove 'latest-alpine' on older version branches to avoid accidental downgrade
|
# remove 'latest-alpine' on older version branches to avoid accidental downgrade
|
||||||
tag: [latest-alpine, '${CI_COMMIT_TAG}-alpine']
|
tag: [latest-alpine, '${CI_COMMIT_TAG}-alpine']
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
when:
|
when: *when-release
|
||||||
event: tag
|
|
||||||
|
|
||||||
#############
|
#############
|
||||||
# A g e n t #
|
# A g e n t #
|
||||||
|
@ -249,11 +250,9 @@ steps:
|
||||||
tag: pull_${CI_COMMIT_PULL_REQUEST}
|
tag: pull_${CI_COMMIT_PULL_REQUEST}
|
||||||
build_args: *build_args
|
build_args: *build_args
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
when:
|
when: *when-preview
|
||||||
evaluate: 'CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images"'
|
|
||||||
event: pull_request
|
|
||||||
|
|
||||||
build-agent:
|
build-agent-dryrun:
|
||||||
depends_on:
|
depends_on:
|
||||||
- vendor
|
- vendor
|
||||||
image: *buildx_plugin
|
image: *buildx_plugin
|
||||||
|
@ -264,13 +263,7 @@ steps:
|
||||||
platforms: *platforms_preview
|
platforms: *platforms_preview
|
||||||
tag: pull_${CI_COMMIT_PULL_REQUEST}
|
tag: pull_${CI_COMMIT_PULL_REQUEST}
|
||||||
build_args: *build_args
|
build_args: *build_args
|
||||||
when:
|
when: *when-dryrun
|
||||||
- evaluate: 'not (CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images")'
|
|
||||||
event: pull_request
|
|
||||||
path: *when_path
|
|
||||||
- event: push
|
|
||||||
branch: renovate/*
|
|
||||||
path: *when_path
|
|
||||||
|
|
||||||
publish-next-agent:
|
publish-next-agent:
|
||||||
depends_on:
|
depends_on:
|
||||||
|
@ -305,10 +298,7 @@ steps:
|
||||||
tag: [next-alpine, 'next-${CI_COMMIT_SHA:0:10}-alpine']
|
tag: [next-alpine, 'next-${CI_COMMIT_SHA:0:10}-alpine']
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
build_args: *build_args
|
build_args: *build_args
|
||||||
when:
|
when: *when-publish-next
|
||||||
branch: ${CI_REPO_DEFAULT_BRANCH}
|
|
||||||
event: push
|
|
||||||
path: *when_path
|
|
||||||
|
|
||||||
release-agent:
|
release-agent:
|
||||||
depends_on:
|
depends_on:
|
||||||
|
@ -325,8 +315,7 @@ steps:
|
||||||
tag: [latest, '${CI_COMMIT_TAG}']
|
tag: [latest, '${CI_COMMIT_TAG}']
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
build_args: *build_args
|
build_args: *build_args
|
||||||
when:
|
when: *when-release
|
||||||
event: tag
|
|
||||||
|
|
||||||
release-agent-alpine:
|
release-agent-alpine:
|
||||||
depends_on:
|
depends_on:
|
||||||
|
@ -343,8 +332,7 @@ steps:
|
||||||
tag: [latest-alpine, '${CI_COMMIT_TAG}-alpine']
|
tag: [latest-alpine, '${CI_COMMIT_TAG}-alpine']
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
build_args: *build_args
|
build_args: *build_args
|
||||||
when:
|
when: *when-release
|
||||||
event: tag
|
|
||||||
|
|
||||||
#########
|
#########
|
||||||
# C L I #
|
# C L I #
|
||||||
|
@ -361,11 +349,9 @@ steps:
|
||||||
tag: pull_${CI_COMMIT_PULL_REQUEST}
|
tag: pull_${CI_COMMIT_PULL_REQUEST}
|
||||||
build_args: *build_args
|
build_args: *build_args
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
when:
|
when: *when-preview
|
||||||
evaluate: 'CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images"'
|
|
||||||
event: pull_request
|
|
||||||
|
|
||||||
build-cli:
|
build-cli-dryrun:
|
||||||
depends_on:
|
depends_on:
|
||||||
- vendor
|
- vendor
|
||||||
image: *buildx_plugin
|
image: *buildx_plugin
|
||||||
|
@ -376,13 +362,7 @@ steps:
|
||||||
platforms: *platforms_preview
|
platforms: *platforms_preview
|
||||||
tag: pull_${CI_COMMIT_PULL_REQUEST}
|
tag: pull_${CI_COMMIT_PULL_REQUEST}
|
||||||
build_args: *build_args
|
build_args: *build_args
|
||||||
when:
|
when: *when-dryrun
|
||||||
- evaluate: 'not (CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images")'
|
|
||||||
event: pull_request
|
|
||||||
path: *when_path
|
|
||||||
- event: push
|
|
||||||
branch: renovate/*
|
|
||||||
path: *when_path
|
|
||||||
|
|
||||||
publish-next-cli:
|
publish-next-cli:
|
||||||
depends_on:
|
depends_on:
|
||||||
|
@ -398,10 +378,7 @@ steps:
|
||||||
tag: [next, 'next-${CI_COMMIT_SHA:0:10}']
|
tag: [next, 'next-${CI_COMMIT_SHA:0:10}']
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
build_args: *build_args
|
build_args: *build_args
|
||||||
when:
|
when: *when-publish-next
|
||||||
branch: ${CI_REPO_DEFAULT_BRANCH}
|
|
||||||
event: push
|
|
||||||
path: *when_path
|
|
||||||
|
|
||||||
publish-next-cli-alpine:
|
publish-next-cli-alpine:
|
||||||
depends_on:
|
depends_on:
|
||||||
|
@ -417,10 +394,7 @@ steps:
|
||||||
tag: [next-alpine, 'next-${CI_COMMIT_SHA:0:10}-alpine']
|
tag: [next-alpine, 'next-${CI_COMMIT_SHA:0:10}-alpine']
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
build_args: *build_args
|
build_args: *build_args
|
||||||
when:
|
when: *when-publish-next
|
||||||
branch: ${CI_REPO_DEFAULT_BRANCH}
|
|
||||||
event: push
|
|
||||||
path: *when_path
|
|
||||||
|
|
||||||
release-cli:
|
release-cli:
|
||||||
depends_on:
|
depends_on:
|
||||||
|
@ -437,8 +411,7 @@ steps:
|
||||||
tag: [latest, '${CI_COMMIT_TAG}']
|
tag: [latest, '${CI_COMMIT_TAG}']
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
build_args: *build_args
|
build_args: *build_args
|
||||||
when:
|
when: *when-release
|
||||||
event: tag
|
|
||||||
|
|
||||||
release-cli-alpine:
|
release-cli-alpine:
|
||||||
depends_on:
|
depends_on:
|
||||||
|
@ -455,5 +428,4 @@ steps:
|
||||||
tag: [latest-alpine, '${CI_COMMIT_TAG}-alpine']
|
tag: [latest-alpine, '${CI_COMMIT_TAG}-alpine']
|
||||||
logins: *publish_logins
|
logins: *publish_logins
|
||||||
build_args: *build_args
|
build_args: *build_args
|
||||||
when:
|
when: *when-release
|
||||||
event: tag
|
|
||||||
|
|
Loading…
Reference in a new issue