2019-08-06 03:08:45 +08:00
|
|
|
pipeline {
|
|
|
|
agent any
|
|
|
|
|
|
|
|
stages {
|
2019-08-06 17:16:13 +08:00
|
|
|
stage('Build') {
|
|
|
|
steps {
|
|
|
|
dir("Plan") {
|
|
|
|
script {
|
2019-08-12 19:33:49 +08:00
|
|
|
sh 'rm -rf builds'
|
2019-08-07 19:58:52 +08:00
|
|
|
sh './gradlew clean shadowJar --parallel'
|
2019-08-06 17:16:13 +08:00
|
|
|
}
|
|
|
|
}
|
2019-08-12 19:33:49 +08:00
|
|
|
archiveArtifacts artifacts: 'Plan/builds/*.jar', fingerprint: false
|
2019-08-06 17:16:13 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Tests') {
|
2019-08-06 03:08:45 +08:00
|
|
|
steps {
|
|
|
|
dir("Plan") {
|
|
|
|
script {
|
|
|
|
try {
|
2019-08-07 19:58:52 +08:00
|
|
|
sh './gradlew test --parallel'
|
2019-08-06 03:08:45 +08:00
|
|
|
} finally {
|
2019-08-06 17:16:13 +08:00
|
|
|
junit '**/build/test-results/test/*.xml'
|
2019-08-06 03:08:45 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Checkstyle') {
|
|
|
|
steps {
|
|
|
|
dir("Plan") {
|
|
|
|
script {
|
2019-08-06 17:16:13 +08:00
|
|
|
sh './gradlew checkstyleMain checkstyleTest --parallel'
|
2019-08-06 03:08:45 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('SonarQube analysis') {
|
|
|
|
steps {
|
|
|
|
dir("Plan") {
|
|
|
|
script {
|
|
|
|
withSonarQubeEnv() {
|
|
|
|
sh './gradlew sonarqube -Dsonar.organization=player-analytics-plan'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-08-07 19:58:52 +08:00
|
|
|
post {
|
|
|
|
always {
|
|
|
|
dir("Plan") {
|
|
|
|
script {
|
|
|
|
sh './gradlew clean --parallel'
|
2019-08-12 19:33:49 +08:00
|
|
|
sh 'rm -rf builds'
|
2019-08-07 19:58:52 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-08-06 03:08:45 +08:00
|
|
|
}
|