-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
385 lines (311 loc) · 19.8 KB
/
Makefile
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
SHELL=/bin/bash -o pipefail
BUILD_PRINT = \e[1;34mSTEP:
END_BUILD_PRINT = \e[0m
CURRENT_UID := $(shell id -u)
export CURRENT_UID
# These are constants used for make targets so we can start prod and staging services on the same machine
ENV_FILE := .env
# include .env files if they exist
-include .env
PROJECT_PATH = $(shell pwd)
AIRFLOW_INFRA_FOLDER ?= ${PROJECT_PATH}/.airflow
RML_MAPPER_PATH = ${PROJECT_PATH}/.rmlmapper/rmlmapper.jar
XML_PROCESSOR_PATH = ${PROJECT_PATH}/.saxon/saxon-he-10.6.jar
HOSTNAME = $(shell hostname)
#-----------------------------------------------------------------------------
# Dev commands
#-----------------------------------------------------------------------------
install:
@ echo -e "$(BUILD_PRINT)Installing the requirements$(END_BUILD_PRINT)"
@ python -m pip install --upgrade pip
@ python -m pip install --no-cache-dir -r requirements.txt --force-reinstall --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.5.1/constraints-no-providers-3.8.txt"
install-dev:
@ echo -e "$(BUILD_PRINT)Installing the dev requirements$(END_BUILD_PRINT)"
@ python -m pip install --upgrade pip
@ python -m pip install --no-cache-dir -r requirements.dev.txt --user --force-reinstall --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.5.1/constraints-no-providers-3.8.txt"
test: test-unit
test-unit:
@ echo -e "$(BUILD_PRINT)Unit Testing ...$(END_BUILD_PRINT)"
@ tox -e unit
test-features:
@ echo -e "$(BUILD_PRINT)Gherkin Features Testing ...$(END_BUILD_PRINT)"
@ tox -e features
test-e2e:
@ echo -e "$(BUILD_PRINT)End to End Testing ...$(END_BUILD_PRINT)"
@ tox -e e2e
test-all-parallel:
@ echo -e "$(BUILD_PRINT)Complete Testing ...$(END_BUILD_PRINT)"
@ tox -p
test-all:
@ echo -e "$(BUILD_PRINT)Complete Testing ...$(END_BUILD_PRINT)"
@ tox
build-externals:
@ echo -e "$(BUILD_PRINT)Creating the necessary volumes, networks and folders and setting the special rights"
@ docker network create proxy-net || true
@ docker network create common-ext-${ENVIRONMENT} || true
#-----------------------------------------------------------------------------
# SERVER SERVICES
#-----------------------------------------------------------------------------
start-traefik: build-externals
@ echo -e "$(BUILD_PRINT)Starting the Traefik services $(END_BUILD_PRINT)"
@ docker-compose --file ./infra/traefik/docker-compose.yml --env-file ${ENV_FILE} up -d
stop-traefik:
@ echo -e "$(BUILD_PRINT)Stopping the Traefik services $(END_BUILD_PRINT)"
@ docker-compose --file ./infra/traefik/docker-compose.yml --env-file ${ENV_FILE} down
#-----------------------------------------------------------------------------
# temporary
start-metabase: build-externals
@ echo -e "$(BUILD_PRINT)Starting the Metabase services $(END_BUILD_PRINT)"
@ docker-compose -p metabase-${ENVIRONMENT} --file ./infra/metabase/docker-compose.yml --env-file ${ENV_FILE} up -d
stop-metabase:
@ echo -e "$(BUILD_PRINT)Stopping the Metabase services $(END_BUILD_PRINT)"
@ docker-compose -p metabase-${ENVIRONMENT} --file ./infra/metabase/docker-compose.yml --env-file ${ENV_FILE} down
#-----------------------------------------------------------------------------
# PROJECT SERVICES
#-----------------------------------------------------------------------------
create-env-airflow:
@ echo -e "$(BUILD_PRINT) Create Airflow env $(END_BUILD_PRINT)"
@ echo -e "$(BUILD_PRINT) ${AIRFLOW_INFRA_FOLDER} ${ENVIRONMENT} $(END_BUILD_PRINT)"
@ mkdir -p ${AIRFLOW_INFRA_FOLDER}/logs ${AIRFLOW_INFRA_FOLDER}/plugins
@ ln -s -f ${PROJECT_PATH}/.env ${AIRFLOW_INFRA_FOLDER}/.env
@ ln -s -f -n ${PROJECT_PATH}/dags ${AIRFLOW_INFRA_FOLDER}/dags
@ ln -s -f -n ${PROJECT_PATH}/ted_data_eu ${AIRFLOW_INFRA_FOLDER}/ted_data_eu
@ chmod 777 ${AIRFLOW_INFRA_FOLDER}/logs ${AIRFLOW_INFRA_FOLDER}/plugins ${AIRFLOW_INFRA_FOLDER}/.env
@ cp requirements.txt ./infra/airflow/
create-env-airflow-cluster:
@ echo -e "$(BUILD_PRINT) Create Airflow env $(END_BUILD_PRINT)"
@ echo -e "$(BUILD_PRINT) ${AIRFLOW_INFRA_FOLDER} ${ENVIRONMENT} $(END_BUILD_PRINT)"
@ mkdir -p ${AIRFLOW_INFRA_FOLDER}/logs ${AIRFLOW_INFRA_FOLDER}/plugins ${AIRFLOW_INFRA_FOLDER}/.env
@ ln -s -f -n ${PROJECT_PATH}/dags ${AIRFLOW_INFRA_FOLDER}/dags
@ ln -s -f -n ${PROJECT_PATH}/ted_data_eu ${AIRFLOW_INFRA_FOLDER}/ted_data_eu
@ chmod 777 ${AIRFLOW_INFRA_FOLDER}/logs ${AIRFLOW_INFRA_FOLDER}/plugins ${AIRFLOW_INFRA_FOLDER}/.env
@ cp requirements.txt ./infra/airflow-cluster/
build-airflow: guard-ENVIRONMENT create-env-airflow build-externals
@ echo -e "$(BUILD_PRINT) Build Airflow services $(END_BUILD_PRINT)"
@ docker build -t meaningfy/airflow ./infra/airflow/
@ docker-compose -p ${ENVIRONMENT} --file ./infra/airflow/docker-compose.yaml --env-file ${ENV_FILE} up -d --force-recreate
start-airflow: build-externals
@ echo -e "$(BUILD_PRINT)Starting Airflow services $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/airflow/docker-compose.yaml --env-file ${ENV_FILE} up -d
stop-airflow:
@ echo -e "$(BUILD_PRINT)Stopping Airflow services $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/airflow/docker-compose.yaml --env-file ${ENV_FILE} down
build-airflow-cluster: guard-ENVIRONMENT create-env-airflow-cluster build-externals
@ echo -e "$(BUILD_PRINT) Build Airflow Common Image $(END_BUILD_PRINT)"
@ docker build -t meaningfy/airflow ./infra/airflow-cluster/
start-airflow-master: build-externals
@ echo -e "$(BUILD_PRINT)Starting Airflow Master $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/airflow-cluster/docker-compose.yaml --env-file ${ENV_FILE} up -d --force-recreate
start-airflow-worker: build-externals
@ echo -e "$(BUILD_PRINT)Starting Airflow Worker $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/airflow-cluster/docker-compose-worker.yaml --env-file ${ENV_FILE} up -d
stop-airflow-master:
@ echo -e "$(BUILD_PRINT)Stopping Airflow Master $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/airflow-cluster/docker-compose.yaml --env-file ${ENV_FILE} down
stop-airflow-worker:
@ echo -e "$(BUILD_PRINT)Stopping Airflow Worker $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/airflow-cluster/docker-compose-worker.yaml --env-file ${ENV_FILE} down
restart-airflow-master: stop-airflow-master create-env-airflow-cluster
@ echo -e "$(BUILD_PRINT)Restart Airflow Master $(END_BUILD_PRINT)"
@ git pull
@ make build-airflow-cluster
@ make start-airflow-master
restart-airflow-worker: stop-airflow-worker create-env-airflow-cluster
@ echo -e "$(BUILD_PRINT)Restart Airflow Worker $(END_BUILD_PRINT)"
@ git pull
@ make build-airflow-cluster
@ make start-airflow-worker
start-allegro-graph: build-externals
@ echo -e "$(BUILD_PRINT)Starting Allegro-Graph services $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/allegro-graph/docker-compose.yml --env-file ${ENV_FILE} up -d
stop-allegro-graph:
@ echo -e "$(BUILD_PRINT)Stopping Allegro-Graph services $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/allegro-graph/docker-compose.yml --env-file ${ENV_FILE} down
# ------------------------
start-fuseki: build-externals
@ echo -e "$(BUILD_PRINT)Starting Fuseki services $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/fuseki/docker-compose.yml --env-file ${ENV_FILE} up -d
stop-fuseki:
@ echo -e "$(BUILD_PRINT)Stopping Fuseki services $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/fuseki/docker-compose.yml --env-file ${ENV_FILE} down
# ------------------------
start-sftp: build-externals
@ echo -e "$(BUILD_PRINT)Starting SFTP services $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/sftp/docker-compose.yml --env-file ${ENV_FILE} up -d
stop-sftp:
@ echo -e "$(BUILD_PRINT)Stopping SFTP services $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/sftp/docker-compose.yml --env-file ${ENV_FILE} down
start-minio: build-externals
@ echo -e "$(BUILD_PRINT)Starting the Minio services $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/minio/docker-compose.yml --env-file ${ENV_FILE} up -d
stop-minio:
@ echo -e "$(BUILD_PRINT)Stopping the Minio services $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/minio/docker-compose.yml --env-file ${ENV_FILE} down
start-postgres: build-externals
@ echo -e "$(BUILD_PRINT)Starting the Postgres services $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/postgres/docker-compose.yml --env-file ${ENV_FILE} up -d
stop-postgres:
@ echo -e "$(BUILD_PRINT)Stopping the Postgres services $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/postgres/docker-compose.yml --env-file ${ENV_FILE} down
# ------------------------
start-dash: build-externals
@ echo -e "$(BUILD_PRINT)Starting Dash services $(END_BUILD_PRINT)"
@ cp requirements.txt ./infra/dash/
@ cp -R ${PROJECT_PATH}/dash ./infra/dash
@ cp -R ${PROJECT_PATH}/dags/resources/sparql_queries ./infra/dash
@ docker-compose -p ${ENVIRONMENT} --file ./infra/dash/docker-compose.yml --env-file ${ENV_FILE} up -d --build
@ rm -r ./infra/dash/dash
@ rm -r ./infra/dash/sparql_queries
@ rm ./infra/dash/requirements.txt
stop-dash:
@ echo -e "$(BUILD_PRINT)Stopping Dash services $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/dash/docker-compose.yml --env-file ${ENV_FILE} down
init-limes:
@ echo -e "Limes folder initialisation!"
@ mkdir -p ./.limes
@ wget -c https://github.com/dice-group/LIMES/releases/download/1.7.9/limes.jar -P ./.limes
init-rml-mapper:
@ echo -e "RMLMapper folder initialisation!"
@ mkdir -p ./.rmlmapper
@ wget -c https://github.com/RMLio/rmlmapper-java/releases/download/v6.0.0/rmlmapper-6.0.0-r363-all.jar -O ./.rmlmapper/rmlmapper.jar
init-saxon:
@ echo -e "$(BUILD_PRINT)Saxon folder initialization $(END_BUILD_PRINT)"
@ wget -c https://kumisystems.dl.sourceforge.net/project/saxon/Saxon-HE/10/Java/SaxonHE10-6J.zip -P .saxon/
@ cd .saxon && unzip SaxonHE10-6J.zip && rm -rf SaxonHE10-6J.zip
start-common-project-services: | start-mongo start-sftp start-fuseki start-allegro-graph start-minio start-metabase start-graphdb start-elk
stop-common-project-services: | stop-mongo stop-sftp stop-fuseki stop-allegro-graph stop-minio stop-metabase stop-graphdb stop-elk
start-prod-project-services : | prod-dotenv-file create-env-airflow-cluster start-airflow-master start-common-project-services start-digest_service-api
stop-prod-project-services : | stop-airflow-master stop-common-project-services stop-digest_service-api
start-staging-project-services : | staging-dotenv-file create-env-airflow start-airflow start-common-project-services install-allure
stop-staging-project-services : | stop-airflow stop-common-project-services
start-dev-project-services : | dev-dotenv-file create-env-airflow start-airflow start-common-project-services
stop-dev-project-services : | stop-airflow stop-common-project-services
#-----------------------------------------------------------------------------
# VAULT SERVICES
#-----------------------------------------------------------------------------
# Testing whether an env variable is set or not
guard-%:
@ if [ "${${*}}" = "" ]; then \
echo -e "$(BUILD_PRINT)Environment variable $* not set $(END_BUILD_PRINT)"; \
exit 1; \
fi
# Testing that vault is installed
vault-installed: #; @which vault1 > /dev/null
@ if ! hash vault 2>/dev/null; then \
echo -e "$(BUILD_PRINT)Vault is not installed, refer to https://www.vaultproject.io/downloads $(END_BUILD_PRINT)"; \
exit 1; \
fi
# Get secrets in dotenv format
dev-dotenv-file: guard-VAULT_ADDR guard-VAULT_TOKEN vault-installed
@ echo -e "$(BUILD_PRINT)Create .env file $(END_BUILD_PRINT)"
@ echo VAULT_ADDR=${VAULT_ADDR} > .env
@ echo VAULT_TOKEN=${VAULT_TOKEN} >> .env
@ echo DOMAIN=localhost >> .env
@ echo ENVIRONMENT=dev >> .env
@ echo SUBDOMAIN= >> .env
@ echo RML_MAPPER_PATH=${RML_MAPPER_PATH} >> .env
@ echo XML_PROCESSOR_PATH=${XML_PROCESSOR_PATH} >> .env
@ echo AIRFLOW_INFRA_FOLDER=${AIRFLOW_INFRA_FOLDER} >> .env
@ echo AIRFLOW_WORKER_HOSTNAME=${HOSTNAME} >> .env
@ vault kv get -format="json" ted-data-dev/airflow | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-dev/mongo-db | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-dev/agraph | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-dev/metabase | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-dev/fuseki | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-dev/graphdb | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-dev/elk | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-dev/ted-sws | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-dev/postgres-db | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-dev/minio | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
staging-dotenv-file: guard-VAULT_ADDR guard-VAULT_TOKEN vault-installed
@ echo -e "$(BUILD_PRINT)Create .env file $(END_BUILD_PRINT)"
@ echo VAULT_ADDR=${VAULT_ADDR} > .env
@ echo VAULT_TOKEN=${VAULT_TOKEN} >> .env
@ echo DOMAIN=ted-data.eu >> .env
@ echo ENVIRONMENT=staging >> .env
@ echo SUBDOMAIN=staging. >> .env
@ echo RML_MAPPER_PATH=${RML_MAPPER_PATH} >> .env
@ echo XML_PROCESSOR_PATH=${XML_PROCESSOR_PATH} >> .env
@ echo AIRFLOW_INFRA_FOLDER=~/airflow-infra/ted-data-staging >> .env
@ echo AIRFLOW_WORKER_HOSTNAME=${HOSTNAME} >> .env
@ vault kv get -format="json" ted-data-dev/airflow | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-dev/mongo-db | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-dev/agraph | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-dev/metabase | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-dev/fuseki | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-dev/graphdb | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-dev/elk | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-dev/ted-sws | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-dev/postgres-db | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-dev/minio | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
prod-dotenv-file: guard-VAULT_ADDR guard-VAULT_TOKEN vault-installed
@ echo -e "$(BUILD_PRINT)Create .env file $(END_BUILD_PRINT)"
@ echo VAULT_ADDR=${VAULT_ADDR} > .env
@ echo VAULT_TOKEN=${VAULT_TOKEN} >> .env
@ echo DOMAIN=ted-data.eu >> .env
@ echo ENVIRONMENT=prod >> .env
@ echo SUBDOMAIN= >> .env
@ echo RML_MAPPER_PATH=${RML_MAPPER_PATH} >> .env
@ echo XML_PROCESSOR_PATH=${XML_PROCESSOR_PATH} >> .env
@ echo AIRFLOW_INFRA_FOLDER=~/airflow-infra/ted-data-prod >> .env
@ echo AIRFLOW_WORKER_HOSTNAME=${HOSTNAME} >> .env
@ echo AIRFLOW_CELERY_WORKER_CONCURRENCY=1 >> .env
@ vault kv get -format="json" ted-data-prod/airflow | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-prod/minio | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-prod/metabase | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-prod/mongo-db | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-prod/fuseki | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-prod/graphdb | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-prod/elk | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-prod/ted-sws | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-prod/postgres-db | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
@ vault kv get -format="json" ted-data-prod/agraph | jq -r ".data.data | keys[] as \$$k | \"\(\$$k)=\(.[\$$k])\"" >> .env
local-dotenv-file: rml-mapper-path-add-dotenv-file
rml-mapper-path-add-dotenv-file:
@ echo -e "$(BUILD_PRINT)Add rml-mapper path to local .env file $(END_BUILD_PRINT)"
@ sed -i '/^RML_MAPPER_PATH/d' .env
@ echo RML_MAPPER_PATH=${RML_MAPPER_PATH} >> .env
install-allure:
@ echo -e "Start install Allure commandline."
@ sudo apt -y install npm
@ sudo npm install -g allure-commandline
create-env-digest-api:
@ cp requirements.txt ./infra/digest_api/digest_service/project_requirements.txt
@ mkdir "temp" && cd temp && git clone https://github.com/OP-TED/ted-rdf-conversion-pipeline.git
@ cp -r temp/ted-rdf-conversion-pipeline/ted_sws ./infra/digest_api/
@ rm -rf temp
build-digest_service-api: create-env-digest-api
@ echo -e "$(BUILD_PRINT) Build digest_service API service $(END_BUILD_PRINT)"
@ docker-compose -p common --file infra/digest_api/docker-compose.yml --env-file ${ENV_FILE} build --no-cache --force-rm
@ rm -rf ./infra/digest_api/ted_sws || true
@ docker-compose -p common --file infra/digest_api/docker-compose.yml --env-file ${ENV_FILE} up -d --force-recreate
start-digest_service-api:
@ echo -e "$(BUILD_PRINT)Starting digest_service API service $(END_BUILD_PRINT)"
@ docker-compose -p common --file infra/digest_api/docker-compose.yml --env-file ${ENV_FILE} up -d
stop-digest_service-api:
@ echo -e "$(BUILD_PRINT)Stopping digest_service API service $(END_BUILD_PRINT)"
@ docker-compose -p common --file infra/digest_api/docker-compose.yml --env-file ${ENV_FILE} down
start-mongo: build-externals
@ echo -e "$(BUILD_PRINT)Starting the Mongo services $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/mongo/docker-compose.yml --env-file ${ENV_FILE} up -d
stop-mongo:
@ echo -e "$(BUILD_PRINT)Stopping the Mongo services $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/mongo/docker-compose.yml --env-file ${ENV_FILE} down
start-graphdb: build-externals
@ echo -e "$(BUILD_PRINT)Starting the GraphDB services $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/graphdb/docker-compose.yml --env-file ${ENV_FILE} up -d
stop-graphdb:
@ echo -e "$(BUILD_PRINT)Stopping the GraphDB services $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/graphdb/docker-compose.yml --env-file ${ENV_FILE} down
start-elk: build-externals
@ echo -e "$(BUILD_PRINT)Starting the ELK services $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/elk/docker-compose.yml --env-file ${ENV_FILE} up -d --build
stop-elk:
@ echo -e "$(BUILD_PRINT)Stopping the ELK services $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/elk/docker-compose.yml --env-file ${ENV_FILE} down
start-grafana: build-externals
@ echo -e "$(BUILD_PRINT)Starting the Grafana services $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/grafana/docker-compose.yml --env-file ${ENV_FILE} up -d
stop-grafana:
@ echo -e "$(BUILD_PRINT)Stopping the Grafana services $(END_BUILD_PRINT)"
@ docker-compose -p ${ENVIRONMENT} --file ./infra/grafana/docker-compose.yml --env-file ${ENV_FILE} down