blob: 6898687179254b68ea57e8a134cfdfc67d888385 [file] [log] [blame]
Pingping Lin96f17e92017-05-04 18:16:54 -07001# frontend/Makefile
2
3CONFIG_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
4COMMON_DIR := $(abspath ../common )
5
6.DEFAULT_GOAL := frontend
7
8DOCKER_PROJECT ?= frontend
9BOOTSTRAP_PROJECT ?= frontendbs
10
11XOS_BOOTSTRAP_PORT ?= 81
12XOS_UI_PORT ?= 8888
13
14# Include common functions
15include $(COMMON_DIR)/Makefile
16
17frontend: prereqs config_dirs xos_download cord_services cord_libraries bootstrap onboarding frontendconfig
18
19onboarding:
20 @echo "[ONBOARDING]"
21 # on-board any services here
22 $(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
26 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
27 bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
28
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"
34 sudo bash -c "echo somekey > key_import/onos_rsa"
35 sudo bash -c "echo somekey > key_import/onos_rsa.pub"
36 $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/disable-onboarding.yaml
37 $(RUN_TOSCA_BOOTSTRAP) $(LIBRARY_DIR)/ng-xos-lib/ng-xos-lib-onboard.yaml
38 $(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
41 $(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
44 $(RUN_TOSCA_BOOTSTRAP) xos-cord-branding.yaml
45 $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/enable-onboarding.yaml
46 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/ng-xos-lib
47 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
64 $(RUN_TOSCA) $(COMMON_DIR)/tosca/public-net.yaml
65 $(RUN_TOSCA) ../cord-pod/cord-test-subscriber.yaml
66 $(RUN_TOSCA) $(COMMON_DIR)/tosca/cord-volt-devices.yaml
67
68mock-mcord:
69 # check this
70 $(RUN_TOSCA) $(COMMON_DIR)/tosca/mgmt-net.yaml
71 $(RUN_TOSCA) mocks/mcord.yaml
72 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
74
75exampleservice: $(SERVICE_DIR)/exampleservice
76 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
81 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)
84
85hypercache: $(SERVICE_DIR)/hypercache
86 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/hypercache/xos/hpc-onboard.yaml
87 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)
90 $(RUN_TOSCA) mocks/cdn.yaml
91 $(RUN_TOSCA) ../opencloud/cdn-content.yaml
92
93dashboard: dashboard.yaml
94 $(RUN_TOSCA) $(CONFIG_DIR)/dashboard.yaml
95
96# 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]"
100 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_UI_PORT) xos
101 $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/disable-onboarding.yaml
102 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/mcord-ui-slicing/xos/mcord-slicing-onboard.yaml
103 $(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)
106
107slicing-ui:
108 $(RUN_TOSCA) ./mocks/mcord-slicing-ui.yaml
109
110slices:
111 $(RUN_TOSCA) ./mocks/slices.yaml
112
113clean-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
116
117experimental-ui: xos_rest_gw_c
118 $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/disable-onboarding.yaml
119 $(RUN_TOSCA_BOOTSTRAP) $(CONFIG_DIR)/ui_containers.yaml
120 $(RUN_TOSCA_BOOTSTRAP) $(CONFIG_DIR)/gui.yaml
121 $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/enable-onboarding.yaml
122 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
123 bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
124