-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
82 lines (73 loc) · 1.76 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
70
71
72
73
74
75
76
77
78
79
80
81
82
pipeline {
agent any
/* tools {nodejs "node"}
{
docker {
image 'node:10.22.0'
args '-v /certs/npm:/certs'
}
}*/
environment {
HOME = '.'
}
stages {
stage('Build & Test UI') {
stages {
stage ('Package') {
steps {
nodejs(nodeJSInstallationName: 'node10') {
dir ('ui') {
sh 'whoami'
sh 'npm config set cafile /certs/npm/nscacert_combined.pem'
sh 'npm install'
sh 'npm run-script build --prod'
//}
}
}
}
}
stage('Run UI Tests') {
steps {
nodejs(nodeJSInstallationName: 'node10') {
dir ('ui') {
sh 'npm run test -- --no-watch --no-progress --browsers=ChromeHeadlessCI'
sh 'npm run e2e -- --protractor-config=e2e/protractor-ci.conf.js'
}
}
}
}
stage('Publish Pacts') {
steps {
sh 'echo ${BRANCH_NAME}'
nodejs(nodeJSInstallationName: 'node10') {
dir ('ui') {
sh '''pact-broker publish ./pacts
--consumer-app-version=${GIT_COMMIT}
--broker-base-url=pact-broker
--tag=${BRANCH_NAME}'''
}
}
}
}
}
}
stage('Build & Test Service') {
steps {
script {
try {
sh './service/gradlew -b ./service/build.gradle clean test'
} finally {
junit '**/build/test-results/test/*.xml'
}
}
}
}
stage('Dockerize') {
steps {
script {
sh './service/gradlew -b ./service/build.gradle docker'
}
}
}
}
}