-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
113 lines (102 loc) · 1.9 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
image: centos:7
stages:
- build
- test
- review
- staging
- production
- cleanup
variables:
EURYSPACE_CI_SERVER: sources.euryecetelecom.com
EURYSPACE_DOMAIN: euryspace.org
build:
stage: build
image: docker:git
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
script:
- setup_docker
test:
stage: test
image: gliderlabs/herokuish:latest
before_script: []
script:
- echo run tests
only:
- branches
codequality:
image: docker:latest
variables:
DOCKER_DRIVER: overlay2
allow_failure: true
services:
- docker:dind
script:
- setup_docker
- codeclimate
artifacts:
paths: [codeclimate.json]
.deploy: &deploy
script:
- echo deploy
review:
<<: *deploy
stage: review
variables:
APP: review-$CI_COMMIT_REF_NAME
APP_HOST: $CI_PROJECT_NAME-$CI_ENVIRONMENT_SLUG.$EURYSPACE_DOMAIN
script:
- echo review
environment:
name: review/$CI_COMMIT_REF_NAME
url: https://$CI_PROJECT_NAME-$CI_ENVIRONMENT_SLUG.$EURYSPACE_DOMAIN
on_stop: stop-review
only:
- branches
except:
- master
stop-review:
<<: *deploy
stage: cleanup
script:
- echo cleanup
when: manual
variables:
APP: review-$CI_COMMIT_REF_NAME
GIT_STRATEGY: none
environment:
name: review/$CI_COMMIT_REF_NAME
action: stop
only:
- branches
except:
- master
staging:
<<: *deploy
stage: staging
script:
- echo staging
variables:
APP: staging
APP_HOST: $CI_PROJECT_NAME-staging.$EURYSPACE_DOMAIN
environment:
name: staging
url: https://$CI_PROJECT_NAME-staging.$EURYSPACE_DOMAIN
only:
- master
production:
<<: *deploy
stage: production
script:
- echo production
variables:
APP: production
APP_HOST: $CI_PROJECT_NAME.$EURYSPACE_DOMAIN
when: manual
environment:
name: production
url: https://$CI_PROJECT_NAME.$EURYSPACE_DOMAIN
only:
- master