-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
68 lines (59 loc) · 1.77 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
58
59
60
61
62
63
64
65
66
67
# This file is a template, and might need editing before it works on your project.
# Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/python
# image: python:latest
image: docker
# Pick zero or more services to be used on all builds.
# Only needed when using a docker container to run your tests in.
# Check out: http://docs.gitlab.com/ce/ci/docker/using_docker_images.html#what-is-a-service
services:
- docker:dind
- postgres:latest
stages:
- test
- build
- deploy
test:
stage: test
script:
- apk add --no-cache py-pip python-dev libffi-dev openssl-dev gcc libc-dev make
- pip install docker-compose
- docker-compose -f local.yml build
- rm ./app/migrations/*
- docker-compose -f local.yml run --rm django flake8 --exclude=__init__.py
- docker-compose -f local.yml run --rm django ./manage.py test
- docker-compose -f local.yml run --rm django python3 manage.py makemigrations
- docker-compose -f local.yml run --rm django python3 manage.py migrate
build:
stage: build
script:
- apk add --no-cache py-pip python-dev libffi-dev openssl-dev gcc libc-dev make
- pip install docker-compose
- docker-compose -f local.yml build
.release:
stage: deploy
script:
- apk add --no-cache py-pip python-dev libffi-dev openssl-dev gcc libc-dev make
dependencies:
- build
release_development:
extends: .release
environment:
name: development
url: https://arbc-dev.herokuapp.com/
only:
- develop
release_staging:
extends: .release
environment:
name: staging
url: https://arbc-stg.herokuapp.com/
only:
- develop
release_production:
extends: .release
environment:
name: production
url: https://arbc-app.herokuapp.com/
only:
- master