-
Notifications
You must be signed in to change notification settings - Fork 167
/
Jenkinsfile
49 lines (40 loc) · 1.2 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
#!/usr/bin/env groovy
// Only re-build "master" every 4 hours, Monday through Friday
if (!env.CHANGE_ID && env.BRANCH_NAME == 'master') {
properties([
pipelineTriggers([
cron('H */4 * * 1-5')
])
])
}
// Timeout build after 30 minutes
timeout(30) {
node('mesos') {
stage 'Clone'
withEnv(["PATH+NODE=${tool name: '4', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'}/bin"]) {
checkout scm
sh 'docker --version'
sh 'node -v'
sh 'npm -v'
sh 'npm set registry https://npm.paypal.com'
}
stage 'Install'
withEnv(["PATH+NODE=${tool name: '4', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'}/bin"]) {
sh 'npm install'
}
stage 'Lint'
withEnv(["PATH+NODE=${tool name: '4', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'}/bin"]) {
sh 'npm run lint'
}
stage 'Test'
withEnv(["PATH+NODE=${tool name: '4', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'}/bin"]) {
sh 'node -v'
sh 'npm rebuild'
sh 'npm test'
}
stage 'Coverage'
withEnv(["PATH+NODE=${tool name: '4', type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'}/bin"]) {
sh 'npm run cover'
}
}
}