Try tricking Jenkins into using

This commit is contained in:
Tim Weber 2019-04-01 17:24:44 +02:00
parent 850b02273a
commit 7e9cb2c1f1
2 changed files with 43 additions and 41 deletions

82
Jenkinsfile vendored
View File

@ -1,51 +1,53 @@
#!/usr/bin/env groovy
node {
stage('checkout') {
checkout scm
}
stage('check java') {
sh "java -version"
}
stage('clean') {
sh "chmod +x gradlew"
sh "./gradlew clean --no-daemon"
}
stage('npm install') {
sh "./gradlew npm_install -PnodeInstall --no-daemon"
}
stage('backend tests') {
try {
sh "./gradlew test -PnodeInstall --no-daemon"
} catch(err) {
throw err
} finally {
junit '**/build/**/TEST-*.xml'
withEnv(["PATH=$HOME/bin:$PATH"]) {
stage('checkout') {
checkout scm
}
}
stage('frontend tests') {
try {
sh "./gradlew npm_run_test -PnodeInstall --no-daemon"
} catch(err) {
throw err
} finally {
junit '**/build/test-results/TESTS-*.xml'
stage('check java') {
sh "java -version"
}
}
stage('packaging') {
sh "./gradlew bootWar -x test -Pprod -PnodeInstall --no-daemon"
archiveArtifacts artifacts: '**/build/libs/*.war', fingerprint: true
}
stage('clean') {
sh "chmod +x gradlew"
sh "./gradlew clean --no-daemon"
}
stage('quality analysis') {
withSonarQubeEnv('sonar') {
sh "./gradlew sonarqube --no-daemon"
stage('npm install') {
sh "./gradlew npm_install -PnodeInstall --no-daemon"
}
stage('backend tests') {
try {
sh "./gradlew test -PnodeInstall --no-daemon"
} catch (err) {
throw err
} finally {
junit '**/build/**/TEST-*.xml'
}
}
stage('frontend tests') {
try {
sh "./gradlew npm_run_test -PnodeInstall --no-daemon"
} catch (err) {
throw err
} finally {
junit '**/build/test-results/TESTS-*.xml'
}
}
stage('packaging') {
sh "./gradlew bootWar -x test -Pprod -PnodeInstall --no-daemon"
archiveArtifacts artifacts: '**/build/libs/*.war', fingerprint: true
}
stage('quality analysis') {
withSonarQubeEnv('sonar') {
sh "./gradlew sonarqube --no-daemon"
}
}
}
}

View File

@ -2,7 +2,7 @@ rootProject.name=hsadmin-ng
profile=dev
# Build properties
node_version=10.15.0
node_version=10.15.3
npm_version=6.4.1
yarn_version=1.13.0