Update .gitlab-ci.yml

This commit is contained in:
Daniel Løvbrøtte Olsen 2019-08-08 06:42:43 +00:00
parent 28c4fb165b
commit 5eb52e121e
1 changed files with 29 additions and 0 deletions

View File

@ -4,6 +4,12 @@
# you can delete this line if you're not using Docker
image: bash:latest
stages:
- build
- test
- deploy
- restart
build:datapacks:
stage: build
script:
@ -89,3 +95,26 @@ deploy:resourcepack:
- resourcepack/**/*
- resourcepack/*
- .gitlab-ci.yml
restart:
stage: restart
script:
- 'which ssh-agent || ( apk add --no-cache openssh-client )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- ssh "$SERVER_HOST" mcrcon -H localhost -p minecraft "minecraft:say SERVER RESTART IN 2 MINUTES"
only:
refs:
- master
changes:
- resourcepack/**/*
- resourcepack/*
- .gitlab-ci.yml