forked from hobbit-project/platform
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
147 lines (105 loc) · 4.93 KB
/
Makefile
File metadata and controls
147 lines (105 loc) · 4.93 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
# build platform components
default: build
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:
cd rabbitmq-cluster && make start
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: build-java build-dev-images
build-java: install-parent-pom build-controller build-storage build-analysis build-gui
build-gui:
cd hobbit-gui/gui-client && sh -c 'test "$$TRAVIS" = "true" && npm ci; true' && sh -c 'test "$$TRAVIS" = "true" || npm install; true' && npm run build-prod
cd hobbit-gui/gui-serverbackend && mvn clean package
build-controller:
cd platform-controller && make build
build-storage:
cd platform-storage/storage-service && mvn clean package -U
build-analysis:
cd analysis-component && mvn clean package -U
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 ./platform-controller
build-dev-gui-image:
docker build -t hobbitproject/hobbit-gui:dev ./hobbit-gui/gui-serverbackend
build-dev-analysis-image:
docker build -t hobbitproject/hobbit-analysis-component:dev ./analysis-component
build-dev-storage-image:
docker build -t hobbitproject/hobbit-storage-service:dev ./platform-storage/storage-service
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")
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
make --directory=platform-controller test
cd platform-storage/storage-service && mvn --update-snapshots clean test
cd analysis-component && mvn --update-snapshots clean test
cd hobbit-gui/gui-client && sh -c 'test "$$TRAVIS" = "true" && npm ci; true' && sh -c 'test "$$TRAVIS" = "true" || npm install; true' && npm run lint && npm run build-prod
cd hobbit-gui/gui-serverbackend && mvn --update-snapshots clean test
install-parent-pom:
cd parent-pom && mvn install
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
#kubernetes configurations
#-
create-cluster:
sudo kubeadm init --pod-network-cidr=192.168.0.0/16
configure-kubectl:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
schedule-on-master:
kubectl taint nodes --all node-role.kubernetes.io/master-
start-cni:
kubectl apply -f ./resource/calico.yaml && kubectl apply -f - <resource/calicoctl.yaml && alias calicoctl="kubectl exec -i -n kube-system calicoctl /calicoctl -- "
create-ippool:
calicoctl apply -f ./resource/pools.yaml
create-namespace:
kubectl create -f ./resource/namespaces.yaml
assign-to-ippool:
kubectl annotate namespace hobbit "cni.projectcalico.org/ipv4pools"='[“hobbit"]'
kubectl annotate namespace hobbit-core "cni.projectcalico.org/ipv4pools"='[“hobbit-core"]'
kubectl annotate namespace hobbit-service "cni.projectcalico.org/ipv4pools"='[“hobbit-service"]'
start-platform:
kubectl apply -f ./resource/kompose
start-dev-platform:
kubectl apply -f ./resource/kompose-dev
start-elk-platform:
kubectl apply -f ./resource/kompose-elk