aboutsummaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 95d815e36771764c8731f1eebf7cfdd460b35f32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
variables:
  SSH_LOCATION: "root@192.168.1.246"

run-tests:
  when: manual
  image: alpine
  timeout: 3 hours
  before_script:
    - apk update && apk add openssh-client
    - eval $(ssh-agent -s)
    - chmod 400 "$SSH_PRIVATE_KEY"
    - ssh-add "$SSH_PRIVATE_KEY"
    - mkdir -p ~/.ssh
    - chmod 700 ~/.ssh
    - cp "$SSH_KNOWN_HOSTS" ~/.ssh/known_hosts
  script:
    - ssh $SSH_LOCATION "bash -lc 'cd /opt/candelabra && git pull && NIXOS_SWITCH_USE_DIRTY_ENV=1 nixos-rebuild switch --fast --flake .#default'"
    - ssh $SSH_LOCATION "bash -lc 'cd /opt/candelabra/src && just run-all-tests'"