aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.experiments.gitlab-ci.yml30
-rw-r--r--.gitlab-ci.yml17
2 files changed, 15 insertions, 32 deletions
diff --git a/.experiments.gitlab-ci.yml b/.experiments.gitlab-ci.yml
deleted file mode 100644
index 8a6c3a7..0000000
--- a/.experiments.gitlab-ci.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-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'
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c1db01e..9971c38 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,4 +1,17 @@
+variables:
+ SSH_LOCATION: "root@192.168.1.246"
+
run-tests:
when: manual
- trigger:
- include: .experiments.gitlab-ci.yml
+ image: alpine
+ 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 'cd /opt/candelabra && git pull && nixos-rebuild switch --flake .#default'
+ - ssh $SSH_LOCATION 'cd /opt/candelabra && just run-all-tests'