-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
44 lines (39 loc) · 1.26 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
#! groovy
library 'pipeline-library'
timestamps {
def isMaster = false
def packageVersion
def nodeVersion = '8.11.4'
def yarnVersion = 'latest'
node('osx || linux') {
stage('Checkout') {
// checkout scm
// Hack for JENKINS-37658 - see https://support.cloudbees.com/hc/en-us/articles/226122247-How-to-Customize-Checkout-for-Pipeline-Multibranch
// do a git clean before checking out
checkout([
$class: 'GitSCM',
branches: scm.branches,
extensions: scm.extensions + [[$class: 'CleanBeforeCheckout']],
userRemoteConfigs: scm.userRemoteConfigs
])
isMaster = env.BRANCH_NAME.equals('master')
packageVersion = jsonParse(readFile('package.json'))['version']
currentBuild.displayName = "#${packageVersion}-${currentBuild.number}"
}
nodejs(nodeJSInstallationName: "node ${nodeVersion}") {
ansiColor('xterm') {
stage('Install') {
timeout(15) {
// Install yarn if not installed
ensureYarn(yarnVersion)
sh 'yarn'
fingerprint 'package.json'
} // timeout
} // stage
stage('Lint') {
sh 'yarn run lerna exec gulp lint'
}
} // ansiColor
} // nodejs
} // node
} // timestamps