2022-01-08 14:23:08 -06:00
|
|
|
pipeline {
|
|
|
|
agent any
|
|
|
|
stages {
|
2022-05-12 04:33:18 -05:00
|
|
|
stage("integrate modpack") {
|
|
|
|
when {
|
2022-05-13 03:06:09 -05:00
|
|
|
branch '**/sync-modpack'
|
2022-05-12 04:33:18 -05:00
|
|
|
}
|
2022-01-08 14:23:08 -06:00
|
|
|
steps {
|
2022-05-13 01:58:36 -05:00
|
|
|
sshagent(['eb018bad-5d56-4306-a006-60fb7cf194aa']) {
|
2022-05-12 14:25:06 -05:00
|
|
|
sh "git fetch"
|
2022-05-13 03:13:29 -05:00
|
|
|
sh "git checkout origin/develop"
|
2022-05-13 03:06:09 -05:00
|
|
|
sh "git merge -X theirs origin/sync-modpack"
|
2022-05-12 14:25:06 -05:00
|
|
|
sh "chmod u+x ./scripts/*.sh"
|
|
|
|
sh "./scripts/update_modpack.sh"
|
|
|
|
}
|
2022-01-08 14:23:08 -06:00
|
|
|
}
|
|
|
|
}
|
2022-05-13 04:23:50 -05:00
|
|
|
stage("server launch") {
|
2022-05-13 00:28:31 -05:00
|
|
|
when {
|
|
|
|
not {
|
2022-05-13 03:06:09 -05:00
|
|
|
branch '**/sync-modpack'
|
2022-05-13 00:28:31 -05:00
|
|
|
}
|
|
|
|
}
|
2022-05-12 04:33:18 -05:00
|
|
|
steps {
|
|
|
|
sh 'echo "eula=true" > eula.txt'
|
|
|
|
sh "chmod u+x ./run.sh"
|
2022-05-13 04:23:50 -05: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"
|
2022-05-12 04:33:18 -05:00
|
|
|
lock('Port 25565') {
|
|
|
|
sh 'echo "stop" | ./run.sh'
|
|
|
|
}
|
|
|
|
logParser failBuildOnError: true, projectRulePath: 'Jenkinsparse', parsingRulesPath: 'Jenkinsparse', showGraphs: true, unstableOnWarning: true, useProjectRule: true
|
2022-05-13 04:23:50 -05:00
|
|
|
sh "rm mods/DynmapBlockScan.jar"
|
2022-01-20 03:03:44 -06:00
|
|
|
}
|
2022-05-12 04:33:18 -05:00
|
|
|
}
|
2022-05-12 04:56:03 -05:00
|
|
|
stage("commit changes") {
|
|
|
|
when {
|
2022-05-13 03:06:09 -05:00
|
|
|
branch '**/sync-modpack'
|
2022-05-12 04:56:03 -05:00
|
|
|
}
|
|
|
|
steps {
|
|
|
|
sh "git add mods/**"
|
|
|
|
sh "git add config/**"
|
2022-05-13 04:23:50 -05:00
|
|
|
sh "git add dynmap/renderdata/**"
|
2022-05-13 03:39:06 -05:00
|
|
|
sh "git clean -dfX"
|
2022-05-13 03:18:50 -05:00
|
|
|
sh returnStatus: true, script: "git commit -m 'Automatic integration of latest modpack.'"
|
2022-05-12 04:56:03 -05:00
|
|
|
sshagent(['108c5045-64d1-42a6-acd7-a39da5e096d1']) {
|
2022-05-13 03:06:09 -05:00
|
|
|
sh "git pull -X theirs origin develop"
|
2022-05-13 03:23:34 -05:00
|
|
|
sh returnStatus: true, script: "git push --set-upstream origin develop"
|
2022-05-12 04:56:03 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-05-12 04:33:18 -05:00
|
|
|
stage("deploy") {
|
2022-05-12 04:34:05 -05:00
|
|
|
when {
|
|
|
|
branch '**/master'
|
|
|
|
}
|
2022-01-20 03:00:47 -06:00
|
|
|
steps {
|
2022-05-12 04:34:50 -05:00
|
|
|
sh "git clean -dfX"
|
2022-05-12 15:59:40 -05:00
|
|
|
sh "rm -rf world"
|
2022-05-12 04:33:18 -05:00
|
|
|
sshagent(['ce4c701d-098c-4706-8f32-c0af996a7769']) {
|
2022-05-12 16:34:02 -05:00
|
|
|
sh "ssh -o StrictHostKeyChecking=no gamehost@entertainment 'systemctl --user stop rsemcs'"
|
2022-05-12 22:18:03 -05:00
|
|
|
sh "rsync -a --update --delete-after ./** gamehost@entertainment:/home/gamehost/mcserver/"
|
2022-05-12 16:15:43 -05:00
|
|
|
sh "ssh gamehost@entertainment 'systemctl --user start rsemcs'"
|
2022-01-20 03:00:47 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-01-08 14:23:08 -06:00
|
|
|
}
|
2022-05-12 04:33:18 -05:00
|
|
|
}
|