-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathMakefile
More file actions
150 lines (114 loc) Β· 6.07 KB
/
Makefile
File metadata and controls
150 lines (114 loc) Β· 6.07 KB
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
build: build-dev-images
deploy: create-networks start
redeploy: build build-dev-images start-dev-platform
redeploy-gui: install-parent-pom build-gui build-dev-gui-image remove-gui-service start-dev-platform
remove-gui-service:
docker service rm platform_gui
start:
docker stack deploy --compose-file docker-compose.yml platform
start-dev: start-rabbitmq-cluster start-dev-platform
start-dev-elk: start-rabbitmq-cluster start-dev-platform start-dev-elk
start-rabbitmq-cluster:
@echo "π‘ Starting RabbitMQ cluster..."
cd rabbitmq-cluster && make start
@echo "β
RabbitMQ cluster started."
# start-rabbitmq:
# @echo "π‘ Starting standalone RabbitMQ container on 'hobbit' network..."
# @docker network inspect hobbit >/dev/null || (echo "β Network 'hobbit' not found. Run 'make create-networks' first." && exit 1)
# @docker rm -f hobbit-rabbitmq >/dev/null 2>&1 || true
# @docker run -d \
# --name hobbit-rabbitmq \
# --network hobbit \
# -p 5672:5672 \
# -p 15672:15672 \
# rabbitmq:3-management
# @docker network connect hobbit-core hobbit-rabbitmq
# @echo "β
RabbitMQ is running at:"
# @echo " AMQP: amqp://localhost:5672"
# @echo " Management: http://localhost:15672 (user: guest, pass: guest)"
start-dev-platform:
docker-compose -f docker-compose-dev.yml up -d
start-dev-elk:
docker-compose -f docker-compose-elk.yml up -d
build-dev-images: build-dev-platform-controller-image build-dev-gui-image build-dev-analysis-image build-dev-storage-image
build-dev-platform-controller-image:
docker build -t hobbitproject/hobbit-platform-controller:dev --file platform-controller/Dockerfile .
build-dev-gui-image:
docker build -t hobbitproject/hobbit-gui:dev --file hobbit-gui/gui-serverbackend/Dockerfile .
build-dev-analysis-image:
docker build -t hobbitproject/hobbit-analysis-component:dev --file ./analysis-component/Dockerfile .
build-dev-storage-image:
docker build -t hobbitproject/hobbit-storage-service:dev --file ./platform-storage/storage-service/Dockerfile .
create-networks:
# @docker network inspect hobbit >/dev/null || (docker network create -d overlay --attachable --subnet 172.16.100.0/24 hobbit && echo "Created network: hobbit")
# @docker network inspect hobbit-core >/dev/null || (docker network create -d overlay --attachable --subnet 172.16.101.0/24 hobbit-core && echo "Created network: hobbit-core")
# @docker network inspect hobbit-services >/dev/null || (docker network create -d overlay --attachable --subnet 172.16.102.0/24 hobbit-services && echo "Created network: hobbit-services")
@echo "π Checking or creating Docker network: hobbit"
@docker network inspect hobbit >/dev/null || (docker network create -d overlay --attachable --subnet 172.16.100.0/24 hobbit && echo "β
Created network: hobbit")
@echo "π Checking or creating Docker network: hobbit-core"
@docker network inspect hobbit-core >/dev/null || (docker network create -d overlay --attachable --subnet 172.16.101.0/24 hobbit-core && echo "β
Created network: hobbit-core")
@echo "π Checking or creating Docker network: hobbit-services"
@docker network inspect hobbit-services >/dev/null || (docker network create -d overlay --attachable --subnet 172.16.102.0/24 hobbit-services && echo "β
Created network: hobbit-services")
docker network ls --no-trunc
@echo "π Docker networks ready."
set-keycloak-permissions:
@chmod --changes 777 config/keycloak
@chmod --changes 666 config/keycloak/keycloak.h2.db
setup-virtuoso:
docker-compose up -d vos
./run-storage-init.sh; true
docker-compose stop vos
docker rm vos
install: create-networks set-keycloak-permissions setup-virtuoso
[ -z "$$DOCKER_HOST" ] && cp --no-clobber docker-compose.override.localhost.yml docker-compose.override.yml; true
run-platform-elk:
docker stack deploy --compose-file docker-compose-elk.yml elk
docker stack deploy --compose-file docker-compose.yml platform
# test: create-networks install-parent-pom start-rabbitmq-cluster
# make --directory=platform-controller test
# cd platform-storage/storage-service && mvn --quiet --update-snapshots clean test
# cd analysis-component && mvn --quiet --update-snapshots clean test
# cd hobbit-gui/gui-client && sh -c 'test "$$TRAVIS" = "true" && npm --quiet ci; true' && sh -c 'test "$$TRAVIS" = "true" || npm --quiet install; true' && npm --quiet run lint && npm --quiet run build-prod
# cd hobbit-gui/gui-serverbackend && mvn --quiet --update-snapshots clean test
test: create-networks install-parent-pom
@echo "π§ Running tests in platform-controller..."
make --directory=platform-controller test
@echo "πΎ Running tests in platform-storage/storage-service..."
cd platform-storage/storage-service && mvn --quiet --update-snapshots clean test
@echo "π Running tests in analysis-component..."
cd analysis-component && mvn --quiet --update-snapshots clean test
@echo "π₯οΈ Running lint and build in hobbit-gui/gui-client..."
cd hobbit-gui/gui-client && \
sh -c 'test "$$TRAVIS" = "true" && npm --quiet ci; true' && \
sh -c 'test "$$TRAVIS" = "true" || npm --quiet install; true' && \
npm --quiet run lint && \
npm --quiet run build-prod
@echo "π Running tests in hobbit-gui/gui-serverbackend..."
cd hobbit-gui/gui-serverbackend && mvn --quiet --update-snapshots clean test
@echo "β
All tests completed successfully!"
install-parent-pom:
@echo "π¦ Installing parent POM..."
cd parent-pom && mvn --quiet install
@echo "β
Parent POM installed."
local-controller: lc-build lc-run
lc-build:
cd platform-controller && make build
lc-run:
#GITLAB_USER=
#GITLAB_EMAIL=
#GITLAB_TOKEN=
DOCKER_HOST=unix:///var/run/docker.sock \
HOBBIT_RABBIT_HOST=localhost \
HOBBIT_REDIS_HOST=localhost \
DEPLOY_ENV=testing \
java -cp platform-controller/target/platform-controller.jar \
org.hobbit.core.run.ComponentStarter \
org.hobbit.controller.PlatformController
dev:
docker-compose -f docker-compose-dev.yml build
docker-compose -f docker-compose-dev.yml -f docker-compose.override.yml up
clean:
cd analysis-component && mvn clean
cd platform-controller && mvn clean
cd platform-storage/storage-service && mvn clean
cd hobbit-gui/gui-serverbackend && mvn clean