-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathpipeline.groovy
36 lines (35 loc) · 1019 Bytes
/
pipeline.groovy
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
properties([disableConcurrentBuilds()])
node {
try {
stage('Checkout') {
checkout scm
}
if (!utils.skip()) {
docker.image("node:8").inside {
stage('Setup') {
git.authenticate()
npm.authenticate()
retry(3) {
sh 'npm install --verbose'
}
}
stage('Compile') {
sh 'npm run compile'
sh 'git checkout -- package-lock.json'
}
stage('Test') {
sh 'CI=true npm run test'
}
if (!utils.isPullRequest()) {
stage('Publish Version') {
String newVersion = npm.version()
git.push()
git.tag("${newVersion}")
}
}
}
}
} finally {
deleteDir()
}
}