-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathJenkinsfile
61 lines (56 loc) · 2.02 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
50
51
52
53
54
55
56
57
58
59
60
61
// Instead of annotating an unnecessary import statement, the symbol _ is annotated, according to the annotation pattern.
def repoName = "JS-SDK"
def version = env.BRANCH_NAME
pipeline {
agent any
environment {
CI = 'true'
}
stages {
stage("Root Bootstrap && Build") {
agent {
docker {
image 'node:10.23.0-alpine3.10'
args '-e HOME=/tmp -e NPM_CONFIG_PREFIX=/tmp/.npm'
reuseNode true
}
}
steps {
sh 'npm config set registry https://registry.npm.taobao.org'
sh 'npm config set puppeteer_download_host https://npm.taobao.org/mirrors'
sh 'npm install'
sh 'npm run lint'
sh 'npm run build'
sh 'npm run release:version'
}
}
stage("SDK Deploy") {
steps {
sh 'rsync --delete -avz -e ssh ${WORKSPACE}/dist/sdk.*.js [email protected]:/data/workplus/websites/open.workplus.io/static/js-sdk/'
}
}
stage("Demo Build") {
agent {
docker {
image 'node:10.23.0-alpine3.10'
args '-e HOME=/tmp -e NPM_CONFIG_PREFIX=/tmp/.npm'
reuseNode true
}
}
steps {
sh 'cd ${WORKSPACE}/example && npm config set sass_binary_site https://npm.taobao.org/mirrors/node-sass && npm config set registry https://registry.npm.taobao.org && npm install && npm run build'
}
}
stage("Demo Deploy") {
steps {
sh 'rsync --delete -avz -e ssh ${WORKSPACE}/example/dist/* [email protected]:/data/workplus/websites/open.workplus.io/sdk-demo'
}
}
}
post {
always {
emailext(subject: '$DEFAULT_SUBJECT', body: '$DEFAULT_CONTENT', to: '[email protected]')
cleanWs deleteDirs: true
}
}
}