Merge branch 'main' of ssh://gitlab.jafner.net:2229/Jafner/homelab

This commit is contained in:
Joey Hafner 2022-02-25 19:56:59 -08:00
commit 92e913e45f

View File

@ -1,10 +1,10 @@
stages: stages:
- test
- deploy - deploy
before_script: before_script:
# update and install git - apt-get -y update
- apt-get update -qq - apt-get -y install git docker docker-compose
- apt-get install -qq git
# configure SSH keys # configure SSH keys
- 'which ssh-agent || ( apt-get install -qq openssh-client )' - 'which ssh-agent || ( apt-get install -qq openssh-client )'
- eval $(ssh-agent -s) - eval $(ssh-agent -s)
@ -12,7 +12,24 @@ before_script:
- mkdir -p ~/.ssh - mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
docker-compose-test:
image: debian:bullseye
stage: test
when: always
rules:
- changes:
- docker-compose.yml
- server/config/minecraft/
when: manual
script:
- find ~+ -type f -name docker-compose.yml > composes.txt
- find ~+/server/config/minecraft/ -type f -name *.yml >> composes.txt
- for file in `cat composes.txt`; do docker-compose -f $file config; done
- rm composes.txt
server-deploy: server-deploy:
image: debian:bullseye
stage: deploy stage: deploy
when: always when: always
rules: rules:
@ -21,3 +38,25 @@ server-deploy:
when: manual when: manual
script: script:
- ssh joey@joey-server "cd /home/joey/homelab && git pull" - ssh joey@joey-server "cd /home/joey/homelab && git pull"
seedbox-deploy:
image: debian:bullseye
stage: deploy
when: always
rules:
- changes:
- seedbox/
when: manual
script:
- ssh joey@joey-seedbox "cd /home/joey/homelab && git pull"
jafner-tools-deploy:
image: debian:bullseye
stage: deploy
when: always
rules:
- changes:
- jafner-tools/
when: manual
script:
- ssh root@jafner.tools "cd /root/homelab && git pull"