Zack Williams | 7828f22 | 2016-10-19 14:04:51 -0700 | [diff] [blame] | 1 | # metronetwork/Makefile |
Rizwan Haider | 752a48c | 2016-08-18 15:37:06 -0400 | [diff] [blame] | 2 | |
Zack Williams | 3670f44 | 2016-10-04 17:37:12 -0700 | [diff] [blame] | 3 | CONFIG_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) |
| 4 | COMMON_DIR := $(abspath ../common ) |
Rizwan Haider | 752a48c | 2016-08-18 15:37:06 -0400 | [diff] [blame] | 5 | |
Zack Williams | 3670f44 | 2016-10-04 17:37:12 -0700 | [diff] [blame] | 6 | .DEFAULT_GOAL := metronetwork |
Rizwan Haider | 752a48c | 2016-08-18 15:37:06 -0400 | [diff] [blame] | 7 | |
Zack Williams | 3670f44 | 2016-10-04 17:37:12 -0700 | [diff] [blame] | 8 | DOCKER_PROJECT ?= metronetwork |
| 9 | BOOTSTRAP_PROJECT ?= metronetworkbs |
Rizwan Haider | 752a48c | 2016-08-18 15:37:06 -0400 | [diff] [blame] | 10 | |
Zack Williams | 3670f44 | 2016-10-04 17:37:12 -0700 | [diff] [blame] | 11 | XOS_BOOTSTRAP_PORT ?= 9998 |
| 12 | XOS_UI_PORT ?= 9999 |
Rizwan Haider | 752a48c | 2016-08-18 15:37:06 -0400 | [diff] [blame] | 13 | |
Rizwan Haider | 0bab5f4 | 2016-11-10 01:21:07 -0500 | [diff] [blame^] | 14 | BOOTSTRAP_DEVEL_YML ?= $(CONFIG_DIR)/docker-compose-bootstrap-devel.yml |
| 15 | |
Zack Williams | 3670f44 | 2016-10-04 17:37:12 -0700 | [diff] [blame] | 16 | # Include common functions |
| 17 | include $(COMMON_DIR)/Makefile |
Rizwan Haider | 752a48c | 2016-08-18 15:37:06 -0400 | [diff] [blame] | 18 | |
Scott Baker | 62d2428 | 2016-10-21 09:19:11 -0700 | [diff] [blame] | 19 | metronetwork: prereqs config_dirs xos_download cord_services cord_libraries bootstrap dashboard onboarding ecord_services |
Rizwan Haider | 752a48c | 2016-08-18 15:37:06 -0400 | [diff] [blame] | 20 | |
Rizwan Haider | 0bab5f4 | 2016-11-10 01:21:07 -0500 | [diff] [blame^] | 21 | # Targets to accomodate users with HTTP proxies |
| 22 | metronetworkconfig: prereqs config_dirs xos_download cord_services cord_libraries |
| 23 | metronetworklaunch: bootstrap dashboard onboarding ecord_services |
| 24 | |
Zack Williams | 3670f44 | 2016-10-04 17:37:12 -0700 | [diff] [blame] | 25 | dashboard: |
Rizwan Haider | 752a48c | 2016-08-18 15:37:06 -0400 | [diff] [blame] | 26 | $(RUN_TOSCA_BOOTSTRAP) dashboard.yaml |
| 27 | |
| 28 | onboarding: |
| 29 | @echo "[ONBOARDING]" |
| 30 | # on-board the metronetwork service |
Zack Williams | 3670f44 | 2016-10-04 17:37:12 -0700 | [diff] [blame] | 31 | bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos |
| 32 | $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/disable-onboarding.yaml |
Scott Baker | da3b159 | 2016-10-24 10:45:36 -0700 | [diff] [blame] | 33 | $(RUN_TOSCA_BOOTSTRAP) $(LIBRARY_DIR)/ng-xos-lib/ng-xos-lib-onboard.yaml |
Rizwan Haider | 752a48c | 2016-08-18 15:37:06 -0400 | [diff] [blame] | 34 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/metro-net/xos/metronetworkservice-onboard.yaml |
Zack Williams | 3670f44 | 2016-10-04 17:37:12 -0700 | [diff] [blame] | 35 | $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/enable-onboarding.yaml |
Scott Baker | da3b159 | 2016-10-24 10:45:36 -0700 | [diff] [blame] | 36 | bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/ng-xos-lib |
Zack Williams | 3670f44 | 2016-10-04 17:37:12 -0700 | [diff] [blame] | 37 | bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/metronetwork |
| 38 | bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos |
| 39 | bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT) |
Rizwan Haider | 752a48c | 2016-08-18 15:37:06 -0400 | [diff] [blame] | 40 | |
Zack Williams | 3670f44 | 2016-10-04 17:37:12 -0700 | [diff] [blame] | 41 | ecord_services: |
Matteo Scandolo | 74a062a | 2016-09-23 14:15:06 -0700 | [diff] [blame] | 42 | $(RUN_TOSCA) ecord-services.yaml |
| 43 | |
Rizwan Haider | 752a48c | 2016-08-18 15:37:06 -0400 | [diff] [blame] | 44 | clean-config-folder: |
Zack Williams | 3670f44 | 2016-10-04 17:37:12 -0700 | [diff] [blame] | 45 | sudo docker exec $(DOCKER_PROJECT)_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_mcord_config |
| 46 | sudo docker exec $(DOCKER_PROJECT)_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_cord_config |
Rizwan Haider | 0bab5f4 | 2016-11-10 01:21:07 -0500 | [diff] [blame^] | 47 | |
| 48 | onboardmetronetlocal: |
| 49 | @echo "[ONBOARDING VNOD LOCAL]" |
| 50 | # on-board the vnodlocal service - used for testing |
| 51 | $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/disable-onboarding.yaml |
| 52 | $(RUN_TOSCA_BOOTSTRAP) $(LIBRARY_DIR)/ng-xos-lib/ng-xos-lib-onboard.yaml |
| 53 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/metronet-local/xos/vnodlocalservice-onboard.yaml |
| 54 | $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/enable-onboarding.yaml |
| 55 | bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/ng-xos-lib |
| 56 | bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vnodlocal |
| 57 | bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos |
| 58 | bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT) |
| 59 | |
| 60 | devel: |
| 61 | # Simply start the DB - other steps will be done manually |
| 62 | sudo CONFIG_DIR=$(CONFIG_DIR) docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_DEVEL_YML) up -d |