38 lines
1.6 KiB
Groovy
38 lines
1.6 KiB
Groovy
pipeline {
|
|
agent any
|
|
stages {
|
|
stage("server trial") {
|
|
when {
|
|
not {
|
|
branch '**/sync-modpack'
|
|
}
|
|
}
|
|
steps {
|
|
sh 'echo "eula=true" > eula.txt'
|
|
sh "chmod u+x ./run.sh"
|
|
sh "curl -o mods/DynmapBlockScan.jar -LJR https://github.com/webbukkit/DynmapBlockScan/releases/download/v3.4-beta-1/DynmapBlockScan-3.4-beta-1-forge-1.18.jar"
|
|
lock('Port 25565') {
|
|
sh 'echo "stop" | ./run.sh'
|
|
}
|
|
logParser failBuildOnError: true, projectRulePath: 'Jenkinsparse', parsingRulesPath: 'Jenkinsparse', showGraphs: true, unstableOnWarning: true, useProjectRule: true
|
|
sh "rm mods/DynmapBlockScan.jar"
|
|
}
|
|
}
|
|
stage("deploy") {
|
|
when {
|
|
branch '**/master'
|
|
}
|
|
steps {
|
|
sh "git clean -dfX"
|
|
sh "rm -rf world"
|
|
sshagent(['ce4c701d-098c-4706-8f32-c0af996a7769']) {
|
|
sh "ssh -o StrictHostKeyChecking=no gamehost@entertainment 'systemctl --user stop rsemcs'"
|
|
sh "rsync -a --update --exclude ./mods/ --exclude ./config/ ./** gamehost@entertainment:/home/gamehost/mcserver/"
|
|
sh "rsync -a --update --delete ./mods/ gamehost@entertainment:/home/gamehost/mcserver/mods"
|
|
sh "rsync -a --update --delete ./config/ gamehost@entertainment:/home/gamehost/mcserver/config"
|
|
sh "ssh gamehost@entertainment 'systemctl --user start rsemcs'"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |