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 #!/usr/bin/env groovy
node { node {
stage('checkout') { withEnv(["PATH=$HOME/bin:$PATH"]) {
checkout scm 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'
} }
}
stage('frontend tests') { stage('check java') {
try { sh "java -version"
sh "./gradlew npm_run_test -PnodeInstall --no-daemon"
} catch(err) {
throw err
} finally {
junit '**/build/test-results/TESTS-*.xml'
} }
}
stage('packaging') { stage('clean') {
sh "./gradlew bootWar -x test -Pprod -PnodeInstall --no-daemon" sh "chmod +x gradlew"
archiveArtifacts artifacts: '**/build/libs/*.war', fingerprint: true sh "./gradlew clean --no-daemon"
} }
stage('quality analysis') { stage('npm install') {
withSonarQubeEnv('sonar') { sh "./gradlew npm_install -PnodeInstall --no-daemon"
sh "./gradlew sonarqube --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 profile=dev
# Build properties # Build properties
node_version=10.15.0 node_version=10.15.3
npm_version=6.4.1 npm_version=6.4.1
yarn_version=1.13.0 yarn_version=1.13.0