Created Jenkinsfile
This commit is contained in:
parent
e531dec8fe
commit
f0e90a6b03
46
expenses_manager/Jenkinsfile
vendored
Normal file
46
expenses_manager/Jenkinsfile
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
pipeline{
|
||||
agent any
|
||||
|
||||
environment {
|
||||
DJANGO_SETTINGS_MODULE = "expenses_manager.settings"
|
||||
PYTHONUNBUFFERED = "1"
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
scm
|
||||
}
|
||||
}
|
||||
|
||||
stage('Setup Python') {
|
||||
steps {
|
||||
sh '''
|
||||
python --version
|
||||
python -m venv venv
|
||||
. venv/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('Run tests') {
|
||||
steps {
|
||||
sh '''
|
||||
. venv/bin/activate
|
||||
pytest --cov
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
echo 'Pipeline finished'
|
||||
}
|
||||
failure {
|
||||
echo 'Tests failed'
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user