diff --git a/.gitignore b/.gitignore index c196ac54c3..e4bc51c2ed 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,7 @@ docker-compose.yml extras/ /build/ /dist/ +/data/ docs/venv diff --git a/.woodpecker/binaries.yml b/.woodpecker/binaries.yml index 8d57840b87..2996e93ddd 100644 --- a/.woodpecker/binaries.yml +++ b/.woodpecker/binaries.yml @@ -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 diff --git a/.woodpecker/docker.yml b/.woodpecker/docker.yml index 50b16cc83d..3decd98a6d 100644 --- a/.woodpecker/docker.yml +++ b/.woodpecker/docker.yml @@ -87,6 +87,9 @@ steps: path: *when_path cross-compile-server-preview: + depends_on: + - vendor + - build-web image: *xgo_image pull: true commands: @@ -103,9 +106,31 @@ steps: - event: pull_request path: *when_path + cross-compile-server: + depends_on: + - vendor + - build-web + image: *xgo_image + pull: true + commands: + - apt update + - apt install -y tree + - make cross-compile-server + environment: + PLATFORMS: linux|arm/v7;linux|arm64/v8;linux|amd64;linux|ppc64le;linux|riscv64 + TAGS: bindata sqlite sqlite_unlock_notify netgo + XGO_VERSION: *xgo_version + when: + branch: + - ${CI_REPO_DEFAULT_BRANCH} + - release/* + event: [push, tag] + path: *when_path + publish-server-preview: + depends_on: + - cross-compile-server-preview image: *buildx_plugin - group: docker settings: repo: woodpeckerci/woodpecker-server dockerfile: docker/Dockerfile.server.multiarch @@ -117,8 +142,9 @@ steps: event: pull_request publish-server-alpine-preview: + depends_on: + - cross-compile-server-preview image: *buildx_plugin - group: docker settings: repo: woodpeckerci/woodpecker-server dockerfile: docker/Dockerfile.server.alpine.multiarch @@ -130,8 +156,10 @@ steps: event: pull_request build-server: + depends_on: + - vendor + - build-web image: *buildx_plugin - group: docker settings: dry_run: true repo: woodpeckerci/woodpecker-server @@ -144,8 +172,10 @@ steps: path: *when_path build-server-alpine: + depends_on: + - vendor + - build-web image: *buildx_plugin - group: docker settings: dry_run: true repo: woodpeckerci/woodpecker-server @@ -157,27 +187,10 @@ steps: event: pull_request path: *when_path - cross-compile-server: - image: *xgo_image - pull: true - commands: - - apt update - - apt install -y tree - - make cross-compile-server - environment: - PLATFORMS: linux|arm/v7;linux|arm64/v8;linux|amd64;linux|ppc64le;linux|riscv64 - TAGS: bindata sqlite sqlite_unlock_notify netgo - XGO_VERSION: *xgo_version - when: - branch: - - ${CI_REPO_DEFAULT_BRANCH} - - release/* - event: [push, tag] - 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 diff --git a/.woodpecker/securityscan.yml b/.woodpecker/securityscan.yml index dc8ac4a984..510672d9e7 100644 --- a/.woodpecker/securityscan.yml +++ b/.woodpecker/securityscan.yml @@ -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/ diff --git a/.woodpecker/test.yml b/.woodpecker/test.yml index 7ba9bc7fec..798bb12457 100644 --- a/.woodpecker/test.yml +++ b/.woodpecker/test.yml @@ -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: diff --git a/.woodpecker/web.yml b/.woodpecker/web.yml index e09a7dfc0e..9db3f4843f 100644 --- a/.woodpecker/web.yml +++ b/.woodpecker/web.yml @@ -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: