-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
179 lines (168 loc) · 6.26 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
image: registry.gitlab.com/castlecraft/docker-craft/node-latest-headless-chrome:latest
services:
- docker:dind
- mongo
- redis
stages:
- tests
- pack
- docs
test_backend:
stage: tests
variables:
SESSION_SECRET: "secret"
EXPIRY_DAYS: "1"
COOKIE_MAX_AGE: "43200"
TOKEN_VALIDITY: "3600"
SESSION_NAME: "E2E_SESSION"
DB_HOST: "mongo"
DB_NAME: "test-e2e-idp"
BULL_QUEUE_REDIS_HOST: redis
BULL_QUEUE_REDIS_PORT: "6379"
before_script:
- npm install -g lerna
- yarn
- lerna clean -y
- lerna bootstrap
script:
# Create .env file
- dockerize -template apps/authorization-server/docker/env.tmpl:apps/authorization-server/.env
- lerna run lint
- lerna run format:check
- yarn test
- lerna run test:e2e --stream
tags:
- docker
test_frontend:
stage: tests
before_script:
- npm install -g lerna
- yarn
- lerna clean -y
- lerna bootstrap
script:
# Launch Xvfb
- Xvfb :0 -ac -screen 0 1024x768x24 &
# Export display for Chrome
- export DISPLAY=:99
- export NODE_ENV=test && lerna run e2e --stream --concurrency 1
- export NODE_ENV=test && lerna run test:client --stream --concurrency 1
tags:
- docker
pack_staging_authorization_server:
image: docker
stage: pack
environment: staging
only:
- staging
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
script:
# get latest tag for app in staging branchs
# Authorization Server
- export ASVERSION=$(echo $CI_COMMIT_SHA | cut -c1-7)
- docker build -t authorization-server apps/authorization-server
- docker tag authorization-server $CI_REGISTRY/$CI_PROJECT_NAMESPACE/building-blocks/authorization-server:$ASVERSION
- docker tag authorization-server $CI_REGISTRY/$CI_PROJECT_NAMESPACE/building-blocks/authorization-server:latest
- docker push $CI_REGISTRY/$CI_PROJECT_NAMESPACE/building-blocks/authorization-server
pack_staging_identity_provider:
image: docker
stage: pack
environment: staging
only:
- staging
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
script:
# get latest tag for app in staging branchs
# Identity Provider
- export IDPVERSION=$(echo $CI_COMMIT_SHA | cut -c1-7)
- docker build -t identity-provider apps/identity-provider
- docker tag identity-provider $CI_REGISTRY/$CI_PROJECT_NAMESPACE/building-blocks/identity-provider:$IDPVERSION
- docker tag identity-provider $CI_REGISTRY/$CI_PROJECT_NAMESPACE/building-blocks/identity-provider:latest
- docker push $CI_REGISTRY/$CI_PROJECT_NAMESPACE/building-blocks/identity-provider
pack_staging_infrastructure_console:
image: docker
stage: pack
environment: staging
only:
- staging
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
script:
# get latest tag for app in staging branchs
# Infrastructure Console
- export ICVERSION=$(echo $CI_COMMIT_SHA | cut -c1-7)
- docker build -t infrastructure-console apps/infrastructure-console
- docker tag infrastructure-console $CI_REGISTRY/$CI_PROJECT_NAMESPACE/building-blocks/infrastructure-console:$ICVERSION
- docker tag infrastructure-console $CI_REGISTRY/$CI_PROJECT_NAMESPACE/building-blocks/infrastructure-console:latest
- docker push $CI_REGISTRY/$CI_PROJECT_NAMESPACE/building-blocks/infrastructure-console
pack_production_authorization_server:
image: docker
stage: pack
environment: production
only:
- master
before_script:
- apk add git
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
script:
# get latest tag for app in master branchs
# Authorization Server
- export ASVERSION=$(git tag --list "authorization-server@*" --sort=-version:refname | sed -n 1p | sed -e 's#.*@\(\)#\1#')
- docker build -t authorization-server apps/authorization-server
- docker tag authorization-server $CI_REGISTRY/$CI_PROJECT_NAMESPACE/building-blocks/authorization-server:$ASVERSION
- docker tag authorization-server $CI_REGISTRY/$CI_PROJECT_NAMESPACE/building-blocks/authorization-server:latest
- docker push $CI_REGISTRY/$CI_PROJECT_NAMESPACE/building-blocks/authorization-server
pack_production_identity_provider:
image: docker
stage: pack
environment: production
only:
- master
before_script:
- apk add git
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
script:
# get latest tag for app in master branchs
# Idenitiy Provider
- export IDPVERSION=$(git tag --list "identity-provider@*" --sort=-version:refname | sed -n 1p | sed -e 's#.*@\(\)#\1#')
- docker build -t identity-provider apps/identity-provider
- docker tag identity-provider $CI_REGISTRY/$CI_PROJECT_NAMESPACE/building-blocks/identity-provider:$IDPVERSION
- docker tag identity-provider $CI_REGISTRY/$CI_PROJECT_NAMESPACE/building-blocks/identity-provider:latest
- docker push $CI_REGISTRY/$CI_PROJECT_NAMESPACE/building-blocks/identity-provider
pack_production_infrastructure_console:
image: docker
stage: pack
environment: production
only:
- master
before_script:
- apk add git
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
script:
# get latest tag for app in master branchs
# Infrastructure Console
- export ICVERSION=$(git tag --list "infrastructure-console@*" --sort=-version:refname | sed -n 1p | sed -e 's#.*@\(\)#\1#')
- docker build -t infrastructure-console apps/infrastructure-console
- docker tag infrastructure-console $CI_REGISTRY/$CI_PROJECT_NAMESPACE/building-blocks/infrastructure-console:$ICVERSION
- docker tag infrastructure-console $CI_REGISTRY/$CI_PROJECT_NAMESPACE/building-blocks/infrastructure-console:latest
- docker push $CI_REGISTRY/$CI_PROJECT_NAMESPACE/building-blocks/infrastructure-console
pages:
stage: docs
before_script:
- npm install -g lerna
- yarn
- lerna clean -y
- lerna bootstrap
script:
- npm install gitbook-cli -g
- npm install typedoc -g
# - gitbook fetch latest # fetch latest stable version
# - gitbook install # add any requested plugins in book.json
- gitbook build docs public # build to public path
- yarn docs
artifacts:
paths:
- public
expire_in: 4 weeks