2022-02-10 09:38:14 -08:00
|
|
|
stages:
|
2022-02-25 18:47:08 -08:00
|
|
|
- test
|
2022-02-10 09:38:14 -08:00
|
|
|
- deploy
|
|
|
|
|
2022-02-10 09:25:26 -08:00
|
|
|
before_script:
|
|
|
|
# configure SSH keys
|
2022-02-26 01:40:37 -08:00
|
|
|
- apt-get update
|
2022-02-10 09:25:26 -08:00
|
|
|
- 'which ssh-agent || ( apt-get install -qq openssh-client )'
|
|
|
|
- eval $(ssh-agent -s)
|
|
|
|
- ssh-add <(echo "$SSH_PRIVATE_KEY")
|
|
|
|
- mkdir -p ~/.ssh
|
2022-02-10 09:45:07 -08:00
|
|
|
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
|
2022-02-25 22:09:03 -08:00
|
|
|
|
2022-02-25 19:09:54 -08:00
|
|
|
docker-compose-test:
|
2022-02-26 01:38:21 -08:00
|
|
|
image: jafner/debian-bullseye-docker:latest
|
2022-02-25 19:09:54 -08:00
|
|
|
stage: test
|
|
|
|
rules:
|
|
|
|
- changes:
|
2022-02-25 21:12:23 -08:00
|
|
|
- seedbox/config/
|
|
|
|
- server/config/
|
|
|
|
- jafner-tools/config/
|
2022-02-25 19:09:54 -08:00
|
|
|
script:
|
2022-02-25 22:12:40 -08:00
|
|
|
- find ~+ -type f -name docker-compose.yml > composes.txt
|
|
|
|
- find ~+/server/config/minecraft/ -type f -name *.yml >> composes.txt
|
2022-02-25 21:46:32 -08:00
|
|
|
- for file in `cat composes.txt`; do docker compose -f $file config; done
|
2022-02-25 19:52:22 -08:00
|
|
|
- rm composes.txt
|
2022-02-25 18:47:08 -08:00
|
|
|
|
2022-02-10 09:25:26 -08:00
|
|
|
|
2022-02-25 13:30:41 -08:00
|
|
|
server-deploy:
|
2022-02-25 19:19:44 -08:00
|
|
|
image: debian:bullseye
|
2022-02-25 10:27:03 -08:00
|
|
|
stage: deploy
|
2022-02-25 13:30:41 -08:00
|
|
|
rules:
|
|
|
|
- changes:
|
|
|
|
- server/
|
2022-02-25 10:27:03 -08:00
|
|
|
script:
|
2022-02-25 13:30:41 -08:00
|
|
|
- ssh joey@joey-server "cd /home/joey/homelab && git pull"
|
2022-02-25 18:47:08 -08:00
|
|
|
|
|
|
|
seedbox-deploy:
|
2022-02-25 19:19:44 -08:00
|
|
|
image: debian:bullseye
|
2022-02-25 18:47:08 -08:00
|
|
|
stage: deploy
|
|
|
|
rules:
|
|
|
|
- changes:
|
|
|
|
- seedbox/
|
|
|
|
script:
|
|
|
|
- ssh joey@joey-seedbox "cd /home/joey/homelab && git pull"
|
|
|
|
|
|
|
|
jafner-tools-deploy:
|
2022-02-25 19:19:44 -08:00
|
|
|
image: debian:bullseye
|
2022-02-25 18:47:08 -08:00
|
|
|
stage: deploy
|
|
|
|
rules:
|
|
|
|
- changes:
|
|
|
|
- jafner-tools/
|
|
|
|
script:
|
|
|
|
- ssh root@jafner.tools "cd /root/homelab && git pull"
|