Update .gitlab-ci.yml

This commit is contained in:
Daniel Løvbrøtte Olsen 2019-08-08 05:24:52 +00:00
parent a70bbbc77e
commit bf0f0c309f
1 changed files with 46 additions and 17 deletions

View File

@ -39,27 +39,56 @@ build:resourcepack:
- resourcepack/* - resourcepack/*
- .gitlab-ci.yml - .gitlab-ci.yml
deploy: deploy:datapacks:
stage: deploy stage: deploy
script: script:
- ls -alh . ./datapacks - 'which ssh-agent || ( apk add --no-cache openssh-client )'
# - 'which ssh-agent || ( apk add --no-cache openssh-client )' - apk add --no-cache rsync
# - apk add --no-cache rsync
# - eval $(ssh-agent -s) - eval $(ssh-agent -s)
# - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
# - mkdir -p ~/.ssh - mkdir -p ~/.ssh
# - chmod 700 ~/.ssh - chmod 700 ~/.ssh
# - echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts - echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
# - chmod 644 ~/.ssh/known_hosts - chmod 644 ~/.ssh/known_hosts
#
# - cd datapacks
# - rsync -avz out/ "$SERVER_HOST":"$WPD_FOLDER" --delete --exclude bukkit
# - ssh "$SERVER_HOST" mcrcon -H localhost -p minecraft "minecraft:reload" - cd datapacks
- rsync -avz out/ "$SERVER_HOST":"$WPD_FOLDER" --delete --exclude bukkit
# - cd ../resourcepack-out - ssh "$SERVER_HOST" mcrcon -H localhost -p minecraft "minecraft:reload"
# - sha1sum resourcepack.zip
- cd ../resourcepack-out
- sha1sum resourcepack.zip
only: only:
- master refs:
- master
changes:
- datapacks/**/*
- datapacks/*
- .gitlab-ci.yml
deploy:resourcepack:
stage: deploy
script:
- 'which ssh-agent || ( apk add --no-cache openssh-client )'
- apk add --no-cache rsync
- 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
- cd ../resourcepack-out
- shasum= $(sha1sum resourcepack.zip | awk '{ print $1 }'
- ssh "$SERVER_HOST" mcrcon -H localhost -p minecraft "minecraft:say Server restart in 2 minutes"
only:
refs:
- master
changes:
- resourcepack/**/*
- resourcepack/*
- .gitlab-ci.yml