forked from cyberark/conjur-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
69 lines (60 loc) · 1.99 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env groovy
pipeline {
agent { label 'executor-v2' }
options {
timestamps()
buildDiscarder(logRotator(numToKeepStr: '30'))
}
stages {
stage('Integration Tests') {
steps {
script {
ccCoverage.dockerPrep()
sh './bin/test_integration --coverage'
sh './bin/test_integration -e'
}
}
post {
always {
archiveArtifacts artifacts: 'client/target/dependency-check-report.html', fingerprint: true
junit 'client/target/surefire-reports/*.xml'
sh """
if [[ -x cc-test-reporter ]]; then
echo "cc-test-reporter binary found, reporting coverage data to code climate"
export GIT_COMMIT="\$(<GIT_COMMIT)"
export GIT_BRANCH="\$(<GIT_BRANCH)"
JACOCO_SOURCE_PATH=client/src/main/java ./cc-test-reporter format-coverage \
client/target/site/jacoco/jacoco.xml \
--input-type jacoco
./cc-test-reporter upload-coverage --id \$(<TRID) \
&& echo "Successfully Reported Coverage Data"
else
echo "cc-test-reporter binary not found, not reporting coverage data to code climate"
fi
"""
}
}
}
stage("Deploy snapshot") {
when {
branch 'main'
}
steps {
sh 'summon ./bin/deploy-snapshot'
}
}
stage("Deploy release") {
when {
buildingTag()
}
steps {
sh 'summon ./bin/deploy-release'
}
}
}
post {
always {
cleanupAndNotify(currentBuild.currentResult)
}
}
}