58 lines
1.1 KiB
YAML
58 lines
1.1 KiB
YAML
image: debian:bullseye
|
|
|
|
stages:
|
|
- test
|
|
- deploy
|
|
|
|
before_script:
|
|
- apt-get update
|
|
- apt-get install git docker docker-compose
|
|
# 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'
|
|
|
|
docker-compose-test:
|
|
image: docker/compose
|
|
stage: test
|
|
when: always
|
|
rules:
|
|
- changes:
|
|
- docker-compose.yml
|
|
- server/config/minecraft/
|
|
when: manual
|
|
script:
|
|
- ls
|
|
|
|
|
|
server-deploy:
|
|
stage: deploy
|
|
when: always
|
|
rules:
|
|
- changes:
|
|
- server/
|
|
when: manual
|
|
script:
|
|
- ssh joey@joey-server "cd /home/joey/homelab && git pull"
|
|
|
|
seedbox-deploy:
|
|
stage: deploy
|
|
when: always
|
|
rules:
|
|
- changes:
|
|
- seedbox/
|
|
when: manual
|
|
script:
|
|
- ssh joey@joey-seedbox "cd /home/joey/homelab && git pull"
|
|
|
|
jafner-tools-deploy:
|
|
stage: deploy
|
|
when: always
|
|
rules:
|
|
- changes:
|
|
- jafner-tools/
|
|
when: manual
|
|
script:
|
|
- ssh root@jafner.tools "cd /root/homelab && git pull" |