diff options
Diffstat (limited to '.experiments.gitlab-ci.yml')
-rw-r--r-- | .experiments.gitlab-ci.yml | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/.experiments.gitlab-ci.yml b/.experiments.gitlab-ci.yml new file mode 100644 index 0000000..8a6c3a7 --- /dev/null +++ b/.experiments.gitlab-ci.yml @@ -0,0 +1,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' |