Use Xvfb for testing

MYC-Refactor
Hammy 3 years ago
parent 85cd3f874e
commit 5c4c004840

76
Jenkinsfile vendored

@ -12,54 +12,54 @@ pipeline {
GPG_OWNER_TRUST = credentials('8703bbe8-c099-481f-8337-1dce32d51771') GPG_OWNER_TRUST = credentials('8703bbe8-c099-481f-8337-1dce32d51771')
} }
stages { wrap([$class: 'Xvfb']) {
stage("Import GPG Keys") { stages {
when { stage("Import GPG Keys") {
branch 'release' when {
} branch 'release'
steps { }
sh 'gpg --batch --import $GPG_SECRET_KEY' steps {
sh 'gpg --import-ownertrust $GPG_OWNER_TRUST' sh 'gpg --batch --import $GPG_SECRET_KEY'
sh 'gpg --import-ownertrust $GPG_OWNER_TRUST'
}
} }
} stage("Build") {
stage("Build") { steps {
steps { withCredentials([file(credentialsId: '076a36e8-d448-46fc-af11-7e7181a6cb99', variable: 'MAVEN_SETTINGS')]) {
withCredentials([file(credentialsId: '076a36e8-d448-46fc-af11-7e7181a6cb99', variable: 'MAVEN_SETTINGS')]) { sh 'mvn -s $MAVEN_SETTINGS -B -DskipTests clean package'
sh 'mvn -s $MAVEN_SETTINGS -B -DskipTests clean package' }
} }
} }
} stage("Test") {
stage("Test") {
wrap([$class: 'Xvfb']) {
steps { steps {
sh "mvn test" sh "mvn test"
} }
} post {
post { success {
success { echo "Generating Test Report..."
echo "Generating Test Report..." publishCoverage adapters: [jacocoAdapter('target/site/jacoco/jacoco.xml')]
publishCoverage adapters: [jacocoAdapter('target/site/jacoco/jacoco.xml')]
echo "Sending Report to CodeCov..." echo "Sending Report to CodeCov..."
sh '''#!/bin/bash sh '''#!/bin/bash
bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN || echo "Codecov did not collect coverage reports" bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN || echo "Codecov did not collect coverage reports"
''' '''
}
} }
} }
} stage("Deploy To OSSRH") {
stage("Deploy To OSSRH") { when {
when { branch 'release'
branch 'release'
}
steps {
withCredentials([file(credentialsId: '076a36e8-d448-46fc-af11-7e7181a6cb99', variable: 'MAVEN_SETTINGS')]) {
sh 'mvn -s $MAVEN_SETTINGS -B -DskipTests clean deploy'
} }
} steps {
post { withCredentials([file(credentialsId: '076a36e8-d448-46fc-af11-7e7181a6cb99', variable: 'MAVEN_SETTINGS')]) {
success { sh 'mvn -s $MAVEN_SETTINGS -B -DskipTests clean deploy'
echo "Archiving Artifacts" }
archiveArtifacts artifacts: 'target/*.jar' }
post {
success {
echo "Archiving Artifacts"
archiveArtifacts artifacts: 'target/*.jar'
}
} }
} }
} }

Loading…
Cancel
Save