rsemcm/Jenkinsfile

35 lines
1.2 KiB
Groovy

pipeline {
agent any
stages {
stage("cleanup") {
steps {
cleanWs(patterns: [[pattern: 'publish/**', type: 'INCLUDE']])
cleanWs(patterns: [[pattern: 'world/', 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") {
when {
branch "**/master"
}
steps {
sh "git clean -fdX"
zip archive: true, dir: 'curseforge', exclude: '', glob: '', zipFile: 'publish/RSEMCS.zip'
zip archive: true, dir: 'server', exclude: '', glob: '', zipFile: 'publish/RSEMCS_server.zip'
fingerprint 'publish/*.zip'
}
}
}
}