blob: 312604f12da7fa5ef6b2d887e79bee82a77f68de [file] [log] [blame]
Rizwan Haider752a48c2016-08-18 15:37:06 -04001include ../common/Makedefs
2
3MYIP:=$(shell hostname -i)
4CONFIG_DIR:=$(shell pwd)
5DOCKER_COMPOSE_YML=./onboarding-docker-compose/docker-compose.yml
6BOOTSTRAP_YML=./docker-compose-bootstrap.yml
7DOCKER_PROJECT=metronetwork
8BOOTSTRAP_PROJECT=metronetworkdbs
9XOS_BOOTSTRAP_PORT=9998
10XOS_UI_PORT=9999
11ADMIN_USERNAME=padmin@vicci.org
12ADMIN_PASSWORD=letmein
13RUN_TOSCA_BOOTSTRAP=python ../common/run_tosca.py $(XOS_BOOTSTRAP_PORT) $(ADMIN_USERNAME) $(ADMIN_PASSWORD)
14RUN_TOSCA=python ../common/run_tosca.py $(XOS_UI_PORT) $(ADMIN_USERNAME) $(ADMIN_PASSWORD)
15
16metronetwork: prereqs dirs download_xos download_services bootstrap onboarding
17
18prereqs:
19 sudo make -f ../common/Makefile.prereqs
20
21dirs:
22 # if this directory doesn't exist, then docker-compose will create it with root permission
23 mkdir -p key_import
24 mkdir -p onboarding-docker-compose
25
26download_xos:
27 make -f ../common/Makefile.services xos_core
28
29download_services:
30 make -f ../common/Makefile.services
31
32update_services:
33 make -f ../common/Makefile.services update
34
35update_xos:
36 make -f ../common/Makefile.services update_xos
37
38bootstrap:
39 @echo "[BOOTSTRAP]"
40 sudo rm -f onboarding-docker-compose/docker-compose.yml
41 sudo CONFIG_DIR=$(CONFIG_DIR) docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) up -d
42 bash ../common/wait_for_xos_port.sh $(XOS_BOOTSTRAP_PORT)
43 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < ../common/fixtures.yaml
44 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < ../common/mydeployment.yaml
45 $(RUN_TOSCA_BOOTSTRAP) xos.yaml
46 $(RUN_TOSCA_BOOTSTRAP) dashboard.yaml
47
48onboarding:
49 @echo "[ONBOARDING]"
50 # on-board the metronetwork service
51 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
52 $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml
53 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/metro-net/xos/metronetworkservice-onboard.yaml
54 $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml
55 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/metronetwork
56 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
57 bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
58
59containers: prereqs download_xos
60 make -f ../common/Makefile.containers xos_devel synchronizer onboarding_synchronizer
61
62rebuild:
63 bash ../common/rebuild.sh $(XOS_BOOTSTRAP_PORT)
64 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
65
66stop:
67 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop
68 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) stop
69
70showlogs:
71 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs
72
73showlogs_bootstrap:
74 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs
75
76rm: stop
77 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm -f
78 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm -f
79
80ps:
81 sudo docker-compose ps
82
83enter-ui:
84 sudo docker exec -ti metronetwork_xos_ui_1 bash
85
86enter-bootstrap-ui:
87 sudo docker exec -ti metronetworkdbs_xos_bootstrap_ui_1 bash
88
89enter-db:
90 sudo docker exec -ti metronetworkdbs_xos_db_1 bash
91
92django-restart:
93 sudo docker exec metronetwork_xos_ui_1 touch /opt/xos/xos/settings.py
94
95clean-config-folder:
96 sudo docker exec metronetwork_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_mcord_config
97 sudo docker exec metronetwork_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_cord_config
98
99