forked from dmlc/gluon-nlp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
61 lines (59 loc) · 1.71 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
stage("Sanity Check") {
node {
ws('workspace/gluon-nlp-lint') {
checkout scm
sh('ci/step_sanity_check.sh')
}
}
}
stage("Unit Test") {
capture_flag = env.BRANCH_NAME.startsWith('PR-')?'':'--capture=no'
cov_flag = env.BRANCH_NAME.startsWith('PR-')?('PR'+env.CHANGE_ID):env.BRANCH_NAME
parallel 'Python 2': {
node {
withCredentials([string(credentialsId: 'GluonNLPCodeCov', variable: 'CODECOV_TOKEN')]) {
ws('workspace/gluon-nlp-py2') {
checkout scm
sh("ci/step_unit_test.sh py2 ${cov_flag} ${capture_flag}")
}
}
}
},
'Python 3': {
node {
withCredentials([string(credentialsId: 'GluonNLPCodeCov', variable: 'CODECOV_TOKEN')]) {
ws('workspace/gluon-nlp-py3') {
checkout scm
sh("ci/step_unit_test.sh py3 ${cov_flag} ${capture_flag}")
}
}
}
},
'Documentation': {
node {
ws('workspace/gluon-nlp-docs') {
checkout scm
if (env.BRANCH_NAME.startsWith("PR-")) {
sh("ci/step_documentation.sh false")
bucket = 'gluon-nlp-staging'
path = env.BRANCH_NAME+'/'+env.BUILD_NUMBER
} else {
sh("ci/step_documentation.sh true")
bucket = 'gluon-nlp'
path = env.BRANCH_NAME
}
sh("ci/upload_doc.sh ${bucket} ${path}")
}
}
}
}
stage("Deploy") {
node {
ws('workspace/gluon-nlp-docs') {
checkout scm
if (env.BRANCH_NAME.startsWith("PR-")) {
pullRequest.comment("Job ${env.BRANCH_NAME}/${env.BUILD_NUMBER} is complete. \nDocs are uploaded to http://gluon-nlp-staging.s3-accelerate.dualstack.amazonaws.com/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/index.html")
}
}
}
}