aboutsummaryrefslogtreecommitdiffstats
path: root/.woodpecker/build.yml
blob: 7a88c157879aa286a3f79d856024be34afcd9197 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
depends_on:
  - lint
steps:
  build_package:
    image: registry.mgrote.net/fpm:latest
    environment:
      DEBIAN_FRONTEND: noninteractive
    commands:
      - git clone https://git.mgrote.net/mirrors/sanoid
      - cp sanoid-prune.service sanoid/
      - cp sanoid.service sanoid/
      - cp sanoid.timer sanoid/
      - cd sanoid
      # get latest tag for version
      - version=$(curl --silent -L   -H "Accept: application/vnd.github+json"   -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/jimsalterjrs/sanoid/releases/latest | jq  .tag_name | sed s/\"//g)
      - 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
      - |
        curl -X POST -H "token: $AUTH_TOKEN" -F "file=@./sanoid_$(echo $version).deb" http://docker10.mgrote.net:5040/upload

    secrets:
      - source: httpd-api-server-token
        target: auth_token