~xenrox/builds

5d04c97fff2b063613a6010861a784005a94c9b0 — Thorben Günther 5 months ago c132007 master
Re-add alpine/edge
1 files changed, 48 insertions(+), 0 deletions(-)

A alpine/build.yml
A alpine/build.yml => alpine/build.yml +48 -0
@@ 0,0 1,48 @@
image: alpine/edge
packages:
  - e2fsprogs
  - qemu-img
  - qemu-system-x86_64
  - rsync
  - sfdisk
sources:
  - https://git.sr.ht/~sircmpwn/builds.sr.ht
environment:
  arch: x86_64
  release: edge
  slaves:
    - deploy@xenrox.net
secrets:
  - 82f2033a-a06d-4324-a98a-112a6f37ae96
triggers:
  - action: email
    condition: failure
    to: Thorben Günther <admin@xenrox.net>
tasks:
  - genimg: |
      cd builds.sr.ht/images/alpine/$release
      sudo ./genimg $arch
  - kvm: |
      if grep -i amd /proc/cpuinfo
      then
          sudo modprobe kvm_amd
      else
          sudo modprobe kvm_intel
      fi
      sleep 1
      sudo chown build:build /dev/kvm
  - sanity-check: |
      cd builds.sr.ht
      MEMORY=1024 ./images/control alpine/$release sanity-check
  - deploy: |
      cd builds.sr.ht/images/alpine/$release
      echo "StrictHostKeyChecking=no" >> ~/.ssh/config
      for server in "${slaves[@]}"
      do
        ssh $server mkdir -p /var/lib/images/alpine/$release/$arch
        rsync -rzzP $arch/root.img.qcow2 \
          ${server}:/var/lib/images/alpine/$release/$arch/new_root.img.qcow2
        ssh $server \
          mv /var/lib/images/alpine/$release/$arch/new_root.img.qcow2 \
             /var/lib/images/alpine/$release/$arch/root.img.qcow2
      done