diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..2482bde --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,26 @@ +stages: + - deploy + +before_script: + # update and install git + - apt-get update -qq + - apt-get install -qq git + # configure SSH keys + - 'which ssh-agent || ( apt-get install -qq openssh-client )' + - eval $(ssh-agent -s) + - ssh-add <(echo "$SSH_PRIVATE_KEY") + - mkdir -p ~/.ssh + - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' + + +server-deploy: + stage: deploy + when: manual + rules: + - changes: + - server/ + + script: + - ssh joey@joey-server "cd /home/joey && git archive --remote=ssh://git@gitlab.jafner.net:2229/Jafner/homelab.git main server/ | tar xvf -" + - ssh joey@joey-server "cp -r server/config/* ./docker_config/" + - ssh joey@joey-server "rm -rf server/" diff --git a/server/README.md b/server/README.md index 2d3bffd..2c661ea 100644 --- a/server/README.md +++ b/server/README.md @@ -1,4 +1,12 @@ # Server General-purpose server hosting a variety of Docker-based application stacks. -This server exists behind the jafner.net DDNS record. \ No newline at end of file +This server exists behind the jafner.net DDNS record. + +## Services + +This server runs a bunch of stuff behind the `jafner.net` domain. + +For a living portal listing all user-facing services, go to https://home.jafner.net + +This repository is automatically pushed to the host when a change is made to a file in this subdirectory.