forked from smari/wasa2il
-
Notifications
You must be signed in to change notification settings - Fork 16
/
.gitlab-ci.yml
63 lines (55 loc) · 1.25 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
image: docker:git
services:
- docker:dind
stages:
- build
- test
- deploy
- release
variables:
CONTAINER_RELEASE_IMAGE: registry.gitlab.com/piratar/wasa2il/image:latest
build:
stage: build
image: python:2-onbuild
script:
- echo "This is where we build it..."
test:
stage: test
image: python:2-onbuild
script:
- pip install -r requirements.txt
- coverage run --source=. manage.py test -v 2
- coverage html
- flake8 --htmldir reports/flake8 --format=html -v
artifacts:
paths:
- reports/
pages:
stage: deploy
script:
- mv reports/ public/
artifacts:
paths:
- public
staging:
stage: deploy
only:
- master
script:
- git remote add heroku https://heroku:[email protected]/wasa2il-staging.git
- git push -f heroku HEAD:master
development:
stage: deploy
only:
- development
script:
- git remote add heroku https://heroku:[email protected]/wasa2il-development.git
- git push -f heroku HEAD:master
release-image:
stage: release
only:
- tags
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
- docker build -t $CONTAINER_RELEASE_IMAGE .
- docker push $CONTAINER_RELEASE_IMAGE