~sumner/nixos-configuration

ref: 95757b992d68ae792f1c883532badd3447fa8cc2 nixos-configuration/.build.yml -rw-r--r-- 1.2 KiB
95757b99Sumner Evans standupbot: 0.2.7 -> 0.3.1rc1 4 months ago
                                                                                
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
image: nixos/unstable
secrets:
  # SSH Deploy Key
  - f219888a-80af-4275-a777-89e8c7d277f0
environment:
  REPO_NAME: nixos-configuration
triggers:
  - action: email
    condition: failure
    to: alerts@sumnerevans.com
tasks:
  # Skip everything if not on master.
  - skip-not-master: |
      cd $REPO_NAME
      git branch --contains | grep master || echo "Skipping deploy since not on master"
      git branch --contains | grep master || complete-build

  - setup: |
      echo "cd $REPO_NAME" >> ~/.buildenv
      ssh-keyscan bespin.sumnerevans.com >> ~/.ssh/known_hosts
      ssh-keyscan nevarro.nevarro.space >> ~/.ssh/known_hosts

  - switch-commit: |
      ssh root@bespin.sumnerevans.com "cd /etc/nixos && git fetch && git reset --hard $(git rev-parse HEAD)"
      ssh root@nevarro.nevarro.space  "cd /etc/nixos && git fetch && git reset --hard $(git rev-parse HEAD)"

  - remote-build: |
      ssh root@bespin.sumnerevans.com "nixos-rebuild build --show-trace"
      ssh root@nevarro.nevarro.space  "nixos-rebuild build --show-trace"

  - switch-generation: |
      ssh root@bespin.sumnerevans.com "nixos-rebuild switch --show-trace"
      ssh root@nevarro.nevarro.space  "nixos-rebuild switch --show-trace"