forked from tidev/docs-devkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
38 lines (36 loc) · 991 Bytes
/
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
#! groovy
library 'pipeline-library'
def publishableBranches = ['master']
def nodeVersion = '10.15.0'
def yarnVersion = '1.16.0'
timestamps {
node('(osx || linux) && git && npm-publish') {
nodejs(nodeJSInstallationName: "node ${nodeVersion}") {
ansiColor('xterm') {
stage('Checkout') {
checkout([
$class: 'GitSCM',
branches: scm.branches,
extensions: scm.extensions + [[$class: 'WipeWorkspace'], [$class: 'LocalBranch', localBranch: "**"]],
submoduleCfg: [],
userRemoteConfigs: scm.userRemoteConfigs
])
ensureYarn(yarnVersion)
}
stage('Prepare') {
sh 'yarn'
}
stage('Lint') {
sh 'yarn lint'
}
if(publishableBranches.contains(env.BRANCH_NAME)) {
stage('Publish') {
gitRemoteWithCredentials {
sh 'yarn run lerna:publish'
}
}
}
}
}
}
}