-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
57 lines (55 loc) · 1.48 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
pipeline {
environment {
SECRET_KEY = credentials('flaim-secret-key')
FLAIM_DB_USER = credentials('flaim-db-user')
FLAIM_DB_PASSWORD = credentials('flaim-db-password')
REDIS_PASSWORD = credentials('flaim-redis-password')
POSTGRESQL_URL = credentials('flaim-postgresql-url')
DEBUG = 'on'
}
agent none
stages {
stage('build') {
agent {
docker {
image 'python:3.7-slim-buster'
args '--user 0:0'
}
}
steps {
sh '''
python3 -m venv ./venv
source ./venv/bin/activate
pip install -r requirements/local.txt
'''
}
}
stage('database') {
agent {
docker {
image 'postgres:10.12'
args '-p 5433:5432 -v /var/run/postgresql:/var/run/postgresql -d -t postgres'
}
}
steps {
sh '''
echo "mounted postgres"
'''
}
}
stage('test') {
agent {
docker {
image 'python:3.7-slim-buster'
args '--user 0:0'
}
}
steps {
sh '''
source ./venv/bin/activate
pytest
'''
}
}
}
}