add build and test django in Jenkinsfile
This commit is contained in:
commit
ef8aeaab20
19
Jenkinsfile
vendored
19
Jenkinsfile
vendored
@ -1,17 +1,16 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent { docker { image 'python:3.7.2' } }
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Build') {
|
stage('Build and test') {
|
||||||
steps {
|
steps {
|
||||||
sh 'cd rest-app'
|
sh 'pwd'
|
||||||
sh 'pip3 install -r requirements.txt'
|
sh 'ls'
|
||||||
}
|
dir("${env.WORKSPACE}/rest-app"){
|
||||||
}
|
sh 'pwd'
|
||||||
stage('Test') {
|
sh 'ls'
|
||||||
steps {
|
sh 'python3 -m venv venv && . venv/bin/activate && pip3 install -r requirements.txt && python3 manage.py migrate && python3 manage.py test'
|
||||||
sh 'cd rest-app'
|
}
|
||||||
sh 'python3 manage.py test'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user