-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
75 lines (56 loc) · 1.33 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
DOCKER_DIRS := api_arxiv_admin ui-arxiv-admin
ALL_DIRS := $(DOCKER_DIRS) tests
include .env
export $(shell sed 's/=.*//' .env)
ARXIV_BASE_DIR ?= $(HOME)/arxiv/arxiv-base
.PHONY: HELLO all bootstrap docker-image up down
all: HELLO
define run_in_docker_dirs
@for dir in $(DOCKER_DIRS); do \
echo "Running $(1) in $$dir"; \
$(MAKE) -C $$dir $(1) || exit 1; \
done
endef
define run_in_all_subdirs
@for dir in $(ALL_DIRS); do \
echo "Running $(1) in $$dir"; \
$(MAKE) -C $$dir $(1) || exit 1; \
done
endef
HELLO:
@echo To see the README of this Makefile, type "make help"
#-#
#-# help:
#-# print help messsages
help:
@awk '/^#-#/ { print substr($$0, 5)}' Makefile
.env: ../arxiv-keycloak/.env
ln -s ../arxiv-keycloak/.env .env
#-#
#-# bootstrap:
#-# bootstraps the environment
bootstrap: .bootstrap
.bootstrap: .env
$(call run_in_all_subdirs,bootstrap)
touch .bootstrap
#-#
#-# docker-image:
#-# builds docker images
docker-image:
$(call run_in_docker_dirs,docker-image)
#-#
#-# up:
#-# runs docker compose up with .env.
up: .env
docker compose --env-file=.env --env-file=../arxiv-keycloak/.env up -d
#-#
#-# down:
#-# runs docker compose down
down:
docker compose --env-file=.env --env-file=../arxiv-keycloak/.env down
#-#
#-# test:
#-# runs test in all of subdirectories
test:
$(call run_in_all_subdirs,test)
#-#