rsemcs/Jenkinsfile

51 lines
1.9 KiB
Plaintext
Raw Normal View History

2022-01-08 20:23:08 +00:00
pipeline {
agent {
label 'linux && increased_mem'
}
options {
disableConcurrentBuilds()
}
2022-01-08 20:23:08 +00:00
stages {
stage("run server") {
when {
not {
triggeredBy "BuildUpstreamCause"
}
}
2022-05-12 09:33:18 +00:00
steps {
sh 'echo "eula=true" > eula.txt'
2022-05-13 21:50:40 +00:00
sh "chmod u+x ./run_trial.sh"
2022-05-13 09:23:50 +00:00
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"
sh 'echo "stop" | ./run_trial.sh'
2022-05-12 09:33:18 +00:00
logParser failBuildOnError: true, projectRulePath: 'Jenkinsparse', parsingRulesPath: 'Jenkinsparse', showGraphs: true, unstableOnWarning: true, useProjectRule: true
2022-05-13 09:23:50 +00:00
sh "rm mods/DynmapBlockScan.jar"
}
2022-05-12 09:33:18 +00:00
}
stage("cleanup") {
when {
not {
triggeredBy "BuildUpstreamCause"
}
}
2022-05-13 20:37:09 +00:00
steps {
sh "git clean -dfX"
sh "rm -rf world"
}
}
2022-05-12 09:33:18 +00:00
stage("deploy") {
when {
branch '**/master'
}
steps {
2022-05-12 09:33:18 +00:00
sshagent(['ce4c701d-098c-4706-8f32-c0af996a7769']) {
2022-05-12 21:34:02 +00:00
sh "ssh -o StrictHostKeyChecking=no gamehost@entertainment 'systemctl --user stop rsemcs'"
2022-05-13 19:57:42 +00:00
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"
2022-05-12 21:15:43 +00:00
sh "ssh gamehost@entertainment 'systemctl --user start rsemcs'"
}
}
}
2022-01-08 20:23:08 +00:00
}
2022-05-12 09:33:18 +00:00
}