blob: 98d5f0ef578a902959a0b66e93981c986b918062 [file] [log] [blame]
Zack Williams3670f442016-10-04 17:37:12 -07001# opencloud/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 := xos
Scott Baker50421662016-06-27 22:09:48 -07007
Zack Williams3670f442016-10-04 17:37:12 -07008DOCKER_PROJECT ?= oc
9BOOTSTRAP_PROJECT ?= ocb
Scott Baker50421662016-06-27 22:09:48 -070010
Zack Williams3670f442016-10-04 17:37:12 -070011# Include common functions
12include $(COMMON_DIR)/Makefile
Scott Baker50421662016-06-27 22:09:48 -070013
Zack Williamsc1b451f2016-11-03 09:51:41 -070014xos: prereqs config_dirs xos_download opencloud_services oc_bootstrap onboarding
Scott Baker50421662016-06-27 22:09:48 -070015
Zack Williams3670f442016-10-04 17:37:12 -070016opencloud_services: $(SERVICE_DIR) \
17 $(SERVICE_DIR)/onos-service \
18 $(SERVICE_DIR)/openstack \
19 $(SERVICE_DIR)/vrouter \
20 $(SERVICE_DIR)/vtn
Scott Baker50421662016-06-27 22:09:48 -070021
Zack Williamsc1b451f2016-11-03 09:51:41 -070022opencloud_bootstrap: deployment.yaml
23 @echo "[OC BOOTSTRAP]"
24 @echo "XOS Image Build Date: `sudo docker inspect -f '{{ .Created }}' xosproject/xos`"
25 @echo "XOS Image Commit Hash: `sudo docker inspect -f '{{ .Config.Labels.XOS_GIT_COMMIT_HASH }}' xosproject/xos`"
26 @echo "XOS Image Commit Date: `sudo docker inspect -f '{{ .Config.Labels.XOS_GIT_COMMIT_DATE }}' xosproject/xos`"
27 sudo rm -f $(DOCKER_COMPOSE_YML)
28 sudo CONFIG_DIR=$(CONFIG_DIR) docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) up -d
29 bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_BOOTSTRAP_PORT)
30 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < $(COMMON_DIR)/tosca/fixtures.yaml
31 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < deployment.yaml
32 bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_BOOTSTRAP_PORT)
33 $(RUN_TOSCA_BOOTSTRAP) $(CONFIG_DIR)/xos.yaml
34
Zack Williams3670f442016-10-04 17:37:12 -070035onboarding: synchronizers.yaml id_rsa id_rsa.pub
36 @echo "[ONBOARDING]"
37 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
38 $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/disable-onboarding.yaml
39 sudo cp id_rsa key_import/onos_rsa
40 sudo cp id_rsa.pub key_import/onos_rsa.pub
41 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/openstack/xos/openstack-onboard.yaml
42 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vrouter/xos/vrouter-onboard.yaml
43 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vtn/xos/vtn-onboard.yaml
44 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/onos-service/xos/onos-onboard.yaml
45 $(RUN_TOSCA_BOOTSTRAP) synchronizers.yaml
46 $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/enable-onboarding.yaml
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/vtn
49 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/onos
50 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
51 bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
Scott Baker50421662016-06-27 22:09:48 -070052
Zack Williams2c1f8592016-11-01 21:51:26 -070053opencloud: opencloud.yaml
54 @echo "[OPENCLOUD]"
55 $(RUN_TOSCA) opencloud.yaml
56
57vtn: vtn.yaml
58 @echo "[VTN]"
59 $(RUN_TOSCA) vtn.yaml
60
61exampleservice: $(SERVICE_DIR)/exampleservice opencloud-exampleservice.yaml
62 @echo "[EXAMPLESERVICE]"
63 sudo cp id_rsa key_import/exampleservice_rsa
64 sudo cp id_rsa.pub key_import/exampleservice_rsa.pub
65 $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/disable-onboarding.yaml
66 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/exampleservice/xos/exampleservice-onboard.yaml
67 $(RUN_TOSCA_BOOTSTRAP) exampleservice-synchronizer.yaml
68 $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/enable-onboarding.yaml
69 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/exampleservice
70 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
71 bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
72 $(RUN_TOSCA) opencloud-exampleservice.yaml
73