From 3ffcb7c81c43ccc6614fb5672ca5ebf82e6b3fcc Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Tue, 7 Nov 2023 16:20:27 +0100 Subject: ci: drone -> woodpecker --- .drone.yml | 72 --------------------------------------------------- .woodpecker/build.yml | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++ .woodpecker/lint.yml | 13 ++++++++++ 3 files changed, 85 insertions(+), 72 deletions(-) delete mode 100644 .drone.yml create mode 100644 .woodpecker/build.yml create mode 100644 .woodpecker/lint.yml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 98e898e..0000000 --- a/.drone.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -kind: pipeline -type: docker -name: default -steps: - - name: run gitleaks - image: plugins/gitleaks - settings: - path: . - - - name: build package - image: registry.mgrote.net/fpm:latest - environment: - DEBIAN_FRONTEND: noninteractive - commands: - - git clone https://git.mgrote.net/Mirror/sanoid.git - - cp sanoid-prune.service sanoid/ - - cp sanoid.service sanoid/ - - cp sanoid.timer sanoid/ - - cd sanoid - - # checkout latest stable release or stay on master for bleeding edge stuff (but expect bugs!) - #- git checkout $(git tag | grep "^v" | tail -n 1) - #- export version=$(git tag | grep "^v" | tail -n 1 | tr -d v) - - export version=3.0.4 - - ls -lah - - pwd - - chmod 0755 sanoid - - chmod 0755 syncoid - - | - fpm \ - -s dir \ - -t deb \ - --name sanoid \ - --architecture all \ - --description "sanoid deb package" \ - --url "https://git.mgrote.net/mg/sanoid-deb" \ - -p sanoid_$(echo $version).deb \ - -v $(echo $version) \ - --depends debhelper \ - --depends libcapture-tiny-perl \ - --depends libconfig-inifiles-perl \ - --depends pv \ - --depends lzop \ - --depends mbuffer \ - --depends build-essential \ - --depends git \ - sanoid-prune.service=/lib/systemd/system/sanoid-prune.service \ - sanoid.service=/lib/systemd/system/sanoid.service \ - sanoid.timer=/lib/systemd/system/sanoid.timer \ - sanoid=/usr/bin/sanoid \ - syncoid=/usr/bin/syncoid \ - sanoid.conf=/etc/sanoid/sanoid.conf \ - sanoid.defaults.conf=/etc/sanoid/sanoid.defaults.conf - - pwd - - ls -lah - - - name: upload - image: registry.mgrote.net/allzweckcontainer:latest - environment: - DEBIAN_FRONTEND: noninteractive - auth_token: - from_secret: httpd-api-server-token - commands: - - ls -lah - - pwd - - cd sanoid - - ls -lah - - pwd - - export version=3.0.4 - - echo $version - - | - curl -X POST -H "token: $auth_token" -F "file=@./sanoid_$(echo $version).deb" http://docker10.grote.lan:5040/upload diff --git a/.woodpecker/build.yml b/.woodpecker/build.yml new file mode 100644 index 0000000..fe34b82 --- /dev/null +++ b/.woodpecker/build.yml @@ -0,0 +1,72 @@ +--- +kind: pipeline +type: docker +name: docker_build +depends_on: + - lint +steps: + build_package: + image: registry.mgrote.net/fpm:latest + environment: + DEBIAN_FRONTEND: noninteractive + commands: + - git clone https://git.mgrote.net/Mirror/sanoid.git + - cp sanoid-prune.service sanoid/ + - cp sanoid.service sanoid/ + - cp sanoid.timer sanoid/ + - cd sanoid + - # checkout latest stable release or stay on master for bleeding edge stuff (but expect bugs!) + #- git checkout $(git tag | grep "^v" | tail -n 1) + #- export version=$(git tag | grep "^v" | tail -n 1 | tr -d v) + - export version=3.0.4 + - ls -lah + - pwd + - chmod 0755 sanoid + - chmod 0755 syncoid + - | + fpm \ + -s dir \ + -t deb \ + --name sanoid \ + --architecture all \ + --description "sanoid deb package" \ + --url "https://git.mgrote.net/mg/sanoid-deb" \ + -p sanoid_$(echo $version).deb \ + -v $(echo $version) \ + --depends debhelper \ + --depends libcapture-tiny-perl \ + --depends libconfig-inifiles-perl \ + --depends pv \ + --depends lzop \ + --depends mbuffer \ + --depends build-essential \ + --depends git \ + sanoid-prune.service=/lib/systemd/system/sanoid-prune.service \ + sanoid.service=/lib/systemd/system/sanoid.service \ + sanoid.timer=/lib/systemd/system/sanoid.timer \ + sanoid=/usr/bin/sanoid \ + syncoid=/usr/bin/syncoid \ + sanoid.conf=/etc/sanoid/sanoid.conf \ + sanoid.defaults.conf=/etc/sanoid/sanoid.defaults.conf + - pwd + - ls -lah + + upload: + image: registry.mgrote.net/allzweckcontainer:latest + environment: + DEBIAN_FRONTEND: noninteractive + auth_token: + from_secret: httpd-api-server-token + commands: + - ls -lah + - pwd + - cd sanoid + - ls -lah + - pwd + - export version=3.0.4 + - echo $version + - | + curl -X POST -H "token: $auth_token" -F "file=@./sanoid_$(echo $version).deb" http://docker10.grote.lan:5040/upload + secrets: + - source: httpd-api-server-token + target: auth_token diff --git a/.woodpecker/lint.yml b/.woodpecker/lint.yml new file mode 100644 index 0000000..db52cef --- /dev/null +++ b/.woodpecker/lint.yml @@ -0,0 +1,13 @@ +--- +kind: pipeline +type: docker +name: linting +steps: + gitleaks: + image: zricethezav/gitleaks:latest + commands: + - gitleaks detect --no-git --verbose --source $CI_WORKSPACE + when: + event: + exclude: + - tag -- cgit v1.2.3