-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
38 lines (36 loc) · 822 Bytes
/
.gitlab-ci.yml
File metadata and controls
38 lines (36 loc) · 822 Bytes
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
stages:
- test
- deploy
test_api:
image: python:3.7-stretch
variables:
POSTGRES_PASSWORD: MyPassword01
POSTGRES_USER: postgres
POSTGRES_DB: portal_to_work
CELERY_BROKER_URL: redis://localhost:6379/0
only:
- dev
- web
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- ~/.cache/pip/
services:
- postgres:11.4
stage: test
script:
- export DATABASE_URL=postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@postgres:5432/$POSTGRES_DB
- pip3 install -r requirements/local.txt
- coverage run -m pytest
- coverage report -m
production:
only:
- tags
- web
- master
stage: deploy
script:
- apt-get update -qy
- apt-get install -y ruby-dev
- gem install dpl
- dpl --provider=heroku --app=portaltowork --api-key=$HEROKU_PRODUCTION_API_KEY