-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsfile
82 lines (82 loc) · 2.28 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
pipeline {
agent {
docker {
image 'cdrx/pyinstaller-windows:python3'
}
}
stages {
stage ('Prep'){
steps{
checkout(
[$class: 'GitSCM', branches: [[name: "origin/master"]]]
)
}
}
stage ('Build - Lab Screen Recorder') {
when {
expression {
//only build if there have been changes
recorderChanges = sh('git diff origin/master^ origin/master^^ lab_screen_recorder')
return recorderChanges != null
}
}
steps {
sh 'pyinstaller --onefile lab_screen_recorder/lab_screen_recorder_gui.py'
}
post {
success {
archiveArtifacts 'dist/lab_screen_recorder_gui.exe'
}
}
}
stage ('Build - Lab Data Analysis') {
when {
expression {
//only build if there have been changes
dataAnalysisChanges = sh('git diff origin/master^ origin/master^^ lab_data_analysis')
return dataAnalysisChanges != null
}
}
steps {
sh 'pyinstaller --onefile lab_data_analysis/data_analysis_gui.py'
}
post {
success {
archiveArtifacts 'dist/data_analysis_gui.exe'
}
}
}
stage ('Build - Fuel Cell Power Model') {
when {
expression {
//only build if there have been changes
fuel_cell_power_model = sh('git diff origin/master^ origin/master^^ fuel_cell_power_model')
return fuel_cell_power_model != null
}
}
steps {
sh 'pyinstaller --onefile fuel_cell_power_model/main.py -n fuel_cell_power_model.exe'
}
post {
success {
archiveArtifacts 'dist/fuel_cell_power_model.exe'
}
}
}
stage('End'){
steps{
script{
if(recorderChanges == null){
echo 'No changes to lab_screen_recorder - build did not run'
}
if(dataAnalysisChanges == null){
echo 'No changes to lab_data_analysis - build did not run'
}
if(fuel_cell_power_model == null){
echo 'No changes to Fuel Cell Power Model - build did not run'
}
}
}
}
}
}