forked from d2l-ai/d2l-en
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
36 lines (36 loc) · 916 Bytes
/
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
stage("Build and Publish") {
node {
ws('workspace/d2l-en') {
checkout scm
echo "Setup environment"
sh '''set -ex
conda remove -n d2l-en-build --all -y
conda create -n d2l-en-build pip -y
conda activate d2l-en-build
pip install mxnet-cu100
pip install d2lbook>=0.1.5 d2l>=0.9.2
'''
echo "Execute notebooks"
sh '''set -ex
conda activate d2l-en-build
d2lbook build eval
'''
echo "Build HTML/PDF/Pakage"
sh '''set -ex
conda activate d2l-en-build
d2lbook build html pdf
mv _build/eval/data _build/data_tmp
cp -r data _build/eval
d2lbook build html pkg
mv _build/data_tmp _build/eval/data
'''
if (env.BRANCH_NAME == 'master') {
echo "Publish"
sh '''set -ex
conda activate d2l-en-build
d2lbook deploy html pdf pkg
'''
}
}
}
}