blob: c3b1698adecc0422ff263c31783f497217a22deb [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
Matteo Scandolo74a062a2016-09-23 14:15:06 -070016metronetwork: prereqs dirs download_xos download_services bootstrap onboarding services
Rizwan Haider752a48c2016-08-18 15:37:06 -040017
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
Matteo Scandolo74a062a2016-09-23 14:15:06 -070059services:
60 $(RUN_TOSCA) ecord-services.yaml
61
Rizwan Haider752a48c2016-08-18 15:37:06 -040062containers: prereqs download_xos
63 make -f ../common/Makefile.containers xos_devel synchronizer onboarding_synchronizer
64
65rebuild:
66 bash ../common/rebuild.sh $(XOS_BOOTSTRAP_PORT)
67 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
68
69stop:
70 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop
71 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) stop
72
73showlogs:
74 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs
75
76showlogs_bootstrap:
77 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs
78
79rm: stop
80 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm -f
81 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm -f
82
83ps:
84 sudo docker-compose ps
85
86enter-ui:
87 sudo docker exec -ti metronetwork_xos_ui_1 bash
88
89enter-bootstrap-ui:
90 sudo docker exec -ti metronetworkdbs_xos_bootstrap_ui_1 bash
91
92enter-db:
93 sudo docker exec -ti metronetworkdbs_xos_db_1 bash
94
95django-restart:
96 sudo docker exec metronetwork_xos_ui_1 touch /opt/xos/xos/settings.py
97
98clean-config-folder:
99 sudo docker exec metronetwork_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_mcord_config
100 sudo docker exec metronetwork_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_cord_config
101
102