-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
87 lines (86 loc) · 2.95 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
85
86
87
#!/usr/bin/env groovy
// Continuous Integration script to build Jupyter-Book
// Author: [email protected]
pipeline {
agent none
stages {
stage('Clone Conda env') {
agent { label 'linux && cpu' }
environment {
PATH = "$HOME/miniconda/bin:$PATH"
}
//when { changeset "requirements.txt" }
steps {
echo 'Install clinicadl in a clean environment...'
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 clinicadl_course python=3.7
conda activate clinicadl_course
pip install clinicadl==0.2.0
conda install jupyter
pip install sphinx nbsphinx sphinx-click sphinx_tabs myst-parser==0.9.1 jupytext[myst]
pip install -r requirements.txt
conda deactivate
'''
}
}
stage('Build') {
agent { label 'linux && cpu' }
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
git submodule update --init --recursive
git pull --recurse-submodules
eval "$(conda shell.bash hook)"
conda activate clinicadl_course
jupyter-book build .
cp -r Notebooks-AD-DL/images _build/html/Notebooks-AD-DL/
cd _build/html/Notebooks-AD-DL
sed -i 's+github/aramis-lab/MICCAI-educational-challenge-2020/blob/master/Notebooks-AD-DL+github/aramis-lab/Notebooks-AD-DL/blob/master+g' ./*.html
conda deactivate
'''
stash(name: 'doc_html', includes: '_build/html/**')
}
}
stage('Deploy') {
agent { label 'linux && cpu' }
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 _build/html aramislab.paris.inria.fr:~/clinicadl/tutoriel/2020/
'''
echo 'Finish uploading artifacts'
}
}
}
/*post {
success {
mattermostSend(
color: "##A837C4",
message: "The tutorial has been updated, <https://aramislab.paris.inria.fr/clinicadl/tuto|see here>"
)
}
failure {
mail to: '[email protected]',
subject: "Failed Pipeline: ${currentBuild.fullDisplayName}",
body: "Something is wrong with ${env.BUILD_URL}"
}
}*/
}