-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
39 lines (35 loc) · 899 Bytes
/
.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
stages:
- build
- test
- staging
- deploy
build:
stage: build
script:
- docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA .
test:
stage: test
script:
- docker run -e MODE='testing' $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA python manage.py test
staging:
stage: staging
before_script:
- apk update && apk add gettext
script:
- rm -f docker-compose.yml
- envsubst < deployment/docker-compose.staging.template.yml > docker-compose.yml
- docker stack deploy --compose-file docker-compose.yml karino_api_staging
only:
- master
when: manual
deploy:
stage: deploy
before_script:
- apk update && apk add gettext
script:
- rm -f docker-compose.yml
- envsubst < deployment/docker-compose.template.yml > docker-compose.yml
- docker stack deploy --compose-file docker-compose.yml karino_api
only:
- master
when: manual