forked from d2l-ai/d2l-en
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
61 lines (53 loc) · 1.77 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("Build and Publish") {
node {
ws('workspace/d2l-en') {
checkout scm
sh label: "Build Environment", script: '''set -ex
rm -rf ~/miniconda3/envs/d2l-en-build-${EXECUTOR_NUMBER}
conda create -n d2l-en-build-${EXECUTOR_NUMBER} pip -y
conda activate d2l-en-build-${EXECUTOR_NUMBER}
pip install mxnet-cu100
pip install git+https://github.com/d2l-ai/d2l-book
# pip install d2l>=0.9.2
python setup.py develop
pip list
'''
sh label: "Check Execution Output", script: '''set -ex
conda activate d2l-en-build-${EXECUTOR_NUMBER}
d2lbook build outputcheck
'''
sh label: "Execute Notebooks", script: '''set -ex
conda activate d2l-en-build-${EXECUTOR_NUMBER}
export CUDA_VISIBLE_DEVICES=$((EXECUTOR_NUMBER*2)),$((EXECUTOR_NUMBER*2+1))
d2lbook build eval
'''
// sh '''set -ex
// conda activate d2l-en-build-${EXECUTOR_NUMBER}
// d2lbook build linkcheck
// '''
sh label:"Build HTML", script:'''set -ex
conda activate d2l-en-build-${EXECUTOR_NUMBER}
./static/build_html.sh
'''
sh label:"Build PDF", script:'''set -ex
conda activate d2l-en-build-${EXECUTOR_NUMBER}
d2lbook build pdf
'''
sh label:"Build Package", script:'''set -ex
conda activate d2l-en-build-${EXECUTOR_NUMBER}
# don't pack downloaded data into the pkg
mv _build/eval/data _build/data_tmp
cp -r data _build/eval
d2lbook build html pkg
rm -rf _build/eval/data
mv _build/data_tmp _build/eval/data
'''
if (env.BRANCH_NAME == 'master') {
sh label:"Publish", script:'''set -ex
conda activate d2l-en-build-${EXECUTOR_NUMBER}
d2lbook deploy html pdf pkg
'''
}
}
}
}