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
|
|
|
|
2019-04-01 17:24:44 +02:00
|
|
|
stage('clean') {
|
|
|
|
sh "chmod +x gradlew"
|
|
|
|
sh "./gradlew clean --no-daemon"
|
|
|
|
}
|
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-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
|
|
|
}
|
|
|
|
}
|