forked from chayxana/Restaurant-App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
executable file
·173 lines (155 loc) · 3.58 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
services:
- docker:dind
stages:
- build
- test
- deploy
variables:
IMAGE_BASE_NAME: registry.gitlab.com/jurabek/restaurant-app
DOCKER_DRIVER: overlay2
# .before_script_docker_login: &login_to_docker
# before_script:
# - docker login registry.gitlab.com -u "$DOCKER_USER_NAME" -p $DOCKER_PASSWORD
before_script:
- apk add --update curl
- apk add --update git
- apk add curl jq python py-pip
- pip --cache-dir=pip_cache install awscli
- export GRADLE_USER_HOME=$(pwd)/.gradle
- export NUGET_PACKAGES=$(pwd)/.nuget
- export GOPATH=$(pwd)/go
- cd src/Server/
- chmod -R +x ci/
build:gateway_api:
stage: build
image: openjdk:8-jdk-alpine
script:
- ci/build.sh gateway_api
cache:
key: gradle-cache
paths:
- .gradle/wrapper
- .gradle/caches
policy: pull
build:service_discovery:
stage: build
image: openjdk:8-jdk-alpine
script:
- ci/build.sh service_discovery
cache:
key: gradle-cache
paths:
- .gradle/wrapper
- .gradle/caches
policy: pull
build:basket_api:
image: golang:1.11-alpine
stage: build
script:
- ci/update_build_badge.sh running basket_api
- echo "failure" > basket_status.txt #https://gitlab.com/gitlab-org/gitlab-runner/issues/3088
- ci/build.sh basket_api
- echo "success" > basket_status.txt
after_script:
- echo "Printing basket status from export"
- cd src/Server/
- ci/update_build_badge.sh `cat basket_status.txt` basket_api
cache:
key: go-cache
paths:
- go
build:order_api:
image: openjdk:8-jdk-alpine
stage: build
script:
- ci/update_build_badge.sh running order_api
- echo "failure" > order_status.txt
- ci/build.sh order_api
- echo "success" > order_status.txt
after_script:
- cd src/Server/
- ci/update_build_badge.sh `cat order_status.txt` order_api
cache:
key: gradle-cache
paths:
- .gradle/wrapper
- .gradle/caches
build:identity_api:
image: microsoft/dotnet:2.2-sdk-alpine
stage: build
script:
- ci/update_build_badge.sh running identity_api
- echo "failure" > identity_status.txt
- ci/build.sh identity_api
- echo "success" > identity_status.txt
after_script:
- cd src/Server/
- ci/update_build_badge.sh `cat identity_status.txt` identity_api
cache:
key: dotnet-cache
paths:
- .nuget/
build:menu_api:
image: microsoft/dotnet:2.1-sdk-alpine
stage: build
script:
- ci/update_build_badge.sh running menu_api
- echo "failure" > menu_status.txt
- ci/build.sh menu_api
- echo "success" > menu_status.txt
after_script:
- cd src/Server/
- ci/update_build_badge.sh `cat menu_status.txt` menu_api
cache:
key: dotnet-cache
paths:
- .nuget/
test:basket_api:
image: golang:1.11-alpine
stage: test
script:
- ci/test.sh basket_api
dependencies:
- build:basket_api
cache:
key: go-cache
policy: pull
paths:
- go
test:identity_api:
image: microsoft/dotnet:2.2-sdk-alpine
stage: test
script:
- ci/test.sh identity_api
dependencies:
- build:identity_api
cache:
key: dotnet-cache
policy: pull
paths:
- .nuget/
test:menu_api:
image: microsoft/dotnet:2.1-sdk-alpine
stage: test
script:
- ci/test.sh menu_api
dependencies:
- build:menu_api
cache:
key: dotnet-cache
policy: pull
paths:
- .nuget/
test:order_api:
image: openjdk:8-jdk-alpine
stage: test
script:
- ci/test.sh order_api
dependencies:
- build:order_api
cache:
key: gradle-cache
policy: pull
paths:
- .gradle/wrapper
- .gradle/caches