-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathJenkinsfile
More file actions
80 lines (79 loc) · 2.8 KB
/
Jenkinsfile
File metadata and controls
80 lines (79 loc) · 2.8 KB
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
pipeline {
agent none
stages {
stage('Unit tests') {
agent {
dockerfile {
filename 'DF_python36_selenium_pytest'
}
}
steps {
sh 'py.test --verbose --junit-xml test-reports/results.xml sources/test_calc.py'
}
post {
always {
junit 'test-reports/results.xml'
}
}
}
stage('Deliver (Linux)') {
agent {
dockerfile {
filename 'DF_pyinstaller_ubuntu'
}
}
steps {
dir("sources") {
sh 'rm -rf ./dist'
sh 'rm -rf ./build'
sh 'pyinstaller backend.py --hidden-import bottle_websocket --add-data "eel.js:eel" --add-data "web/**:web" --add-data "web/additions_diary.html:web" --add-data "web/__target__/frontendscrypt.js:web/__target__" --add-data "web/__target__/org.transcrypt.__runtime__.js:web/__target__" --add-data "web/__target__/frontendscrypt.options:web/__target" --onefile 2>&1 | cat'
sh 'chmod +x dist/backend'
}
}
post {
success {
stash includes: 'sources/dist/backend', name: 'linuxbuilt'
archiveArtifacts 'sources/dist/backend'
}
}
}
stage('Deliver (Windows)') {
agent {
dockerfile {
filename 'DF_pyinstaller_windows'
}
}
steps {
dir("sources") {
sh 'pip install $(grep -iE "eel" requirements.txt) 2>&1 | cat' // to complete windows that can't install eel with git
sh 'rm -rf ./dist 2>&1 | cat'
sh 'rm -rf ./build 2>&1 | cat'
sh 'pyinstaller backend.py -n backend.exe --hidden-import bottle_websocket --add-data "eel.js;eel" --add-data "web/**;web" --add-data "web/additions_diary.html;web" --add-data "web/__target__/frontendscrypt.js;web/__target__" --add-data "web/__target__/org.transcrypt.__runtime__.js;web/__target__" --add-data "web/__target__/frontendscrypt.options;web/__target" --onefile 2>&1 | cat'
sh 'chmod +x dist/backend.exe'
}
}
post {
success {
archiveArtifacts 'sources/dist/backend.exe'
}
}
}
stage('Integration Test (Linux)'){
agent {
dockerfile {
filename 'DF_python36_selenium_pytest'
}
}
steps {
unstash 'linuxbuilt'
sh './sources/dist/backend &'
sh 'py.test sources/test_web.py --driver Chrome --verbose --junit-xml test-reports/results.xml'
}
post {
always {
junit 'test-reports/results.xml'
}
}
}
}
}