forked from dmlc/gluon-nlp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
81 lines (78 loc) · 2.51 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
stage("Sanity Check") {
node {
ws('workspace/gluon-nlp-lint') {
checkout scm
sh """#!/bin/bash
conda env update -f env/pylint.yml
source activate gluon_nlp_pylint
conda list
make clean
make pylint
"""
}
}
}
stage("Unit Test") {
parallel 'Python 2': {
node {
ws('workspace/gluon-nlp-py2') {
checkout scm
sh """#!/bin/bash
conda env update -f env/py2.yml
source activate gluon_nlp_py2
conda list
python -m spacy download en
python -m nltk.downloader all
make clean
python setup.py install
py.test -v --capture=no --durations=0 --cov=gluonnlp --cov=scripts tests/unittest scripts
"""
}
}
},
'Python 3': {
node {
ws('workspace/gluon-nlp-py3') {
checkout scm
sh """#!/bin/bash
conda env update -f env/py3.yml
source activate gluon_nlp_py3
conda list
python -m spacy download en
python -m nltk.downloader all
make clean
python setup.py install
py.test -v --capture=no --durations=0 --cov=gluonnlp --cov=scripts tests/unittest scripts
"""
}
}
}
}
stage("Deploy") {
node {
ws('workspace/gluon-nlp-docs') {
checkout scm
sh """#!/bin/bash
conda env update -f env/doc.yml
source activate gluon_nlp_docs
conda list
python setup.py install
export LD_LIBRARY_PATH=/usr/local/cuda/lib64
make clean
make release
make -C docs html SPHINXOPTS=-W"""
if (env.BRANCH_NAME.startsWith("PR-")) {
sh """#!/bin/bash
echo "Uploading doc to s3://gluon-nlp-staging/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/"
aws s3 sync --delete docs/_build/html/ s3://gluon-nlp-staging/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/ --acl public-read
echo "Uploaded doc to http://gluon-nlp-staging.s3-accelerate.dualstack.amazonaws.com/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/index.html" """
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")
} else {
sh """#!/bin/bash
echo "Uploading doc to s3://gluon-nlp/${env.BRANCH_NAME}/"
aws s3 sync --delete docs/_build/html/ s3://gluon-nlp/${env.BRANCH_NAME}/ --acl public-read
echo "Uploaded doc to http://gluon-nlp.mxnet.io/${env.BRANCH_NAME}/index.html" """
}
}
}
}