Add Jenkinsfile
This commit is contained in:
parent
a10a9c61ba
commit
8e4f5f89b0
1 changed files with 44 additions and 0 deletions
44
Jenkinsfile
vendored
Normal file
44
Jenkinsfile
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
pipeline {
|
||||||
|
agent docker { image 'python:alpine3.22' }
|
||||||
|
stages {
|
||||||
|
stage('Pre-build') {
|
||||||
|
steps {
|
||||||
|
sh 'python3 -m venv venv'
|
||||||
|
sh 'source venv/bin/activate'
|
||||||
|
sh 'pip3 --version'
|
||||||
|
sh 'pip install -r requirements.txt'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Test') {
|
||||||
|
steps {
|
||||||
|
sh 'pytest test_app.py'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Containerization') {
|
||||||
|
steps {
|
||||||
|
sh 'echo Docker Build Image..'
|
||||||
|
sh 'echo Docker Tag Image....'
|
||||||
|
sh 'echo Docker Push Image......'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Run-and-test') {
|
||||||
|
steps {
|
||||||
|
sh 'python app.py &'
|
||||||
|
sh
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Integration Testing') {
|
||||||
|
steps {
|
||||||
|
sh "sleep 10s"
|
||||||
|
sh 'echo Testing using cURL commands......'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tools {
|
||||||
|
maven 'M398'
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue