From 614682e054a4a3e2a243ec1c4350b6d2fcb027c8 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Wed, 8 May 2024 10:02:29 +0200 Subject: [PATCH] update woodpecker based ci pipelines --- .woodpecker/ci.yml | 70 ++++++++++++++++++++++++++++++++++++++++ .woodpecker/master.yml | 66 ------------------------------------- .woodpecker/next.yml | 56 -------------------------------- .woodpecker/renovate.yml | 22 ------------- .woodpecker/test.yml | 7 ---- 5 files changed, 70 insertions(+), 151 deletions(-) create mode 100644 .woodpecker/ci.yml delete mode 100644 .woodpecker/master.yml delete mode 100644 .woodpecker/next.yml delete mode 100644 .woodpecker/renovate.yml delete mode 100644 .woodpecker/test.yml diff --git a/.woodpecker/ci.yml b/.woodpecker/ci.yml new file mode 100644 index 0000000..34e3cc9 --- /dev/null +++ b/.woodpecker/ci.yml @@ -0,0 +1,70 @@ +when: + - event: [pull_request, tag, cron] + - event: push + branch: + - ${CI_REPO_DEFAULT_BRANCH} + +variables: + - &build_plugin 'woodpeckerci/plugin-docker-buildx:3.2.1' + # deployment targets + - &publish_repos 'ocram85/blog,gitea.ocram85.com/ocram85/blog' + # logins for deployment targets + - publish_logins: &publish_logins + # Default DockerHub login + - registry: https://index.docker.io/v1/ + username: + from_secret: hub_user + password: + from_secret: hub_passwd + # Additional Quay.IO login + - registry: https://gitea.ocram85.com + username: + from_secret: gitea_user + password: + from_secret: gitea_passwd + +steps: + test: + image: *build_plugin + settings: + dry_run: true + registry: gitea.ocram85.com + repo: test + dockerfile: Dockerfile + platforms: linux/amd64 + auto_tag: true + #build_args: + # - VERSION=${CI_COMMIT_TAG:-PR ${CI_COMMIT_PULL_REQUEST}} + # - TAG=${CI_COMMIT_TAG} + when: + event: pull_request + branch: ${CI_REPO_DEFAULT_BRANCH} + + publish: + image: *build_plugin + settings: + repo: *publish_repos + dockerfile: Dockerfile + platforms: linux/amd64 + auto_tag: true + logins: *publish_logins + #build_args: + # - VERSION=${CI_COMMIT_TAG:-PR ${CI_COMMIT_PULL_REQUEST}} + # - TAG=${CI_COMMIT_TAG} + when: + event: [push, tag, cron] + branch: ${CI_REPO_DEFAULT_BRANCH} + + build-next: + image: *build_plugin + settings: + repo: *publish_repos + dockerfile: Dockerfile + platforms: linux/amd64 + tag: next + logins: *publish_logins + #build_args: + # - VERSION=${CI_COMMIT_TAG:-PR ${CI_COMMIT_PULL_REQUEST}} + # - TAG=${CI_COMMIT_TAG} + when: + event: [pull_request] diff --git a/.woodpecker/master.yml b/.woodpecker/master.yml deleted file mode 100644 index 478490e..0000000 --- a/.woodpecker/master.yml +++ /dev/null @@ -1,66 +0,0 @@ -depends_on: - - test - -pipeline: - buildMaster: - image: plugins/docker - settings: - repo: ocram85/blog - dockerfile: Dockerfile - auto_tag: true - build_args: - - NODE_BASE=lts-buster-slim - - NGINX_BASE=1.23.1-alpine - username: - from_secret: hub_user - password: - from_secret: hub_passwd - when: - event: push - branch: master - - buildMasterGitea: - image: plugins/docker - settings: - registry: gitea.ocram85.com - repo: gitea.ocram85.com/ocram85/blog - dockerfile: Dockerfile - auto_tag: true - build_args: - - NODE_BASE=lts-buster-slim - - NGINX_BASE=1.23.1-alpine - username: - from_secret: gitea_user - password: - from_secret: gitea_passwd - when: - event: push - branch: master - - trivyMaster: - image: aquasec/trivy:0.36.1 - commands: - - | - trivy image \ - --severity UNKNOWN,LOW,MEDIUM \ - --no-progress \ - ocram85/blog:latest - - | - trivy image \ - --severity HIGH,CRITICAL \ - --no-progress \ - ocram85/blog:latest - when: - event: push - branch: master - - triggerPortainerMaster: - image: ocram85/portainer-serviceupdate - settings: - #VERBOSE: true - URI: "https://portainer.ocram85.com" - TOKEN: - from_secret: TOKEN - when: - event: push - branch: master diff --git a/.woodpecker/next.yml b/.woodpecker/next.yml deleted file mode 100644 index 172914c..0000000 --- a/.woodpecker/next.yml +++ /dev/null @@ -1,56 +0,0 @@ -depends_on: - - test - -pipeline: - buildNext: - image: woodpeckerci/plugin-docker-buildx - settings: - repo: ocram85/blog - dockerfile: Dockerfile - tags: next - username: - from_secret: hub_user - password: - from_secret: hub_passwd - when: - event: pull_request - - buildNextGitea: - image: woodpeckerci/plugin-docker-buildx - settings: - registry: gitea.ocram85.com - repo: gitea.ocram85.com/ocram85/blog - dockerfile: Dockerfile - tags: next - username: - from_secret: gitea_user - password: - from_secret: gitea_passwd - when: - event: pull_request - - trivyNext: - image: aquasec/trivy:0.36.1 - commands: - - | - trivy image \ - --severity UNKNOWN,LOW,MEDIUM \ - --no-progress \ - ocram85/blog:next - - | - trivy image \ - --severity HIGH,CRITICAL \ - --no-progress \ - ocram85/blog:next - when: - event: pull_request - - triggerPortainer: - image: ocram85/portainer-serviceupdate - settings: - #VERBOSE: true - URI: "https://portainer.ocram85.com" - TOKEN: - from_secret: NEXT_TOKEN - when: - event: pull_request diff --git a/.woodpecker/renovate.yml b/.woodpecker/renovate.yml deleted file mode 100644 index 31d567b..0000000 --- a/.woodpecker/renovate.yml +++ /dev/null @@ -1,22 +0,0 @@ -pipeline: - DockerBaseImage: - image: renovate/renovate:34.108-slim - commands: - - "renovate" - secrets: - - RENOVATE_TOKEN - environment: - #LOG_LEVEL: debug - RENOVATE_PLATFORM: "gitea" - RENOVATE_ENDPOINT: "https://gitea.ocram85.com" - RENOVATE_REPOSITORIES: "${CI_REPO}" - RENOVATE_LABELS: "renovate" - #RENOVATE_DRY_RUN: "full" - RENOVATE_TOKEN: "${RENOVATE_TOKEN}" - RENOVATE_GITHUB_TOKEN_WARN: "false" - when: - event: - - push - branch: - - master - - updDeps diff --git a/.woodpecker/test.yml b/.woodpecker/test.yml deleted file mode 100644 index 3961db6..0000000 --- a/.woodpecker/test.yml +++ /dev/null @@ -1,7 +0,0 @@ -pipeline: - build: - image: node:lts-buster-slim - commands: - - npm install - - npm run test - - npm run build -- 2.45.2