minecraft-datapacks/.gitlab-ci.yml

46 lines
1.3 KiB
YAML
Raw Normal View History

2019-05-22 01:24:57 +02:00
# This file is a template, and might need editing before it works on your project.
# see https://docs.gitlab.com/ce/ci/yaml/README.html for all available options
# you can delete this line if you're not using Docker
2019-05-22 01:56:15 +02:00
image: alpine:latest
2019-05-22 01:24:57 +02:00
2019-05-22 02:02:24 +02:00
build:
2019-05-22 01:24:57 +02:00
stage: build
script:
2019-05-23 20:10:27 +02:00
- apk add --no-cache zip
2019-07-31 02:27:22 +02:00
- cd datapacks
2019-05-22 02:14:41 +02:00
- mkdir out
2019-05-22 03:51:00 +02:00
- find -maxdepth 1 -type d -not -name ".git" -not -name "out" -not -name "." | xargs -I '{}' sh -c 'cd {} && zip -r ../out/{} .'
2019-07-31 02:51:45 +02:00
- cd ../resourcepack
2019-07-31 02:53:23 +02:00
- mkdir -p ../resourcepack-out
2019-07-31 02:51:45 +02:00
- zip -r ../resourcepack-out/resourcepack .
2019-05-22 02:14:41 +02:00
artifacts:
paths:
2019-07-31 02:27:22 +02:00
- ./datapacks/out
2019-07-31 02:51:45 +02:00
- ./resourcepack-out
2019-05-23 20:08:47 +02:00
deploy:
stage: deploy
script:
2019-05-23 21:03:09 +02:00
- 'which ssh-agent || ( apk add --no-cache openssh-client )'
- apk add --no-cache rsync
2019-05-23 20:36:46 +02:00
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
2019-05-23 20:50:26 +02:00
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
2019-05-23 20:36:46 +02:00
2019-07-31 02:29:45 +02:00
- cd datapacks
2019-06-10 02:30:29 +02:00
- rsync -avz out/ "$SERVER_HOST":"$WPD_FOLDER" --delete --exclude bukkit
2019-05-23 21:29:22 +02:00
- ssh "$SERVER_HOST" mcrcon -H localhost -p minecraft "minecraft:reload"
2019-07-31 12:08:01 +02:00
- cd ../resourcepack-out
- sha1sum resourcepack.zip
2019-05-23 21:11:27 +02:00
only:
2019-07-31 02:51:45 +02:00
- master