2022-01-08 20:23:08 +00:00
|
|
|
pipeline {
|
|
|
|
agent any
|
|
|
|
stages {
|
2022-05-12 09:33:18 +00:00
|
|
|
stage("integrate modpack") {
|
|
|
|
when {
|
2022-05-12 09:56:03 +00:00
|
|
|
branch '**/develop'
|
2022-05-12 09:33:18 +00:00
|
|
|
}
|
2022-01-08 20:23:08 +00:00
|
|
|
steps {
|
2022-05-13 06:58:36 +00:00
|
|
|
sshagent(['eb018bad-5d56-4306-a006-60fb7cf194aa']) {
|
2022-05-12 19:25:06 +00:00
|
|
|
sh "git fetch"
|
2022-05-12 19:38:00 +00:00
|
|
|
sh "git checkout -B latest-modpack"
|
2022-05-12 19:58:54 +00:00
|
|
|
sh "git merge -X theirs origin/develop"
|
2022-05-12 19:25:06 +00:00
|
|
|
sh "chmod u+x ./scripts/*.sh"
|
|
|
|
sh "./scripts/update_modpack.sh"
|
|
|
|
}
|
2022-01-08 20:23:08 +00:00
|
|
|
}
|
|
|
|
}
|
2022-05-12 09:33:18 +00:00
|
|
|
stage("server launch test") {
|
2022-05-13 05:28:31 +00:00
|
|
|
when {
|
|
|
|
not {
|
|
|
|
branch '**/latest-modpack'
|
|
|
|
}
|
|
|
|
}
|
2022-05-12 09:33:18 +00:00
|
|
|
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
|
2022-01-20 09:03:44 +00:00
|
|
|
}
|
2022-05-12 09:33:18 +00:00
|
|
|
}
|
2022-05-12 09:56:03 +00:00
|
|
|
stage("commit changes") {
|
|
|
|
when {
|
|
|
|
branch '**/develop'
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
sh "git clean -dfX"
|
|
|
|
sh "git add mods/**"
|
|
|
|
sh "git add config/**"
|
2022-05-12 10:01:43 +00:00
|
|
|
sh "git commit -a -m 'Automatic integration of latest modpack.' && exit 0"
|
2022-05-12 09:56:03 +00:00
|
|
|
sshagent(['108c5045-64d1-42a6-acd7-a39da5e096d1']) {
|
2022-05-12 20:12:45 +00:00
|
|
|
sh "git pull -X theirs origin latest-modpack"
|
2022-05-12 19:44:05 +00:00
|
|
|
sh "git push --set-upstream origin latest-modpack"
|
2022-05-12 09:56:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-05-12 09:33:18 +00:00
|
|
|
stage("deploy") {
|
2022-05-12 09:34:05 +00:00
|
|
|
when {
|
|
|
|
branch '**/master'
|
|
|
|
}
|
2022-01-20 09:00:47 +00:00
|
|
|
steps {
|
2022-05-12 09:34:50 +00:00
|
|
|
sh "git clean -dfX"
|
2022-05-12 20:59:40 +00:00
|
|
|
sh "rm -rf world"
|
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 03:18:03 +00:00
|
|
|
sh "rsync -a --update --delete-after ./** gamehost@entertainment:/home/gamehost/mcserver/"
|
2022-05-12 21:15:43 +00:00
|
|
|
sh "ssh gamehost@entertainment 'systemctl --user start rsemcs'"
|
2022-01-20 09:00:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-01-08 20:23:08 +00:00
|
|
|
}
|
2022-05-12 09:33:18 +00:00
|
|
|
}
|