~sumner/nixos-configuration

nixos-configuration/.build.yml -rw-r--r-- 1.5 KiB
009188e9Sumner Evans autoupgrade: only enable on servers a day 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
34
35
36
37
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
      time ssh-keyscan kessel.nevarro.space >> ~/.ssh/known_hosts
      time ssh-keyscan morak.sumnerevans.com >> ~/.ssh/known_hosts
      time ssh-keyscan bespin.sumnerevans.com >> ~/.ssh/known_hosts

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

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

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