7
7
#
8
8
# by sanderegg, pcrespov
9
9
.DEFAULT_GOAL := help
10
+ SHELL := /bin/bash
11
+
10
12
11
13
# TOOLS --------------------------------------
12
14
15
+ MAKE_C := $(MAKE ) --no-print-directory --directory
16
+
13
17
# Operating system
14
18
ifeq ($(filter Windows_NT,$(OS ) ) ,)
15
19
IS_WSL := $(if $(findstring Microsoft,$(shell uname -a) ) ,WSL,)
20
24
IS_WIN := $(strip $(if $(or $(IS_LINUX ) ,$(IS_OSX ) ,$(IS_WSL ) ) ,,$(OS ) ) )
21
25
$(if $(IS_WIN),$(error Windows is not supported in all recipes. Use WSL instead. Follow instructions in README.md),)
22
26
23
- SHELL := /bin/bash
24
27
25
28
# VARIABLES ----------------------------------------------
26
29
# TODO: read from docker-compose file instead $(shell find $(CURDIR)/services -type f -name 'Dockerfile')
@@ -88,7 +91,7 @@ ifeq ($(target),)
88
91
# Compiling front-end
89
92
90
93
@$(if $(findstring -kit,$@),export DOCKER_BUILDKIT=1;export COMPOSE_DOCKER_CLI_BUILD=1;,) \
91
- $(MAKE) -C services/web/client compile$(if $(findstring -x,$@),-x,)
94
+ $(MAKE_C) services/web/client compile$(if $(findstring -x,$@),-x,)
92
95
93
96
# Building services
94
97
@$(if $(findstring -kit,$@),export DOCKER_BUILDKIT=1;export COMPOSE_DOCKER_CLI_BUILD=1;,) \
97
100
ifeq ($(findstring webserver,$(target ) ) ,webserver)
98
101
# Compiling front-end
99
102
@$(if $(findstring -kit,$@),export DOCKER_BUILDKIT=1;export COMPOSE_DOCKER_CLI_BUILD=1;,) \
100
- $(MAKE) -C services/web/client clean compile$(if $(findstring -x,$@),-x,)
103
+ $(MAKE_C) services/web/client clean compile$(if $(findstring -x,$@),-x,)
101
104
endif
102
105
# Building service $(target)
103
106
@$(if $(findstring -kit,$@),export DOCKER_BUILDKIT=1;export COMPOSE_DOCKER_CLI_BUILD=1;,) \
114
117
ifeq ($(findstring webserver,$(target ) ) ,webserver)
115
118
# Compiling front-end
116
119
@$(if $(findstring -kit,$@),export DOCKER_BUILDKIT=1;export COMPOSE_DOCKER_CLI_BUILD=1;,) \
117
- $(MAKE) -C services/web/client touch$(if $(findstring -x,$@),-x,) compile-dev
120
+ $(MAKE_C) services/web/client touch$(if $(findstring -x,$@),-x,) compile-dev
118
121
endif
119
122
# Building service $(target)
120
123
@$(if $(findstring -kit,$@),export DOCKER_BUILDKIT=1;export COMPOSE_DOCKER_CLI_BUILD=1;,) \
@@ -127,7 +130,7 @@ build-cache build-cache-nc build-cache-kit build-cache-x: .env ## Build cache im
127
130
ifeq ($(target ) ,)
128
131
# Compiling front-end
129
132
@$(if $(findstring -kit,$@),export DOCKER_BUILDKIT=1;export COMPOSE_DOCKER_CLI_BUILD=1;,)
130
- $(MAKE) -C services/web/client compile$(if $(findstring -x,$@),-x,)
133
+ $(MAKE_C) services/web/client compile$(if $(findstring -x,$@),-x,)
131
134
# Building cache images
132
135
@$(if $(findstring -kit,$@),export DOCKER_BUILDKIT=1;export COMPOSE_DOCKER_CLI_BUILD=1;,)
133
136
$(_docker_compose_build)
@@ -191,7 +194,7 @@ up-devel: .stack-simcore-development.yml .init-swarm $(CLIENT_WEB_OUTPUT) ## Dep
191
194
$(MAKE ) .deploy-ops
192
195
# Start compile+watch front-end container [front-end]
193
196
$(if $(IS_WSL ) ,$(warning WINDOWS: Do not forget to run scripts/win-watcher.bat in cmd) ,)
194
- $(MAKE ) -C services/web/client compile-dev flags=--watch
197
+ $(MAKE_C ) services/web/client compile-dev flags=--watch
195
198
196
199
up-prod : .stack-simcore-production.yml .init-swarm # # Deploys local production stack and ops stack (pass 'make ops_disabled=1 up-...' to disable)
197
200
# Deploy stack $(SWARM_STACK_NAME)
@@ -215,7 +218,7 @@ down: ## Stops and removes stack
215
218
$(shell docker stack ls --format={{.Name}} | tac) ,\
216
219
docker stack rm $(stack ) ; )
217
220
# Removing client containers (if any)
218
- -$(MAKE ) -C services/web/client down
221
+ -$(MAKE_C ) services/web/client down
219
222
# Removing generated docker compose configurations, i.e. .stack-*
220
223
-$(shell rm $(wildcard .stack-* ) )
221
224
@@ -322,9 +325,9 @@ devenv: .venv ## create a python virtual environment with dev tools (e.g. linter
322
325
323
326
devenv-all : devenv # # sets up extra development tools (everything else besides python)
324
327
# Upgrading client compiler
325
- @$(MAKE ) --directory services/web/client upgrade
328
+ @$(MAKE_C ) services/web/client upgrade
326
329
# Building tools
327
- @$(MAKE ) --directory scripts/json-schema-to-openapi-schema
330
+ @$(MAKE_C ) scripts/json-schema-to-openapi-schema
328
331
329
332
330
333
# # MISC -------------------------------
@@ -348,9 +351,9 @@ new-service: .venv ## Bakes a new project from cookiecutter-simcore-pyservice an
348
351
349
352
.PHONY : openapi-specs
350
353
openapi-specs : # # bundles and validates openapi specifications and schemas of ALL service's API
351
- @$(MAKE ) --directory services/web/server $@
352
- @$(MAKE ) --directory services/storage $@
353
- @$(MAKE ) --directory services/director $@
354
+ @$(MAKE_C ) services/web/server $@
355
+ @$(MAKE_C ) services/storage $@
356
+ @$(MAKE_C ) services/director $@
354
357
355
358
356
359
.PHONY : code-analysis
@@ -397,7 +400,7 @@ ifeq ($(target),)
397
400
$(call show-meta,$(service))\
398
401
)
399
402
# # Client images:
400
- @$(MAKE) -C services/web/client info
403
+ @$(MAKE_C) services/web/client info
401
404
else
402
405
# # $(target) images:
403
406
@$(call show-meta,$(target))
@@ -437,27 +440,27 @@ clean: .check-clean clean-venv ## cleans all unversioned files in project and te
437
440
# Cleaning unversioned
438
441
@git clean $(git_clean_args )
439
442
# Cleaning web/client
440
- @$(MAKE ) -C services/web/client clean
443
+ @$(MAKE_C ) services/web/client clean
441
444
# Cleaning postgres maintenance
442
- @$(MAKE ) -C packages/postgres-database/docker clean
445
+ @$(MAKE_C ) packages/postgres-database/docker clean
443
446
444
447
clean-images : # # removes all created images
445
448
# Cleaning all service images
446
449
-$(foreach service,$(SERVICES_LIST ) \
447
450
,docker image rm -f $(shell docker images * /$(service ) :* -q) ; )
448
451
# Cleaning webclient
449
- @$(MAKE ) -C services/web/client clean
452
+ @$(MAKE_C ) services/web/client clean
450
453
# Cleaning postgres maintenance
451
- @$(MAKE ) -C packages/postgres-database/docker clean
454
+ @$(MAKE_C ) packages/postgres-database/docker clean
452
455
453
456
clean-all : clean clean-images # Deep clean including .venv and produced images
454
457
-rm -rf .venv
455
458
456
459
457
460
.PHONY : postgres-upgrade
458
461
postgres-upgrade : # # initalize or upgrade postgres db to latest state
459
- @$(MAKE ) -C packages/postgres-database/docker build
460
- @$(MAKE ) -C packages/postgres-database/docker upgrade
462
+ @$(MAKE_C ) packages/postgres-database/docker build
463
+ @$(MAKE_C ) packages/postgres-database/docker upgrade
461
464
462
465
.PHONY : reset
463
466
reset : # # restart docker daemon (LINUX ONLY)
0 commit comments