rsemcm/Jenkinsfile

39 lines
1.3 KiB
Groovy

pipeline {
agent any
stages {
stage("cleanup") {
steps {
cleanWs(patterns: [[pattern: 'publish/**', type: 'INCLUDE']])
}
}
stage("server launch test") {
steps {
dir('server') {
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
sh 'git reset --hard'
}
}
stage("publish") {
steps {
sh "git clean -dfX"
sh "rm -rf server/world"
zip archive: true, dir: 'curseforge', exclude: '', glob: '', overwrite: true, zipFile: 'publish/RSEMCS.zip'
zip archive: true, dir: 'server', exclude: '', glob: '', overwrite: true, zipFile: 'publish/RSEMCS_server.zip'
}
}
stage("build downstream") {
when {
branch '**/master'
}
steps {
build wait: false, '/ydeng/rsemcs/develop'
}
}
}
}