aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.experiments.gitlab-ci.yml30
-rw-r--r--.gitlab-ci.yml3
-rw-r--r--Justfile5
3 files changed, 37 insertions, 1 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'
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..6035ced
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,3 @@
+run-tests:
+ trigger:
+ include: ./.experiments.gitlab-ci.yml
diff --git a/Justfile b/Justfile
index 8896c6f..3b9db86 100644
--- a/Justfile
+++ b/Justfile
@@ -13,4 +13,7 @@ thesis-watch:
alias tc := thesis-clean
thesis-clean:
- cd thesis/; latexmk -c \ No newline at end of file
+ cd thesis/; latexmk -c
+
+run-all-tests:
+ echo "TODO: run the tests!!"