blob: c4ee829957821035e68f56a9f2fb78ad628323e0 [file] [log] [blame]
Zack Williams3670f442016-10-04 17:37:12 -07001# frontend/Makefile
Scott Baker50421662016-06-27 22:09:48 -07002
Zack Williams3670f442016-10-04 17:37:12 -07003CONFIG_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
4COMMON_DIR := $(abspath ../common )
Scott Baker50421662016-06-27 22:09:48 -07005
Zack Williams3670f442016-10-04 17:37:12 -07006.DEFAULT_GOAL := frontend
Scott Baker50421662016-06-27 22:09:48 -07007
Zack Williams3670f442016-10-04 17:37:12 -07008DOCKER_PROJECT ?= frontend
9BOOTSTRAP_PROJECT ?= frontendbs
Scott Baker50421662016-06-27 22:09:48 -070010
Zack Williams3670f442016-10-04 17:37:12 -070011XOS_BOOTSTRAP_PORT ?= 9998
12XOS_UI_PORT ?= 9999
Scott Baker50421662016-06-27 22:09:48 -070013
Zack Williams3670f442016-10-04 17:37:12 -070014# Include common functions
15include $(COMMON_DIR)/Makefile
Scott Bakerbda441d2016-06-28 14:14:31 -070016
Scott Baker62d24282016-10-21 09:19:11 -070017frontend: prereqs config_dirs xos_download cord_services cord_libraries bootstrap onboarding frontendconfig
Scott Baker50421662016-06-27 22:09:48 -070018
19onboarding:
Scott Bakerc5e2f3c2016-07-11 11:48:06 -070020 @echo "[ONBOARDING]"
Scott Baker50421662016-06-27 22:09:48 -070021 # on-board any services here
Zack Williams3670f442016-10-04 17:37:12 -070022 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
23 bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
Scott Baker50421662016-06-27 22:09:48 -070024
25onboard-cord-pod:
26 sudo bash -c "echo somekey > key_import/vsg_rsa"
27 sudo bash -c "echo somekey > key_import/vsg_rsa.pub"
28 sudo bash -c "echo somekey > key_import/volt_rsa"
29 sudo bash -c "echo somekey > key_import/volt_rsa.pub"
Scott Baker21ecb202016-08-01 16:03:25 -070030 sudo bash -c "echo somekey > key_import/onos_rsa"
31 sudo bash -c "echo somekey > key_import/onos_rsa.pub"
Zack Williams3670f442016-10-04 17:37:12 -070032 $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/disable-onboarding.yaml
Scott Bakerda3b1592016-10-24 10:45:36 -070033 $(RUN_TOSCA_BOOTSTRAP) $(LIBRARY_DIR)/ng-xos-lib/ng-xos-lib-onboard.yaml
Scott Baker50421662016-06-27 22:09:48 -070034 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vrouter/xos/vrouter-onboard.yaml
35 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/olt/xos/volt-onboard.yaml
36 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vsg/xos/vsg-onboard.yaml
Scott Baker21ecb202016-08-01 16:03:25 -070037 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/onos-service/xos/onos-onboard.yaml
38 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/fabric/xos/fabric-onboard.yaml
39 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vtr/xos/vtr-onboard.yaml
Scott Baker418f2472016-06-28 11:57:08 -070040 $(RUN_TOSCA_BOOTSTRAP) xos-cord-branding.yaml
Zack Williams3670f442016-10-04 17:37:12 -070041 $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/enable-onboarding.yaml
Scott Bakerda3b1592016-10-24 10:45:36 -070042 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/ng-xos-lib
Zack Williams3670f442016-10-04 17:37:12 -070043 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vrouter
44 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/volt
45 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vsg
46 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/onos
47 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/fabric
48 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vtr
49 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
50 bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
51
52frontendconfig: sample.yaml
53 @echo "[FRONTENDCONFIG]"
54 $(RUN_TOSCA) sample.yaml
55
56mock-cord-pod: onboard-cord-pod
57 $(RUN_TOSCA) $(COMMON_DIR)/tosca/mgmt-net.yaml
58 $(RUN_TOSCA) mocks/onos.yaml
59 $(RUN_TOSCA) ../cord-pod/cord-services.yaml
60 $(RUN_TOSCA) ../cord-pod/cord-test-subscriber.yaml
61 $(RUN_TOSCA) ../cord-pod/cord-volt-devices.yaml
Scott Baker50421662016-06-27 22:09:48 -070062
63mock-mcord:
64 # check this
Zack Williams3670f442016-10-04 17:37:12 -070065 $(RUN_TOSCA) $(COMMON_DIR)/tosca/mgmt-net.yaml
Scott Baker50421662016-06-27 22:09:48 -070066 $(RUN_TOSCA) mocks/mcord.yaml
Zack Williams3670f442016-10-04 17:37:12 -070067 sudo docker exec $(DOCKER_PROJECT)_xos_ui_1 cp /opt/xos/configurations/mcord/xos_mcord_config /opt/xos/xos_configuration/
68 sudo docker exec $(DOCKER_PROJECT)_xos_ui_1 touch /opt/xos/xos/settings.py
Scott Baker50421662016-06-27 22:09:48 -070069
Zack Williams3670f442016-10-04 17:37:12 -070070exampleservice: $(SERVICE_DIR)/exampleservice
Scott Baker50421662016-06-27 22:09:48 -070071 mkdir -p key_import
72 # fake keys are fine
73 sudo bash -c "echo somekey > key_import/exampleservice_rsa"
74 sudo bash -c "echo somekey > key_import/exampleservice_rsa.pub"
75 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/exampleservice/xos/exampleservice-onboard.yaml
Zack Williams3670f442016-10-04 17:37:12 -070076 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/exampleservice
77 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
78 bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
Matteo Scandolo74321fe2016-07-19 14:41:54 -070079
Zack Williams3670f442016-10-04 17:37:12 -070080hypercache: $(SERVICE_DIR)/hypercache
Scott Bakerf12eed72016-08-08 11:12:51 -070081 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/hypercache/xos/hpc-onboard.yaml
Zack Williams3670f442016-10-04 17:37:12 -070082 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/hpc
83 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
84 bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
Scott Bakerf12eed72016-08-08 11:12:51 -070085 $(RUN_TOSCA) mocks/cdn.yaml
86 $(RUN_TOSCA) ../opencloud/cdn-content.yaml
87
Zack Williams3670f442016-10-04 17:37:12 -070088dashboard: dashboard.yaml
89 $(RUN_TOSCA) $(CONFIG_DIR)/dashboard.yaml
Matteo Scandolo74321fe2016-07-19 14:41:54 -070090
Matteo Scandolo6b1cfb92016-09-30 17:07:35 -070091# before executing this clone the service from: https://github.com/teone/mcord-slicing-ui.git
92onboard-mcord-slicing: slicing-ui
93 # fix ports (now they are set to use the FE config ones
94 @echo "[ONBOARDING UI SERVICES]"
Zack Williams3670f442016-10-04 17:37:12 -070095 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_UI_PORT) xos
96 $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/disable-onboarding.yaml
Matteo Scandolo6b1cfb92016-09-30 17:07:35 -070097 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/mcord-ui-slicing/xos/mcord-slicing-onboard.yaml
Zack Williams3670f442016-10-04 17:37:12 -070098 $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/enable-onboarding.yaml
99 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_UI_PORT) xos
100 bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
Matteo Scandolo6b1cfb92016-09-30 17:07:35 -0700101
102slicing-ui:
103 $(RUN_TOSCA) ./mocks/mcord-slicing-ui.yaml
Zack Williams3670f442016-10-04 17:37:12 -0700104
105clean-config-folder:
106 sudo docker exec $(DOCKER_PROJECT)_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_mcord_config
107 sudo docker exec $(DOCKER_PROJECT)_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_cord_config
108