Create Jenkinsfile

This commit is contained in:
JanhviDahake 2025-07-11 20:31:31 +05:30 committed by GitHub
parent 85c5d93cbd
commit ec46ba1ed2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

33
src/flask/Jenkinsfile vendored Normal file
View file

@ -0,0 +1,33 @@
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Installing dependencies...'
sh 'python3 -m venv venv && source venv/bin/activate && pip install -r requirements.txt'
}
}
stage('Test') {
steps {
echo 'Running tests...'
sh 'source venv/bin/activate && pytest test_app.py'
}
}
stage('Deploy') {
steps {
echo 'Deploying the Flask app...'
sh 'source venv/bin/activate && nohup python app.py &'
}
}
}
post {
success {
echo "Build and deployment succeeded!"
}
failure {
echo "Build failed. Please check the console output."
}
}
}