-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathJenkinsfile
84 lines (83 loc) · 2.66 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
82
83
84
#!/usr/bin/env groovy
// Continuous Integration script to build Jupyter-Book
// Author: [email protected]
pipeline {
agent none
stages {
stage('Create Conda env') {
agent { label 'gpu' }
environment {
PATH = "$HOME/miniconda/bin:$PATH"
}
//when { changeset "requirements.txt" }
steps {
echo 'Create Conda env for Jupyter-book'
echo 'My branch name is ${BRANCH_NAME}'
sh 'echo "My branch name is ${BRANCH_NAME}"'
sh 'echo "Agent name: ${NODE_NAME}"'
sh '''#!/usr/bin/env bash
set +x
eval "$(conda shell.bash hook)"
conda create -y -n jb_env python=3.8 jupyterlab
conda activate jb_env
pip install -r jupyter-book/requirements.txt
conda deactivate
'''
}
}
stage('Build') {
agent { label 'gpu' }
environment {
PATH = "$HOME/miniconda/bin:$PATH"
GIT_SSH_COMMAND = 'ssh -i /builds/.ssh/github_idrsa'
}
steps {
echo 'Building Jupyter-book...'
sh 'echo "Agent name: ${NODE_NAME}"'
sh '''#!/usr/bin/env bash
set +x
eval "$(conda shell.bash hook)"
conda activate jb_env
make
cd jupyter-book
mkdir -p _build/.jupyter_cache
make clean
make
sed -i 's+github/aramis-lab/DL4MI/blob/main/jupyter-book/notebooks+github/aramis-lab/DL4MI/blob/student22/notebooks+g' _build/html/notebooks/*.html
conda deactivate
'''
stash(name: 'doc_html', includes: 'jupyter-book/_build/html/**')
}
}
stage('Deploy') {
agent { label 'gpu' }
environment {
PATH = "$HOME/miniconda/bin:$PATH"
}
steps {
echo 'Deploying in webserver...'
sh 'echo "Agent name: ${NODE_NAME}"'
unstash(name: 'doc_html')
sh '''#!/usr/bin/env bash
set +x
ls ./
scp -r jupyter-book/_build/html/* aramislab.paris.inria.fr:~/workshops/DL4MI/2022/
'''
echo 'Finish uploading artifacts'
}
}
}
// post {
// success {
// mattermostSend(
// color: "##A837C4",
// message: "The tutorial has been updated, <https://aramislab.paris.inria.fr/workshops/DL4MI/intro.html|see here>"
// )
// }
// failure {
// mail to: '[email protected]',
// subject: "Failed Pipeline: ${currentBuild.fullDisplayName}",
// body: "Something is wrong with ${env.BUILD_URL}"
// }
// }
}