pipeline { agent any stages { stage("integrate modpack") { when { branch '**/develop' } steps { sh "chmod u+x ./scripts/*.sh" sh "./scripts/update_modpack.sh" } } stage("server launch test") { steps { sh 'echo "eula=true" > eula.txt' sh "chmod u+x ./run.sh" lock('Port 25565') { sh 'echo "stop" | ./run.sh' } logParser failBuildOnError: true, projectRulePath: 'Jenkinsparse', parsingRulesPath: 'Jenkinsparse', showGraphs: true, unstableOnWarning: true, useProjectRule: true } } stage("commit changes") { when { branch '**/develop' } steps { sh "git clean -dfX" sh "git add mods/**" sh "git add config/**" sh "git commit -a -m 'Automatic integration of latest modpack.'" sshagent(['108c5045-64d1-42a6-acd7-a39da5e096d1']) { sh "git push" } } } stage("deploy") { when { branch '**/master' } steps { sh "git clean -dfX" sh git add sshagent(['ce4c701d-098c-4706-8f32-c0af996a7769']) { sh "systemctl --user stop rsemcs" sh "scp -r ./** gamehost@entertainment:/home/gamehost/mcserver/" sh "systemctl --user start rsemcs" } } } } }