Update .gitlab-ci.yml
This commit is contained in:
parent
28c4fb165b
commit
5eb52e121e
|
@ -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
|
Loading…
Reference in New Issue