-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathJenkinsfile_pipeline_test
57 lines (48 loc) · 1.31 KB
/
Jenkinsfile_pipeline_test
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
#!groovy
@Library('Infrastructure') _
import uk.gov.hmcts.contino.GradleBuilder
def channel = '#platops-build-notices'
GradleBuilder builder = new GradleBuilder(this, 'jenkins-library')
def testBranch = env.CHANGE_BRANCH ?: env.BRANCH_NAME
try {
node {
stage('Checkout') {
deleteDir()
checkout scm
}
stage('Build') {
builder.gradle('--version')
builder.gradle('clean build -x test')
}
stage('Test') {
try {
builder.gradle('test')
} finally {
steps.junit '**/test-results/**/*.xml'
deleteDir()
}
}
}
stage('Run shared infra pipeline') {
build job: 'Pipeline_Test_Sandbox/cnp-plum-shared-infrastructure/master',
parameters: [string(name: 'LIB_VERSION', value: testBranch)]
}
parallel (
backend: {
stage('Run pipeline for backend') {
build job: 'Pipeline_Test_Sandbox/cnp-plum-recipes-service/master',
parameters: [string(name: 'LIB_VERSION', value: testBranch)]
}
},
frontend: {
stage('Run pipeline for frontend') {
build job: 'Pipeline_Test_Sandbox/cnp-plum-frontend/master',
parameters: [string(name: 'LIB_VERSION', value: testBranch)]
}
}
)
} catch (err) {
notifyBuildFailure channel: channel
throw err
}
notifyBuildFixed channel: channel