hs.hsadmin.ng/Jenkinsfile

58 lines
1.5 KiB
Plaintext
Raw Normal View History

2019-04-01 16:36:53 +02:00
#!/usr/bin/env groovy
node {
2019-04-01 17:24:44 +02:00
withEnv(["PATH=$HOME/bin:$PATH"]) {
stage('checkout') {
checkout scm
}
2019-04-01 16:36:53 +02:00
2019-04-01 17:24:44 +02:00
stage('check java') {
sh "java -version"
}
2019-04-01 16:36:53 +02:00
stage('clean+spotless') {
2019-04-01 17:24:44 +02:00
sh "chmod +x gradlew"
sh "./gradlew clean spotlessCheck --no-daemon"
2019-04-01 17:24:44 +02:00
}
2019-04-01 16:36:53 +02:00
2019-04-01 17:24:44 +02:00
stage('npm install') {
sh "./gradlew npm_install -PnodeInstall --no-daemon"
}
2019-04-01 16:36:53 +02:00
2019-04-01 17:24:44 +02:00
stage('backend tests') {
try {
sh "./gradlew test -PnodeInstall --no-daemon"
} catch (err) {
throw err
} finally {
junit '**/build/**/TEST-*.xml'
}
2019-04-01 16:36:53 +02:00
}
2019-04-09 15:18:11 +02:00
stage('backend check') {
try {
sh "./gradlew check -PnodeInstall --no-daemon"
} catch (err) {
throw err
} finally {
archiveArtifacts artifacts: '**/build/reports/jacoco/test/html/', fingerprint: true
}
}
2019-04-01 17:24:44 +02:00
stage('frontend tests') {
try {
sh "./gradlew npm_run_test -PnodeInstall --no-daemon"
} catch (err) {
throw err
} finally {
junit '**/build/test-results/TESTS-*.xml'
}
2019-04-01 16:36:53 +02:00
}
2019-04-01 17:24:44 +02:00
stage('packaging') {
sh "./gradlew bootWar -x test -Pprod -PnodeInstall --no-daemon"
archiveArtifacts artifacts: '**/build/libs/*.war', fingerprint: true
}
2019-04-01 16:36:53 +02:00
}
}