2019-08-05 21:08:45 +02:00
|
|
|
pipeline {
|
|
|
|
agent any
|
|
|
|
|
|
|
|
stages {
|
2019-08-06 11:16:13 +02:00
|
|
|
stage('Build') {
|
|
|
|
steps {
|
|
|
|
dir("Plan") {
|
|
|
|
script {
|
2019-08-12 13:33:49 +02:00
|
|
|
sh 'rm -rf builds'
|
2019-08-23 16:37:24 +02:00
|
|
|
sh 'sed -i -e s/%buildNumber%/'$BUILD_NUMBER'/g build.gradle'
|
|
|
|
sh 'sed -i -e s/%buildNumber%/'$BUILD_NUMBER'/g common/src/main/resources/plugin.yml'
|
|
|
|
sh 'sed -i -e s/%buildNumber%/'$BUILD_NUMBER'/g common/src/main/resources/bungee.yml'
|
|
|
|
sh 'sed -i -e s/%buildNumber%/'$BUILD_NUMBER'/g sponge/src/main/java/com/djrapitops/plan/PlanSponge.java'
|
|
|
|
sh 'sed -i -e s/%buildNumber%/'$BUILD_NUMBER'/g velocity/src/main/java/com/djrapitops/plan/PlanVelocity.java'
|
2019-08-07 13:58:52 +02:00
|
|
|
sh './gradlew clean shadowJar --parallel'
|
2019-08-06 11:16:13 +02:00
|
|
|
}
|
|
|
|
}
|
2019-08-12 13:33:49 +02:00
|
|
|
archiveArtifacts artifacts: 'Plan/builds/*.jar', fingerprint: false
|
2019-08-06 11:16:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Tests') {
|
2019-08-05 21:08:45 +02:00
|
|
|
steps {
|
|
|
|
dir("Plan") {
|
|
|
|
script {
|
|
|
|
try {
|
2019-08-07 13:58:52 +02:00
|
|
|
sh './gradlew test --parallel'
|
2019-08-05 21:08:45 +02:00
|
|
|
} finally {
|
2019-08-06 11:16:13 +02:00
|
|
|
junit '**/build/test-results/test/*.xml'
|
2019-08-05 21:08:45 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Checkstyle') {
|
|
|
|
steps {
|
|
|
|
dir("Plan") {
|
|
|
|
script {
|
2019-08-06 11:16:13 +02:00
|
|
|
sh './gradlew checkstyleMain checkstyleTest --parallel'
|
2019-08-05 21:08:45 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('SonarQube analysis') {
|
|
|
|
steps {
|
|
|
|
dir("Plan") {
|
|
|
|
script {
|
|
|
|
withSonarQubeEnv() {
|
|
|
|
sh './gradlew sonarqube -Dsonar.organization=player-analytics-plan'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-08-07 13:58:52 +02:00
|
|
|
post {
|
|
|
|
always {
|
|
|
|
dir("Plan") {
|
|
|
|
script {
|
|
|
|
sh './gradlew clean --parallel'
|
2019-08-12 13:33:49 +02:00
|
|
|
sh 'rm -rf builds'
|
2019-08-07 13:58:52 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-08-05 21:08:45 +02:00
|
|
|
}
|