Files
refinedstorage/Jenkinsfile
raoulvdberge 9d48419403 Add test
2020-10-18 22:11:27 +02:00

31 lines
836 B
Groovy

node {
stage('Preparation') {
checkout scm
}
cache(maxCacheSize: 250, caches: [
[$class: 'ArbitraryFileCache', excludes: 'modules-2/modules-2.lock,*/plugin-resolution/**', includes: '**/*', path: '${HOME}/.gradle/caches'],
[$class: 'ArbitraryFileCache', excludes: '', includes: '**/*', path: '${HOME}/.gradle/wrapper']
]) {
stage('Cleanup') {
sh "./gradlew clean"
}
stage('Test') {
sh "./gradlew test"
}
stage('Build') {
sh "./gradlew build"
}
}
stage('Archive artifacts') {
archiveArtifacts 'build/libs/*.jar'
}
stage('Publish artifacts') {
sh "./gradlew publish"
}
stage('SonarQube analysis') {
withCredentials([string(credentialsId: 'SONAR_TOKEN', variable: 'SONAR_TOKEN')]) {
sh "./gradlew sonarqube -Dsonar.login=$SONAR_TOKEN"
}
}
}