/
Jenkinsfile
42 lines (40 loc) · 1.06 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
#! groovy
library 'pipeline-library'
def publishableBranches = ['master']
def nodeVersion = '12.18.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'
sh 'yarn lerna:bootstrap'
}
stage('Lint') {
sh 'yarn lint'
}
stage('Test') {
sh 'yarn test'
}
if(publishableBranches.contains(env.BRANCH_NAME)) {
stage('Publish') {
gitRemoteWithCredentials {
sh 'yarn run lerna:publish'
}
}
}
}
}
}
}