Page MenuHomePhabricator
Authored By
stwalkerster
Sep 27 2016, 11:16 PM
Size
2 KB
Referenced Files
None
Subscribers
None
#!/usr/bin/env bash -ex
function serverCommand {
ssh -p 8022 jenkins@localhost 'echo '"'"$1"'"' > /mnt/minecraft/minecraft-'$BUILD_WORLD_UNIX_NAME'.fifo'
}
echo "deb http://overviewer.org/debian ./" | sudo tee /etc/apt/sources.list.d/overviewer.list
wget -O - http://overviewer.org/debian/overviewer.gpg.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install minecraft-overviewer -qy
# open SSH tunnel to metapod
ssh -Nf -L 8022:metapod:22 -o ExitOnForwardFailure=yes -o ControlPath=~/.ssh/fearow.lon.stwalkerster.net.ctl jenkins@fearow.lon.stwalkerster.net
mkdir -p /mnt/maps/$BUILD_WORLD_UNIX_NAME
serverCommand 'tellraw @a {"text":"[Jenkins: Initiating new render job]","color":"gray","italic":true}'
serverCommand 'save-off'
serverCommand 'save-all force'
serverCommand 'tellraw @a {"text":"[Jenkins: Waiting for save to complete, then transferring world]","color":"gray","italic":true}'
sleep 5
echo > ~/.ssh/minecraft.id_rsa <<EEOOFF
-----BEGIN RSA PRIVATE KEY-----
MIGoAgEAAiEAmeInPXm1IRMZrrm52hZPFaBIf837ZI927od+9SoCs8cCASUCIBTL
iMMeSOjLOtJsIAi26Bd39tfhH9mBiauaNO5RESQVAhEA2129eLrW72Xpym8Ti10c
BQIRALOU6zm7RBSv265U/hONJlsCEFMA3+h+DCM7UYrd67gxEYUCEQClBWKIE92y
JQ8O5lFCZgeRAhAc4RcTmu62EbeoW+gODnGK
-----END RSA PRIVATE KEY-----
EEOOFF
chmod go= ~/.ssh/minecraft.id_rsa
rsync -avz -e "ssh -i ~/.ssh/minecraft.id_rsa" --exclude lost+found --exclude '*.tar.bz' --port 8022 minecraft@localhost:/mnt/minecraft/$BUILD_WORLD_UNIX_NAME/ $WORKSPACE/server
serverCommand 'tellraw @a {"text":"[Jenkins: Transfer complete. Initiating render.]","color":"gray","italic":true}'
serverCommand 'save-on'
PYTHONPATH=`pwd` overviewer.py --config=config.py --genpoi
PYTHONPATH=`pwd` overviewer.py --config=config.py
serverCommand 'tellraw @a {"text":"[Jenkins: Render complete. ]","color":"gray","italic":true}'
serverCommand 'tellraw @a {"text":" http://'$BUILD_WORLD_UNIX_NAME'.mc.stwalkerster.co.uk/","italic":false,"color":"yellow","clickEvent":{"action":"open_url","value":"http://'$BUILD_WORLD_UNIX_NAME'.mc.stwalkerster.co.uk/"}}'
# close control connection
ssh -T -O exit fearow.lon.stwalkerster.net

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1915
Default Alt Text
(2 KB)

Event Timeline