aboutsummaryrefslogtreecommitdiff
path: root/.experiments.gitlab-ci.yml
blob: 8a6c3a74d6599bbc5ba9cef22ba70a547019c950 (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
stages:
- deploy
- test

variables:
  SSH_LOCATION: "root@192.168.1.246"

deploy:
  stage: deploy
  before_script:
    - 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )'
    - eval $(ssh-agent -s)
    - chmod 400 "$SSH_PRIVATE_KEY"
    - ssh-add "$SSH_PRIVATE_KEY"
    - mkdir -p ~/.ssh
    - chmod 700 ~/.ssh
  script:
  - ssh $SSH_LOCATION 'cd /opt/candelabra && git pull && nixos-rebuild switch --flake .#default'

run:
  stage: deploy
  before_script:
    - 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )'
    - eval $(ssh-agent -s)
    - chmod 400 "$SSH_PRIVATE_KEY"
    - ssh-add "$SSH_PRIVATE_KEY"
    - mkdir -p ~/.ssh
    - chmod 700 ~/.ssh
  script:
  - ssh $SSH_LOCATION 'cd /opt/candelabra && just run-all-tests'