-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
50 lines (49 loc) · 1.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
pipeline{
agent any
stages {
stage('Create docker contaimer') {
steps{
script {
bat "docker run -i --name JupyterContainer -d -p 8887:8888 jupyter/pyspark-notebook"
sleep(3)
bat "docker exec -i JupyterContainer pip install plotly"
bat "docker exec -i JupyterContainer pip install nbval"
}
}
}
stage('Copy git files to the container') {
steps{
script {
bat "docker cp . JupyterContainer:/home/jovyan/"
}
}
}
stage('test') {
steps{
script {
bat "docker exec -i JupyterContainer /usr/local/spark-2.4.3-bin-hadoop2.7/bin/spark-submit test/WorldGDP/test-SQLiteNotebook.py > out.log"
bat "docker exec -i JupyterContainer /usr/local/spark-2.4.3-bin-hadoop2.7/bin/spark-submit test/FAO/test_FAO_spark.py >> out.log "
bat "docker exec -i JupyterContainer py.test --nbval notebooks/Crisis_analyse.ipynb"
}
}
}
stage('Destroy container') {
steps{
script {
bat "docker stop JupyterContainer"
bat "docker rm JupyterContainer"
}
}
}
stage('test results analyse') {
steps{
script {
output = powershell "(Select-String -pattern 'FAIL' out.log ).Count"
if (output > 0){
currentBuild.result = 'FAILURE'
}
}
}
}
}
}