Rizwan Haider | 752a48c | 2016-08-18 15:37:06 -0400 | [diff] [blame] | 1 | include ../common/Makedefs |
| 2 | |
| 3 | MYIP:=$(shell hostname -i) |
| 4 | CONFIG_DIR:=$(shell pwd) |
| 5 | DOCKER_COMPOSE_YML=./onboarding-docker-compose/docker-compose.yml |
| 6 | BOOTSTRAP_YML=./docker-compose-bootstrap.yml |
| 7 | DOCKER_PROJECT=metronetwork |
| 8 | BOOTSTRAP_PROJECT=metronetworkdbs |
| 9 | XOS_BOOTSTRAP_PORT=9998 |
| 10 | XOS_UI_PORT=9999 |
| 11 | ADMIN_USERNAME=padmin@vicci.org |
| 12 | ADMIN_PASSWORD=letmein |
| 13 | RUN_TOSCA_BOOTSTRAP=python ../common/run_tosca.py $(XOS_BOOTSTRAP_PORT) $(ADMIN_USERNAME) $(ADMIN_PASSWORD) |
| 14 | RUN_TOSCA=python ../common/run_tosca.py $(XOS_UI_PORT) $(ADMIN_USERNAME) $(ADMIN_PASSWORD) |
| 15 | |
Matteo Scandolo | 74a062a | 2016-09-23 14:15:06 -0700 | [diff] [blame] | 16 | metronetwork: prereqs dirs download_xos download_services bootstrap onboarding services |
Rizwan Haider | 752a48c | 2016-08-18 15:37:06 -0400 | [diff] [blame] | 17 | |
| 18 | prereqs: |
| 19 | sudo make -f ../common/Makefile.prereqs |
| 20 | |
| 21 | dirs: |
| 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 | |
| 26 | download_xos: |
| 27 | make -f ../common/Makefile.services xos_core |
| 28 | |
| 29 | download_services: |
| 30 | make -f ../common/Makefile.services |
| 31 | |
| 32 | update_services: |
| 33 | make -f ../common/Makefile.services update |
| 34 | |
| 35 | update_xos: |
| 36 | make -f ../common/Makefile.services update_xos |
| 37 | |
| 38 | bootstrap: |
| 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 | |
| 48 | onboarding: |
| 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 Scandolo | 74a062a | 2016-09-23 14:15:06 -0700 | [diff] [blame] | 59 | services: |
| 60 | $(RUN_TOSCA) ecord-services.yaml |
| 61 | |
Rizwan Haider | 752a48c | 2016-08-18 15:37:06 -0400 | [diff] [blame] | 62 | containers: prereqs download_xos |
| 63 | make -f ../common/Makefile.containers xos_devel synchronizer onboarding_synchronizer |
| 64 | |
| 65 | rebuild: |
| 66 | bash ../common/rebuild.sh $(XOS_BOOTSTRAP_PORT) |
| 67 | bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos |
| 68 | |
| 69 | stop: |
| 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 | |
| 73 | showlogs: |
| 74 | sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs |
| 75 | |
| 76 | showlogs_bootstrap: |
| 77 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs |
| 78 | |
| 79 | rm: 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 | |
| 83 | ps: |
| 84 | sudo docker-compose ps |
| 85 | |
| 86 | enter-ui: |
| 87 | sudo docker exec -ti metronetwork_xos_ui_1 bash |
| 88 | |
| 89 | enter-bootstrap-ui: |
| 90 | sudo docker exec -ti metronetworkdbs_xos_bootstrap_ui_1 bash |
| 91 | |
| 92 | enter-db: |
| 93 | sudo docker exec -ti metronetworkdbs_xos_db_1 bash |
| 94 | |
| 95 | django-restart: |
| 96 | sudo docker exec metronetwork_xos_ui_1 touch /opt/xos/xos/settings.py |
| 97 | |
| 98 | clean-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 | |