1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-11-24 08:02:18 +02:00

Use dag in ci config (#3010)

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
Anbraten 2023-12-28 16:39:14 +01:00 committed by GitHub
parent 7e2ea306c4
commit c1a1f7c10b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 163 additions and 102 deletions

1
.gitignore vendored
View File

@ -40,6 +40,7 @@ docker-compose.yml
extras/
/build/
/dist/
/data/
docs/venv

View File

@ -14,7 +14,6 @@ variables:
steps:
build-web:
group: prepare
image: *node_image
directory: web/
commands:
@ -23,13 +22,14 @@ steps:
- pnpm build
vendor:
group: prepare
image: *golang_image
commands:
- go mod vendor
cross-compile-server:
group: build
depends_on:
- vendor
- build-web
image: *xgo_image
pull: true
commands:
@ -43,35 +43,49 @@ steps:
TARGZ: '1'
build-agent:
group: build
depends_on:
- vendor
image: *golang_image
commands:
- make release-agent
build-cli:
group: build
depends_on:
- vendor
image: *golang_image
commands:
- make release-cli
build-deb-rpm:
group: bundle
depends_on:
- cross-compile-server
- build-agent
- build-cli
image: *golang_image
commands:
- make bundle
checksums:
depends_on:
- cross-compile-server
- build-agent
- build-cli
- build-deb-rpm
image: *golang_image
commands:
- make release-checksums
release-dryrun:
depends_on:
- checksums
image: *golang_image
commands:
- ls -la dist/*.*
- cat dist/checksums.txt
release:
depends_on:
- checksums
image: docker.io/plugins/github-release
secrets:
- source: github_token

View File

@ -87,6 +87,9 @@ steps:
path: *when_path
cross-compile-server-preview:
depends_on:
- vendor
- build-web
image: *xgo_image
pull: true
commands:
@ -103,61 +106,10 @@ steps:
- event: pull_request
path: *when_path
publish-server-preview:
image: *buildx_plugin
group: docker
settings:
repo: woodpeckerci/woodpecker-server
dockerfile: docker/Dockerfile.server.multiarch
platforms: *platforms_preview
tag: pull_${CI_COMMIT_PULL_REQUEST}
logins: *publish_logins
when:
evaluate: 'CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images"'
event: pull_request
publish-server-alpine-preview:
image: *buildx_plugin
group: docker
settings:
repo: woodpeckerci/woodpecker-server
dockerfile: docker/Dockerfile.server.alpine.multiarch
platforms: *platforms_preview
tag: pull_${CI_COMMIT_PULL_REQUEST}-alpine
logins: *publish_logins
when:
evaluate: 'CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images"'
event: pull_request
build-server:
image: *buildx_plugin
group: docker
settings:
dry_run: true
repo: woodpeckerci/woodpecker-server
dockerfile: docker/Dockerfile.server.multiarch
platforms: *platforms_preview
tag: pull_${CI_COMMIT_PULL_REQUEST}
when:
evaluate: 'not (CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images")'
event: pull_request
path: *when_path
build-server-alpine:
image: *buildx_plugin
group: docker
settings:
dry_run: true
repo: woodpeckerci/woodpecker-server
dockerfile: docker/Dockerfile.server.alpine.multiarch
platforms: *platforms_preview
tag: pull_${CI_COMMIT_PULL_REQUEST}-alpine
when:
evaluate: 'not (CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images")'
event: pull_request
path: *when_path
cross-compile-server:
depends_on:
- vendor
- build-web
image: *xgo_image
pull: true
commands:
@ -175,9 +127,70 @@ steps:
event: [push, tag]
path: *when_path
publish-next-server:
publish-server-preview:
depends_on:
- cross-compile-server-preview
image: *buildx_plugin
settings:
repo: woodpeckerci/woodpecker-server
dockerfile: docker/Dockerfile.server.multiarch
platforms: *platforms_preview
tag: pull_${CI_COMMIT_PULL_REQUEST}
logins: *publish_logins
when:
evaluate: 'CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images"'
event: pull_request
publish-server-alpine-preview:
depends_on:
- cross-compile-server-preview
image: *buildx_plugin
settings:
repo: woodpeckerci/woodpecker-server
dockerfile: docker/Dockerfile.server.alpine.multiarch
platforms: *platforms_preview
tag: pull_${CI_COMMIT_PULL_REQUEST}-alpine
logins: *publish_logins
when:
evaluate: 'CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images"'
event: pull_request
build-server:
depends_on:
- vendor
- build-web
image: *buildx_plugin
settings:
dry_run: true
repo: woodpeckerci/woodpecker-server
dockerfile: docker/Dockerfile.server.multiarch
platforms: *platforms_preview
tag: pull_${CI_COMMIT_PULL_REQUEST}
when:
evaluate: 'not (CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images")'
event: pull_request
path: *when_path
build-server-alpine:
depends_on:
- vendor
- build-web
image: *buildx_plugin
settings:
dry_run: true
repo: woodpeckerci/woodpecker-server
dockerfile: docker/Dockerfile.server.alpine.multiarch
platforms: *platforms_preview
tag: pull_${CI_COMMIT_PULL_REQUEST}-alpine
when:
evaluate: 'not (CI_COMMIT_PULL_REQUEST_LABELS contains "build_pr_images")'
event: pull_request
path: *when_path
publish-next-server:
depends_on:
- cross-compile-server
image: *buildx_plugin
group: docker
settings:
repo: *publish_repos_server
dockerfile: docker/Dockerfile.server.multiarch
@ -190,8 +203,9 @@ steps:
path: *when_path
publish-next-server-alpine:
depends_on:
- cross-compile-server
image: *buildx_plugin
group: docker
settings:
repo: *publish_repos_server
dockerfile: docker/Dockerfile.server.alpine.multiarch
@ -204,8 +218,9 @@ steps:
path: *when_path
publish-release-branch-server:
depends_on:
- cross-compile-server
image: *buildx_plugin
group: docker
settings:
repo: *publish_repos_server
dockerfile: docker/Dockerfile.server.multiarch
@ -218,8 +233,9 @@ steps:
path: *when_path
publish-release-branch-server-alpine:
depends_on:
- cross-compile-server
image: *buildx_plugin
group: docker
settings:
repo: *publish_repos_server
dockerfile: docker/Dockerfile.server.alpine.multiarch
@ -232,7 +248,8 @@ steps:
path: *when_path
release-server:
group: docker
depends_on:
- cross-compile-server
image: *buildx_plugin
settings:
repo: *publish_repos_server
@ -245,7 +262,8 @@ steps:
event: tag
release-server-alpine:
group: docker
depends_on:
- cross-compile-server
image: *buildx_plugin
settings:
repo: *publish_repos_server
@ -262,7 +280,8 @@ steps:
#############
publish-agent-preview:
group: docker
depends_on:
- vendor
image: *buildx_plugin
settings:
repo: woodpeckerci/woodpecker-agent
@ -276,7 +295,8 @@ steps:
event: pull_request
build-agent:
group: docker
depends_on:
- vendor
image: *buildx_plugin
settings:
dry_run: true
@ -291,7 +311,8 @@ steps:
path: *when_path
publish-next-agent:
group: docker
depends_on:
- vendor
image: *buildx_plugin
settings:
repo: *publish_repos_agent
@ -306,7 +327,8 @@ steps:
path: *when_path
publish-next-agent-alpine:
group: docker
depends_on:
- vendor
image: *buildx_plugin
settings:
repo: *publish_repos_agent
@ -321,7 +343,8 @@ steps:
path: *when_path
publish-release-branch-agent:
group: docker
depends_on:
- vendor
image: *buildx_plugin
settings:
repo: *publish_repos_agent
@ -336,7 +359,8 @@ steps:
path: *when_path
publish-release-branch-agent-alpine:
group: docker
depends_on:
- vendor
image: *buildx_plugin
settings:
repo: *publish_repos_agent
@ -351,7 +375,8 @@ steps:
path: *when_path
release-agent:
group: docker
depends_on:
- vendor
image: *buildx_plugin
settings:
repo: *publish_repos_agent
@ -365,7 +390,8 @@ steps:
event: tag
release-agent-alpine:
group: docker
depends_on:
- vendor
image: *buildx_plugin
settings:
repo: *publish_repos_agent
@ -383,7 +409,8 @@ steps:
#########
publish-cli-preview:
group: docker
depends_on:
- vendor
image: *buildx_plugin
settings:
repo: woodpeckerci/woodpecker-cli
@ -397,7 +424,8 @@ steps:
event: pull_request
build-cli:
group: docker
depends_on:
- vendor
image: *buildx_plugin
settings:
dry_run: true
@ -412,7 +440,8 @@ steps:
path: *when_path
publish-next-cli:
group: docker
depends_on:
- vendor
image: *buildx_plugin
settings:
repo: *publish_repos_cli
@ -427,7 +456,8 @@ steps:
path: *when_path
publish-next-cli-alpine:
group: docker
depends_on:
- vendor
image: *buildx_plugin
settings:
repo: *publish_repos_cli
@ -442,7 +472,8 @@ steps:
path: *when_path
publish-release-branch-cli:
group: docker
depends_on:
- vendor
image: *buildx_plugin
settings:
repo: *publish_repos_cli
@ -457,7 +488,8 @@ steps:
path: *when_path
publish-release-branch-cli-alpine:
group: docker
depends_on:
- vendor
image: *buildx_plugin
settings:
repo: *publish_repos_cli
@ -472,7 +504,8 @@ steps:
path: *when_path
release-cli:
group: docker
depends_on:
- vendor
image: *buildx_plugin
settings:
repo: *publish_repos_cli
@ -486,7 +519,8 @@ steps:
event: tag
release-cli-alpine:
group: docker
depends_on:
- vendor
image: *buildx_plugin
settings:
repo: *publish_repos_cli

View File

@ -12,13 +12,13 @@ variables:
steps:
check backend:
group: check
depends_on: []
image: *trivy_plugin
settings:
skip-dirs: web/,docs/
check docs:
group: check
depends_on: []
image: *trivy_plugin
settings:
skip-dirs: node_modules/,plugins/woodpecker-plugins/node_modules/
@ -28,7 +28,7 @@ steps:
branch: ${CI_REPO_DEFAULT_BRANCH}
check web:
group: check
depends_on: []
image: *trivy_plugin
settings:
skip-dirs: node_modules/

View File

@ -22,13 +22,14 @@ variables:
steps:
vendor:
image: *golang_image
group: prepare
commands:
- go mod vendor
when:
- path: *when_path
lint-pipeline:
depends_on:
- vendor
image: *golang_image
commands:
- go run go.woodpecker-ci.org/woodpecker/v2/cmd/cli lint
@ -40,7 +41,6 @@ steps:
dummy-web:
image: *golang_image
group: prepare
commands:
- mkdir -p web/dist/
- echo "test" > web/dist/index.html
@ -48,15 +48,17 @@ steps:
- path: *when_path
lint:
depends_on:
- vendor
image: *golang_image
group: test
commands:
- make lint
when: *when
check_swagger:
depends_on:
- vendor
image: *golang_image
group: test
commands:
- 'make generate-swagger'
- 'DIFF=$(git diff | head)'
@ -65,13 +67,11 @@ steps:
lint-editorconfig:
image: docker.io/mstruebing/editorconfig-checker:2.7.2
group: test
when:
- event: [pull_request, tag]
lint-license-header:
image: *golang_image
group: test
commands:
- go install github.com/google/addlicense@latest
- 'addlicense -check -ignore "vendor/**" **/*.go'
@ -79,12 +79,12 @@ steps:
prettier:
image: docker.io/woodpeckerci/plugin-prettier:next
group: test
when: *when
test:
depends_on:
- vendor
image: *golang_image
group: test
commands:
- make test-agent
- make test-server
@ -94,8 +94,9 @@ steps:
- path: *when_path
sqlite:
depends_on:
- vendor
image: *golang_image
group: test
environment:
- WOODPECKER_DATABASE_DRIVER=sqlite3
commands:
@ -104,8 +105,9 @@ steps:
- path: *when_path
postgres:
depends_on:
- vendor
image: *golang_image
group: test
environment:
- WOODPECKER_DATABASE_DRIVER=postgres
- WOODPECKER_DATABASE_DATASOURCE=host=service-postgres user=postgres dbname=postgres sslmode=disable
@ -114,8 +116,9 @@ steps:
when: *when
mysql:
depends_on:
- vendor
image: *golang_image
group: test
environment:
- WOODPECKER_DATABASE_DRIVER=mysql
- WOODPECKER_DATABASE_DATASOURCE=root@tcp(service-mysql:3306)/test?parseTime=true
@ -124,6 +127,11 @@ steps:
when: *when
codecov:
depends_on:
- test
- sqlite
- postgres
- mysql
pull: true
image: docker.io/woodpeckerci/plugin-codecov:2.1.2
settings:

View File

@ -19,7 +19,7 @@ variables:
event: [pull_request, tag, deployment]
steps:
deps:
install_dependencies:
image: *node_image
directory: web/
commands:
@ -28,7 +28,8 @@ steps:
when: *when
lint:
group: test
depends_on:
- install_dependencies
image: *node_image
directory: web/
commands:
@ -37,7 +38,8 @@ steps:
when: *when
formatcheck:
group: test
depends_on:
- install_dependencies
image: *node_image
directory: web/
commands:
@ -46,7 +48,8 @@ steps:
when: *when
typecheck:
group: test
depends_on:
- install_dependencies
image: *node_image
directory: web/
commands:
@ -55,7 +58,8 @@ steps:
when: *when
test:
group: test
depends_on:
- install_dependencies
image: *node_image
directory: web/
commands: