blob: 01439c738259586dc9d931761a29b0afc1e89c09 [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
Matteo Scandoloa317b872017-01-10 12:02:41 -080011XOS_BOOTSTRAP_PORT ?= 9001
12XOS_UI_PORT ?= 9000
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
Matteo Scandoloa317b872017-01-10 12:02:41 -080017frontend: prereqs config_dirs xos_download cord_services cord_libraries bootstrap onboarding frontendconfig rest-gw ui
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
Matteo Scandolo4bb87be2016-10-27 11:10:00 +020022 $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/disable-onboarding.yaml
23 $(RUN_TOSCA_BOOTSTRAP) $(LIBRARY_DIR)/ng-xos-lib/ng-xos-lib-onboard.yaml
24 $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/enable-onboarding.yaml
25 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/ng-xos-lib
Zack Williams3670f442016-10-04 17:37:12 -070026 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
27 bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
Scott Baker50421662016-06-27 22:09:48 -070028
29onboard-cord-pod:
30 sudo bash -c "echo somekey > key_import/vsg_rsa"
31 sudo bash -c "echo somekey > key_import/vsg_rsa.pub"
32 sudo bash -c "echo somekey > key_import/volt_rsa"
33 sudo bash -c "echo somekey > key_import/volt_rsa.pub"
Scott Baker21ecb202016-08-01 16:03:25 -070034 sudo bash -c "echo somekey > key_import/onos_rsa"
35 sudo bash -c "echo somekey > key_import/onos_rsa.pub"
Zack Williams3670f442016-10-04 17:37:12 -070036 $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/disable-onboarding.yaml
Scott Bakerda3b1592016-10-24 10:45:36 -070037 $(RUN_TOSCA_BOOTSTRAP) $(LIBRARY_DIR)/ng-xos-lib/ng-xos-lib-onboard.yaml
Scott Baker50421662016-06-27 22:09:48 -070038 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vrouter/xos/vrouter-onboard.yaml
39 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/olt/xos/volt-onboard.yaml
40 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vsg/xos/vsg-onboard.yaml
Scott Baker21ecb202016-08-01 16:03:25 -070041 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/onos-service/xos/onos-onboard.yaml
42 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/fabric/xos/fabric-onboard.yaml
43 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vtr/xos/vtr-onboard.yaml
Scott Baker418f2472016-06-28 11:57:08 -070044 $(RUN_TOSCA_BOOTSTRAP) xos-cord-branding.yaml
Zack Williams3670f442016-10-04 17:37:12 -070045 $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/enable-onboarding.yaml
Scott Bakerda3b1592016-10-24 10:45:36 -070046 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/ng-xos-lib
Zack Williams3670f442016-10-04 17:37:12 -070047 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vrouter
48 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/volt
49 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vsg
50 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/onos
51 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/fabric
52 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vtr
53 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
54 bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
55
56frontendconfig: sample.yaml
57 @echo "[FRONTENDCONFIG]"
58 $(RUN_TOSCA) sample.yaml
59
60mock-cord-pod: onboard-cord-pod
61 $(RUN_TOSCA) $(COMMON_DIR)/tosca/mgmt-net.yaml
62 $(RUN_TOSCA) mocks/onos.yaml
63 $(RUN_TOSCA) ../cord-pod/cord-services.yaml
Andy Bavier53b98b62016-11-03 16:22:24 -040064 $(RUN_TOSCA) $(COMMON_DIR)/tosca/public-net.yaml
Zack Williams3670f442016-10-04 17:37:12 -070065 $(RUN_TOSCA) ../cord-pod/cord-test-subscriber.yaml
Andy Bavier53b98b62016-11-03 16:22:24 -040066 $(RUN_TOSCA) $(COMMON_DIR)/tosca/cord-volt-devices.yaml
Scott Baker50421662016-06-27 22:09:48 -070067
68mock-mcord:
69 # check this
Zack Williams3670f442016-10-04 17:37:12 -070070 $(RUN_TOSCA) $(COMMON_DIR)/tosca/mgmt-net.yaml
Scott Baker50421662016-06-27 22:09:48 -070071 $(RUN_TOSCA) mocks/mcord.yaml
Zack Williams3670f442016-10-04 17:37:12 -070072 sudo docker exec $(DOCKER_PROJECT)_xos_ui_1 cp /opt/xos/configurations/mcord/xos_mcord_config /opt/xos/xos_configuration/
73 sudo docker exec $(DOCKER_PROJECT)_xos_ui_1 touch /opt/xos/xos/settings.py
Scott Baker50421662016-06-27 22:09:48 -070074
Zack Williams3670f442016-10-04 17:37:12 -070075exampleservice: $(SERVICE_DIR)/exampleservice
Scott Baker50421662016-06-27 22:09:48 -070076 mkdir -p key_import
77 # fake keys are fine
78 sudo bash -c "echo somekey > key_import/exampleservice_rsa"
79 sudo bash -c "echo somekey > key_import/exampleservice_rsa.pub"
80 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/exampleservice/xos/exampleservice-onboard.yaml
Zack Williams3670f442016-10-04 17:37:12 -070081 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/exampleservice
82 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
83 bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
Matteo Scandolo74321fe2016-07-19 14:41:54 -070084
Zack Williams3670f442016-10-04 17:37:12 -070085hypercache: $(SERVICE_DIR)/hypercache
Scott Bakerf12eed72016-08-08 11:12:51 -070086 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/hypercache/xos/hpc-onboard.yaml
Zack Williams3670f442016-10-04 17:37:12 -070087 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/hpc
88 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
89 bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
Scott Bakerf12eed72016-08-08 11:12:51 -070090 $(RUN_TOSCA) mocks/cdn.yaml
91 $(RUN_TOSCA) ../opencloud/cdn-content.yaml
92
Zack Williams3670f442016-10-04 17:37:12 -070093dashboard: dashboard.yaml
94 $(RUN_TOSCA) $(CONFIG_DIR)/dashboard.yaml
Matteo Scandolo74321fe2016-07-19 14:41:54 -070095
Matteo Scandolo6b1cfb92016-09-30 17:07:35 -070096# before executing this clone the service from: https://github.com/teone/mcord-slicing-ui.git
97onboard-mcord-slicing: slicing-ui
98 # fix ports (now they are set to use the FE config ones
99 @echo "[ONBOARDING UI SERVICES]"
Zack Williams3670f442016-10-04 17:37:12 -0700100 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_UI_PORT) xos
101 $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/disable-onboarding.yaml
Matteo Scandolo6b1cfb92016-09-30 17:07:35 -0700102 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/mcord-ui-slicing/xos/mcord-slicing-onboard.yaml
Zack Williams3670f442016-10-04 17:37:12 -0700103 $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/enable-onboarding.yaml
104 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_UI_PORT) xos
105 bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
Matteo Scandolo6b1cfb92016-09-30 17:07:35 -0700106
107slicing-ui:
108 $(RUN_TOSCA) ./mocks/mcord-slicing-ui.yaml
Zack Williams3670f442016-10-04 17:37:12 -0700109
Matteo Scandoloaf2cd4f2016-12-22 13:27:10 -0800110slices:
111 $(RUN_TOSCA) ./mocks/slices.yaml
112
Zack Williams3670f442016-10-04 17:37:12 -0700113clean-config-folder:
114 sudo docker exec $(DOCKER_PROJECT)_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_mcord_config
115 sudo docker exec $(DOCKER_PROJECT)_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_cord_config