-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
58 lines (42 loc) · 1.55 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
# Commands for managing Arrowhead Core services installation.
#
# Usage: See make help
MYSQL_ROOT_PASSWORD=R2TuCgTRYMQH
ifeq ($(CURDIR:%/core-java-spring/docker=%),$(CURDIR))
# Execute the real targets in core-java-spring/docker directory
default $(filter-out help,$(MAKECMDGOALS)):
@$(MAKE) -C core-java-spring/docker -f $(CURDIR)/Makefile TOPDIR=$(CURDIR) $(MAKECMDGOALS)
.PHONY: help
help:
$(info $(help))
@:
define help
Commands for managing Arrowhead Core Services installation.
Usage:
make # Initialize and start the services.
make <target> # Run the target from this file.
# Available targets: down, clean, mysql, etc.
endef
else
#####################################################
# Targets to be executed in core-java-spring/docker #
#####################################################
default: up
init_mysql:
docker volume create --name=mysql
sed -E -e "s|wget https://raw.githubusercontent.com/eclipse-arrowhead/core-java-spring/master/(.*)|cp '$(TOPDIR)/core-java-spring/\1' .|" initSQL.sh > initSQL-local.sh
bash -x -e initSQL-local.sh
cp ../scripts/timemanager_privileges.sql sql/privileges
sed -e 's/THIS_WILL_BE_YOUR_CONTAINERS_ROOT_PW/$(MYSQL_ROOT_PASSWORD)/' docker-compose-4-3-0-amd64.yml > docker-compose.yml
up: init_mysql
docker-compose up --build
down:
docker-compose down
clean: down
docker volume rm mysql
pull:
docker-compose pull
# Run MySQL CLI client on the Arrowhead database
mysql:
mysql --protocol=TCP --host=localhost --port=3306 --user=root --password=$(MYSQL_ROOT_PASSWORD) arrowhead
endif