2020-09-09 16:18:52 +02:00
|
|
|
pipeline {
|
|
|
|
agent { label 'slave' }
|
|
|
|
options { timestamps() }
|
|
|
|
stages {
|
|
|
|
stage('Cleanup') {
|
|
|
|
steps {
|
2020-10-30 19:41:56 +01:00
|
|
|
scmSkip(deleteBuild: true, skipPattern:'.*\\[CI-SKIP\\].*')
|
2020-09-09 16:18:52 +02:00
|
|
|
sh 'rm -rf ./target'
|
2021-01-21 11:58:52 +01:00
|
|
|
sh 'rm -rf ./Paper/Paper-API ./Paper/Paper-Server ./Paper/work/Spigot/Spigot-API ./Paper/work/Spigot/Spigot-Server'
|
2020-09-09 16:18:52 +02:00
|
|
|
sh 'rm -rf ./Yatopia-API ./Yatopia-Server'
|
2021-01-21 11:58:52 +01:00
|
|
|
sh 'chmod +x ./gradlew'
|
2020-09-09 16:18:52 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Init project & submodules') {
|
|
|
|
steps {
|
2021-01-21 11:58:52 +01:00
|
|
|
sh './gradlew initGitSubmodules'
|
2020-09-09 16:18:52 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Decompile & apply patches') {
|
|
|
|
tools {
|
|
|
|
jdk "OpenJDK 8"
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
withMaven(
|
|
|
|
maven: '3',
|
|
|
|
mavenLocalRepo: '.repository',
|
|
|
|
publisherStrategy: 'EXPLICIT',
|
|
|
|
) {
|
|
|
|
sh '''
|
2021-01-21 11:58:52 +01:00
|
|
|
./gradlew setupUpstream
|
|
|
|
./gradlew applyPatches
|
2020-09-09 16:18:52 +02:00
|
|
|
'''
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-01-21 11:58:52 +01:00
|
|
|
stage('Build') {
|
2020-09-09 16:18:52 +02:00
|
|
|
tools {
|
|
|
|
jdk "OpenJDK 8"
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
withMaven(
|
|
|
|
maven: '3',
|
|
|
|
mavenLocalRepo: '.repository',
|
|
|
|
publisherStrategy: 'EXPLICIT'
|
|
|
|
) {
|
2021-01-21 11:58:52 +01:00
|
|
|
sh '''
|
|
|
|
./gradlew build
|
|
|
|
./gradlew publish
|
|
|
|
'''
|
2020-09-09 16:18:52 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Build Launcher') {
|
|
|
|
tools {
|
|
|
|
jdk "OpenJDK 8"
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
withMaven(
|
|
|
|
maven: '3',
|
|
|
|
mavenLocalRepo: '.repository',
|
|
|
|
publisherStrategy: 'EXPLICIT'
|
|
|
|
) {
|
|
|
|
sh '''
|
|
|
|
mkdir -p "./target"
|
2021-01-21 11:58:52 +01:00
|
|
|
./gradlew paperclip
|
|
|
|
cp "yatopia-$mcver-paperclip.jar" "./target/yatopia-$mcver-paperclip-b$BUILD_NUMBER.jar"
|
|
|
|
'''
|
2020-09-09 16:18:52 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
post {
|
|
|
|
success {
|
|
|
|
archiveArtifacts "target/*.jar"
|
|
|
|
}
|
2020-10-06 17:10:51 +02:00
|
|
|
failure {
|
|
|
|
cleanWs()
|
|
|
|
}
|
2020-09-09 16:18:52 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|