-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
164 lines (146 loc) · 5.39 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
stages: # List of stages for jobs, and their order of execution
- build
- test
- deploy
# .default_rules:
# rules:
# - if: $CI_COMMIT_BRANCH == "main"
build-traffic:
# image: $DOCKER_BUILD_IMAGE
stage: build
script:
- cd external/traffic
- source build.env
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $CI_REGISTRY_IMAGE/traffic:latest -t $CI_REGISTRY_IMAGE/traffic:$VERSION -f ./Dockerfile .
- docker push $CI_REGISTRY_IMAGE/traffic:latest
- docker push $CI_REGISTRY_IMAGE/traffic:$VERSION
tags:
- docker
rules:
- changes:
- /external/traffic/**
build-aggregator: # This job runs in the build stage, which runs first.
# image: $DOCKER_BUILD_IMAGE
stage: build
script:
- cd external/aggregator
- source build.env
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $CI_REGISTRY_IMAGE/aggregator:latest -t $CI_REGISTRY_IMAGE/aggregator:$VERSION -f ./Dockerfile .
- docker push $CI_REGISTRY_IMAGE/aggregator:latest
- docker push $CI_REGISTRY_IMAGE/aggregator:$VERSION
tags:
- docker
rules:
- changes:
- external/aggregator/**
# XXX should this even be build here or should this be the stock datafev image?
build-datafev: # This job runs in the build stage, which runs first.
# image: $DOCKER_BUILD_IMAGE
stage: build
script:
- cd external/aggregator
- source build.env
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $CI_REGISTRY_IMAGE/datafev:latest -t $CI_REGISTRY_IMAGE/datafev:$VERSION -f ./Dockerfile .
- docker push $CI_REGISTRY_IMAGE/datafev:latest
- docker push $CI_REGISTRY_IMAGE/datafev:$VERSION
tags:
- docker
rules:
- changes:
- external/datafev/**
build-event_manager: # This job runs in the build stage, which runs first.
# image: $DOCKER_BUILD_IMAGE
stage: build
script:
- cd external/aggregator
- source build.env
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $CI_REGISTRY_IMAGE/event_manager:latest -t $CI_REGISTRY_IMAGE/event_manager:$VERSION -f ./Dockerfile .
- docker push $CI_REGISTRY_IMAGE/event_manager:latest
- docker push $CI_REGISTRY_IMAGE/event_manager:$VERSION
tags:
- docker
rules:
- changes:
- external/event_manager/**
build-coordinator: # This job runs in the build stage, which runs first.
# image: $DOCKER_BUILD_IMAGE
stage: build
script:
- cd sogno/coordinator
- source build.env
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $CI_REGISTRY_IMAGE/coordinator:latest -t $CI_REGISTRY_IMAGE/coordinator:$VERSION -f ./Dockerfile .
- docker push $CI_REGISTRY_IMAGE/coordinator:latest
- docker push $CI_REGISTRY_IMAGE/coordinator:$VERSION
tags:
- docker
rules:
- changes:
- sogno/coordinator/**
build-connector: # This job runs in the build stage, which runs first.
# image: $DOCKER_BUILD_IMAGE
stage: build
script:
- cd sogno/connector
- source build.env
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $CI_REGISTRY_IMAGE/connector:latest -t $CI_REGISTRY_IMAGE/connector:$VERSION -f ./Dockerfile .
- docker push $CI_REGISTRY_IMAGE/connector:latest
- docker push $CI_REGISTRY_IMAGE/connector:$VERSION
tags:
- docker
rules:
- changes:
- sogno/connector/**
build-routing: # This job runs in the build stage, which runs first.
# image: $DOCKER_BUILD_IMAGE
stage: build
script:
- cd sogno/optimizer
- source build.env
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $CI_REGISTRY_IMAGE/routing:latest -t $CI_REGISTRY_IMAGE/routing:$VERSION -f ./Dockerfile .
- docker push $CI_REGISTRY_IMAGE/routing:latest
- docker push $CI_REGISTRY_IMAGE/routing:$VERSION
tags:
- docker
rules:
- changes:
- sogno/optimizer/**
build-api: # This job runs in the build stage, which runs first.
# image: $DOCKER_BUILD_IMAGE
stage: build
script:
- cd sogno/api
- source build.env
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $CI_REGISTRY_IMAGE/api:latest -t $CI_REGISTRY_IMAGE/api:$VERSION -f ./Dockerfile .
- docker push $CI_REGISTRY_IMAGE/api:latest
- docker push $CI_REGISTRY_IMAGE/api:$VERSION
tags:
- docker
rules:
- changes:
- sogno/api/**
# unit-test-job: # This job runs in the test stage.
# stage: test # It only starts when the job in the build stage completes successfully.
# script:
# - echo "Running unit tests... This will take about 60 seconds."
# - sleep 60
# - echo "Code coverage is 90%"
# lint-test-job: # This job also runs in the test stage.
# stage: test # It can run at the same time as unit-test-job (in parallel).
# script:
# - echo "Linting code... This will take about 10 seconds."
# - sleep 10
# - echo "No lint issues found."
# deploy-job: # This job runs in the deploy stage.
# stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
# environment: production
# script:
# - echo "Deploying application..."
# - echo "Application successfully deployed."