homelab/.gitlab-ci.yml

54 lines
1.3 KiB
YAML
Raw Normal View History

2022-02-10 17:38:14 +00:00
stages:
- test
2022-02-10 17:38:14 +00:00
- deploy
2022-02-10 17:25:26 +00:00
before_script:
# configure SSH keys
2022-02-26 09:40:37 +00:00
- apt-get update
2022-02-10 17:25:26 +00: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 17:45:07 +00:00
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
2022-02-26 06:09:03 +00:00
2022-02-26 03:09:54 +00:00
docker-compose-test:
2022-02-26 09:38:21 +00:00
image: jafner/debian-bullseye-docker:latest
2022-02-26 03:09:54 +00:00
stage: test
rules:
- changes:
- seedbox/config/
- server/config/
- jafner-tools/config/
2022-02-26 03:09:54 +00:00
script:
2022-02-26 06:12:40 +00:00
- find ~+ -type f -name docker-compose.yml > composes.txt
- find ~+/server/config/minecraft/ -type f -name *.yml >> composes.txt
2022-02-26 05:46:32 +00:00
- for file in `cat composes.txt`; do docker compose -f $file config; done
2022-02-26 03:52:22 +00:00
- rm composes.txt
2022-02-10 17:25:26 +00:00
2022-02-25 21:30:41 +00:00
server-deploy:
2022-02-26 03:19:44 +00:00
image: debian:bullseye
2022-02-25 18:27:03 +00:00
stage: deploy
2022-02-25 21:30:41 +00:00
rules:
- changes:
- server/
2022-02-25 18:27:03 +00:00
script:
2022-02-25 21:30:41 +00:00
- ssh joey@joey-server "cd /home/joey/homelab && git pull"
seedbox-deploy:
2022-02-26 03:19:44 +00:00
image: debian:bullseye
stage: deploy
rules:
- changes:
- seedbox/
script:
- ssh joey@joey-seedbox "cd /home/joey/homelab && git pull"
jafner-tools-deploy:
2022-02-26 03:19:44 +00:00
image: debian:bullseye
stage: deploy
rules:
- changes:
- jafner-tools/
script:
- ssh root@jafner.tools "cd /root/homelab && git pull"