aboutsummaryrefslogtreecommitdiff
path: root/builds/monthly/capsul-centos-7.yaml
blob: 4ca7e261487a22c178c04952da158182b9f24f3c (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
# this builds the capsul centos 10 template img
image: alpine/edge
packages:
  - rsync
environment:
  version: 7
  slaves:
    - deploy@baikal.cyberia.club
sources:
  - https://git.cyberia.club/services/capsul-images
secrets:
  # deploy@baikal.cyberia.club
  - aac6b8d1-65c1-4d7f-862f-094716b800e3
triggers:
  - action: email
    condition: failure
    to: ops <ops@cyberia.club>
tasks:
  - genimg: |
      cd capsul-images/centos
      sudo ./build $version
  - deploy: |
      cd capsul-images/centos
      echo "StrictHostKeyChecking=no" >> ~/.ssh/config
      for server in "${slaves[@]}"
      do
        ssh $server mkdir -p /tank/img/centos/$version
        rsync -rzP $version/root.img.qcow2 \
          ${server}:/tank/img/centos/$version/new_root.img.qcow2
        ssh $server \
          mv /tank/img/centos/$version/new_root.img.qcow2 \
             /tank/img/centos/$version/root.img.qcow2
      done