From d961c9885992b2b731d946f03fc83426ab7509c0 Mon Sep 17 00:00:00 2001 From: Brice Copy Date: Tue, 5 Feb 2019 08:55:06 +0100 Subject: [PATCH] Add Jenkinsfile for world regeneration --- Jenkinsfile | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..11db834 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,41 @@ +pipeline { + agent { label 'ctw' } + stages { + stage('prepare') { + steps{ + checkout([$class: 'GitSCM', branches: [[name: '*/develop']], + doGenerateSubmoduleConfigurations: false, + extensions: [[$class: 'SubmoduleOption', + disableSubmodules: false, + parentCredentials: false, + recursiveSubmodules: true, + reference: '', + trackingSubmodules: false]], + submoduleCfg: [], + userRemoteConfigs: [[url: 'https://github.com/CERN/CTW']]]) + sh 'killall -q minetest || true' + sh 'rm -rf /tmp/CERN_v1*' + } + } + stage('convert world') { + steps{ + sh ''' + wpscript build/worldpainter/export-world.js worlds/cern/CERN_v1.world /tmp; + cd build/mcimport && python36 ./mcimport.py /tmp/CERN_v1 /tmp/CERN_v1.mt > /tmp/conversion.log; + cd - ; + cp -r /tmp/CERN_v1.mt ~/.minetest/worlds/CERN_v1 + cp build/minetest/auth-allprivs.txt ~/.minetest/worlds/CERN_v1/auth.txt + ''' + } + } + } + post { + success { + sh ''' + JENKINS_NODE_COOKIE=dontKillMe nohup minetest --server --port 30001 --worldname CERN_v1 > /tmp/CERN_v1.stdout 2>&1 & + JENKINS_NODE_COOKIE=dontKillMe nohup minetest --server --port 30002 --worldname CERN_v1.creative > /tmp/CERN_v1.creative.stdout 2>&1 & + ''' + } + } + +}