-
Notifications
You must be signed in to change notification settings - Fork 15
/
Jenkinsfile
112 lines (101 loc) · 3.62 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
pipeline {
agent any
stages {
stage('Checkout Code') {
steps {
echo 'Starting code checkout stage.'
sh '''
#!/bin/sh
rm -rf
'''
git credentialsId: 'nadia-git', url: 'https://github.com/cmu-seai/jenkins-demo.git'
echo 'Code checked out successfully.'
} // steps
} // stage
stage('Install Dependencies') {
steps {
echo 'Installing dependencies'
sh '''
#!/bin/sh
pip3 install -r requirements.txt
'''
}
}
stage('Evaluate Code Quality') {
steps {
echo 'Run tests'
sh '''
#!/bin/sh
python3 -m pytest --cov=./ --cov-report=xml ./
'''
cobertura coberturaReportFile: 'coverage.xml'
echo 'Code quality check completed.'
} // steps
} // stage
stage('Run Pipeline') {
steps {
echo 'Run pipeline'
sh '''
#!/bin/sh
python3 ./pipeline.py
'''
plot csvFileName: 'metric1.csv', csvSeries: [[file: 'plot_metric1.csv']], group: 'Measures', title: 'Metric 1', style: 'line', yaxis: 'Metric 1'
plot csvFileName: 'metric2.csv', csvSeries: [[file: 'plot_metric2.csv']], group: 'Measures', title: 'Metric 2', style: 'line', yaxis: 'Metric 2'
echo 'Pipeline run completed.'
} // steps
} // stage
// stage('Data Collection') {
// steps {
// echo 'Starting data collection.'
// sh '''
// cd 01_data_collection
// python3 collect_from_kafka.py
// '''
// echo 'Data collection completed.'
// } // steps
// } // stage
//
// stage('Data Clean') {
// steps {
// echo 'Starting data clean.'
// sh '''
// cd 02_data_clean
// python3 clean_data.py
// '''
// echo 'Data clean completed.'
// } // steps
// }
//
// stage('Data Quality Check') {
// steps {
// echo 'Starting data quality check.'
// sh '''
// cd 03_data_quality
// python3 data_quality_check.py
//
// '''
// echo 'Data quality check completed.'
// } // steps
// } // stage
// stage('Train Model and Evaluate') {
// steps {
// echo 'Start model training and evaluation.'
// sh '''
// cd 04_model_training
// python3 collect_telemetry.py
// '''
// echo 'Model training and evaluation completed.'
// } // steps
// }
// stage("Collect Telemetry ") {
// steps {
// echo 'Start collecting telemetry data '
// sh '''
// cd 05_online_evaluation_and_telemetry
// python collect_telemetry.py
// '''
// echo 'Telemetry Collection Complete.'
// plot csvFileName: 'telemetry.csv', csvSeries: [[file: 'telemetry_logs11112020.csv']], group: 'Measures', title: 'Online Metric 1', style: 'line', yaxis: 'Metric 1'
// } // steps
} // stages
}