Skip to content

Commit df76a84

Browse files
Add Jenkinsfile for CI/CD pipeline
1 parent d262151 commit df76a84

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

pipeline/Jenkinsfile

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
pipeline {
2+
agent any // Run on any available agent
3+
4+
stages {
5+
stage('Checkout Code') {
6+
steps {
7+
// Checkout the code from the repository
8+
checkout scm
9+
}
10+
}
11+
12+
stage('Set Up Python') {
13+
steps {
14+
// Set up Python environment
15+
sh 'python3 -m venv venv'
16+
sh '. venv/bin/activate && pip install -r requirements.txt'
17+
}
18+
}
19+
20+
stage('Run Tests') {
21+
steps {
22+
// Run pytest and generate HTML report
23+
sh '. venv/bin/activate && pytest -v -s --html=reports/Test_Execution_Report.html'
24+
}
25+
}
26+
}
27+
28+
post {
29+
always {
30+
// Archive test reports
31+
archiveArtifacts artifacts: 'reports/Test_Execution_Report.html', fingerprint: true
32+
}
33+
}
34+
}

0 commit comments

Comments
 (0)