-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
57 lines (49 loc) · 1.29 KB
/
.gitlab-ci.yml
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
image: alpine
services:
- postgres
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
POSTGRES_DB: project51_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
DATABASE_HOST: 'postgres:5432'
PROJECT_NAME: "project51"
DATABASE_URL: "postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@$DATABASE_HOST/$POSTGRES_DB"
TEST_DATABASE_URL: "postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@$DATABASE_HOST/$POSTGRES_DB"
FLASK_APP: 'run.py'
SOCKET_MODE: 'False'
cache:
paths:
- .cache/pip
- venv/
before_script:
- echo "ipv6" >> /etc/modules
- apk update
stages:
- codestyle
- test
- production
codestyle:
stage: codestyle
script:
- apk add py-virtualenv gcc python-dev musl-dev postgresql-dev
- virtualenv --python=python2.7 venv
- source venv/bin/activate
- pip install -r requirements.txt
- pylint application/
test:
stage: test
script:
- apk add py-virtualenv gcc python-dev musl-dev postgresql-dev make
- virtualenv --python=python2.7 venv
- source venv/bin/activate
- pip install -r requirements.txt
- nose2 -v
production:
stage: production
script:
- apk add ruby ruby-rdoc ruby-bundler ruby-irb git curl
- gem install dpl
- dpl --provider=heroku --app=$PROJECT_NAME --api-key=$HEROKU_API_KEY
only:
- master