From f56d0812c796e4f485ab355fb3c7811243c7518a Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Fri, 14 Oct 2022 13:38:03 +0200 Subject: [PATCH] Partially Revert "CI: add branches filter (#1130)" This partially reverts commit f9dd6518c0dd53d91c5e866f66c9e73c2ada3569. --- .woodpecker/binaries.yml | 26 ++++++++++++++++++-------- .woodpecker/docker.yml | 6 ------ .woodpecker/docs.yml | 16 ++++++++-------- .woodpecker/helm.yml | 13 +++++-------- .woodpecker/test.yml | 10 ++++------ .woodpecker/web.yml | 20 ++++++++++++-------- 6 files changed, 47 insertions(+), 44 deletions(-) diff --git a/.woodpecker/binaries.yml b/.woodpecker/binaries.yml index 1986d2b35..44cf449e1 100644 --- a/.woodpecker/binaries.yml +++ b/.woodpecker/binaries.yml @@ -15,14 +15,6 @@ variables: # web source code - "web/**" -when: - - event: push - branch: ["${CI_REPO_DEFAULT_BRANCH}", "release/*" ] - path: *when_path - - event: tag - - event: pull_request # TODO: Do we need this :thinking:? - path: *when_path - pipeline: build-web: group: prepare @@ -32,47 +24,63 @@ pipeline: - corepack enable - pnpm install --frozen-lockfile - pnpm build + when: + path: *when_path vendor: group: prepare image: *golang_image commands: - go mod vendor + when: + path: *when_path build-server: group: build image: *golang_image commands: - make release-server + when: + path: *when_path build-agent: group: build image: *golang_image commands: - make release-agent + when: + path: *when_path build-cli: group: build image: *golang_image commands: - make release-cli + when: + path: *when_path build-deb-rpm: group: bundle image: *golang_image commands: - make bundle + when: + path: *when_path build-tarball: group: bundle image: *golang_image commands: - make release-tarball + when: + path: *when_path checksums: image: *golang_image commands: - make release-checksums + when: + path: *when_path # TODO: upload build artifacts for pushes to ${CI_REPO_DEFAULT_BRANCH} @@ -81,6 +89,8 @@ pipeline: commands: - ls -la dist/*.* - cat dist/checksums.txt + when: + path: *when_path release: image: plugins/github-release diff --git a/.woodpecker/docker.yml b/.woodpecker/docker.yml index d44c4c49d..f027ca7c6 100644 --- a/.woodpecker/docker.yml +++ b/.woodpecker/docker.yml @@ -12,12 +12,6 @@ variables: - &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' -when: - - event: push - branch: ["${CI_REPO_DEFAULT_BRANCH}", "release/*" ] - - event: tag - - event: pull_request - pipeline: vendor: image: *golang_image diff --git a/.woodpecker/docs.yml b/.woodpecker/docs.yml index 72b1798ab..aab2f5047 100644 --- a/.woodpecker/docs.yml +++ b/.woodpecker/docs.yml @@ -8,19 +8,13 @@ variables: - "cli/**" - "cmd/cli/**" -when: - - event: push - branch: ["${CI_REPO_DEFAULT_BRANCH}", "release/*" ] - path: *when_path - - event: tag - - event: pull_request - path: *when_path - pipeline: build-cli: image: *golang_image commands: - make docs + when: + path: *when_path build: image: *node_image @@ -29,6 +23,8 @@ pipeline: - corepack enable - pnpm install --frozen-lockfile - pnpm build + when: + path: *when_path securitycheck: image: aquasec/trivy:latest @@ -36,6 +32,8 @@ pipeline: - trivy fs --exit-code 0 --skip-dirs node_modules/ --skip-dirs plugins/woodpecker-plugins/node_modules --severity UNKNOWN,LOW docs/ # TODO currently it is not fixable so just do not block currently - trivy fs --exit-code 0 --skip-dirs node_modules/ --skip-dirs plugins/woodpecker-plugins/node_modules --severity MEDIUM,HIGH,CRITICAL docs/ + when: + path: *when_path deploy-preview: image: woodpeckerci/plugin-surge-preview:next @@ -49,6 +47,7 @@ pipeline: from_secret: GITHUB_TOKEN_SURGE when: event: pull_request + path: *when_path # TODO: add step to remove preview again after PR is closed (waiting for #286) @@ -76,3 +75,4 @@ pipeline: when: event: push branch: ${CI_REPO_DEFAULT_BRANCH} + path: *when_path diff --git a/.woodpecker/helm.yml b/.woodpecker/helm.yml index be1a29d14..15420c87a 100644 --- a/.woodpecker/helm.yml +++ b/.woodpecker/helm.yml @@ -3,14 +3,6 @@ variables: - "charts/**" - ".woodpecker/helm.yml" -when: - - event: push - branch: ["${CI_REPO_DEFAULT_BRANCH}", "release/*" ] - path: *when_path - - event: tag - - event: pull_request - path: *when_path - pipeline: set-version: image: alpine/helm:3.5.3 @@ -23,12 +15,16 @@ pipeline: - sed -i "s//$CHART_VERSION/g" charts/woodpecker-server/Chart.yaml - cat charts/woodpecker-agent/Chart.yaml - cat charts/woodpecker-server/Chart.yaml + when: + path: *when_path lint: image: alpine/helm:3.5.3 commands: - helm lint charts/woodpecker-agent/ - helm lint charts/woodpecker-server/ + when: + path: *when_path release: image: quay.io/helmpack/chart-releaser:v1.4.0 @@ -46,3 +42,4 @@ pipeline: - cd woodpecker-ci.github.io/ && cr index --owner woodpecker-ci --git-repo woodpecker-ci.github.io --pages-branch master --package-path ../.cr-release-packages --index-path ../.cr-index/index.yaml --charts-repo https://woodpecker-ci.org --push --release-name-template "helm-{{ .Name }}-{{ .Version }}" when: event: tag + path: *when_path diff --git a/.woodpecker/test.yml b/.woodpecker/test.yml index a27e7949f..05f9edb70 100644 --- a/.woodpecker/test.yml +++ b/.woodpecker/test.yml @@ -11,12 +11,6 @@ variables: # schema changes - "pipeline/schema/**" -when: - - event: push - branch: ["${CI_REPO_DEFAULT_BRANCH}", "release/*" ] - - event: tag - - event: pull_request - pipeline: vendor: image: *golang_image @@ -130,6 +124,8 @@ services: environment: - POSTGRES_USER=postgres - POSTGRES_HOST_AUTH_METHOD=trust + when: + path: *when_path service-mysql: image: mysql:5.6.27 @@ -137,3 +133,5 @@ services: environment: - MYSQL_DATABASE=test - MYSQL_ALLOW_EMPTY_PASSWORD=yes + when: + path: *when_path diff --git a/.woodpecker/web.yml b/.woodpecker/web.yml index 03ac4118e..400987860 100644 --- a/.woodpecker/web.yml +++ b/.woodpecker/web.yml @@ -6,14 +6,6 @@ variables: # web source code - "web/**" -when: - - event: push - branch: ["${CI_REPO_DEFAULT_BRANCH}", "release/*" ] - path: *when_path - - event: tag - - event: pull_request - path: *when_path - pipeline: deps: image: *node_image @@ -21,6 +13,8 @@ pipeline: - cd web/ - corepack enable - pnpm install --frozen-lockfile + when: + path: *when_path lint: group: test @@ -29,6 +23,8 @@ pipeline: - cd web/ - corepack enable - pnpm lint + when: + path: *when_path formatcheck: group: test @@ -37,6 +33,8 @@ pipeline: - cd web/ - corepack enable - pnpm formatcheck + when: + path: *when_path typecheck: group: test @@ -45,6 +43,8 @@ pipeline: - cd web/ - corepack enable - pnpm typecheck + when: + path: *when_path securitycheck: group: test @@ -52,6 +52,8 @@ pipeline: commands: - trivy fs --exit-code 0 --skip-dirs node_modules/ --severity UNKNOWN,LOW web/ - trivy fs --exit-code 1 --skip-dirs node_modules/ --severity MEDIUM,HIGH,CRITICAL web/ + when: + path: *when_path test: group: test @@ -60,3 +62,5 @@ pipeline: - cd web/ - corepack enable - pnpm test + when: + path: *when_path