automatically download xos

Change-Id: Ibc51044b15a719eae69423cd9f7db0f6317b407b
diff --git a/common/Makefile.services b/common/Makefile.services
index 6b62a1d..3f01df0 100644
--- a/common/Makefile.services
+++ b/common/Makefile.services
@@ -59,6 +59,9 @@
 
 $(XOS_DIR):
 	git -C ../.. clone https://gerrit.opencord.org/p/xos.git
+	# Make sure the configuratiosn dir doesn't exist
+	# TODO: remove this after configurations dir has been removed from xos repo
+	rm -rf $(XOS_DIR)/xos/configurations
 
 update_xos:
 	git -C $(XOS_DIR) pull
diff --git a/cord-pod/Makefile b/cord-pod/Makefile
index f006c51..b982e6a 100644
--- a/cord-pod/Makefile
+++ b/cord-pod/Makefile
@@ -13,7 +13,7 @@
 RUN_TOSCA=python ../common/run_tosca.py $(XOS_UI_PORT) $(ADMIN_USERNAME) $(ADMIN_PASSWORD)
 
 .PHONY: xos
-xos: prereqs dirs download_services bootstrap onboarding podconfig
+xos: prereqs dirs download_xos download_services bootstrap onboarding podconfig
 
 prereqs:
 	sudo make -f ../common/Makefile.prereqs
@@ -32,6 +32,9 @@
 	sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < ../common/mydeployment.yaml
 	$(RUN_TOSCA_BOOTSTRAP) xos.yaml
 
+download_xos:
+	make -f ../common/Makefile.services xos_core
+
 download_services:
 	make -f ../common/Makefile.services
 
@@ -168,6 +171,6 @@
 	mkdir -p ./images
 
 .PHONY: local_containers
-local_containers:
+local_containers: prereqs download_xos
 	make -f ../common/Makefile.containers update_certs xos_devel synchronizer onboarding_synchronizer
 
diff --git a/frontend/Makefile b/frontend/Makefile
index 9ad3fc1..bac183a 100644
--- a/frontend/Makefile
+++ b/frontend/Makefile
@@ -13,7 +13,7 @@
 RUN_TOSCA_BOOTSTRAP=python ../common/run_tosca.py $(XOS_BOOTSTRAP_PORT) $(ADMIN_USERNAME) $(ADMIN_PASSWORD)
 RUN_TOSCA=python ../common/run_tosca.py $(XOS_UI_PORT) $(ADMIN_USERNAME) $(ADMIN_PASSWORD)
 
-frontend: prereqs dirs download_services bootstrap onboarding frontendconfig
+frontend: prereqs dirs download_xos download_services bootstrap onboarding frontendconfig
 
 prereqs:
 	sudo make -f ../common/Makefile.prereqs
@@ -23,6 +23,9 @@
 	mkdir -p key_import
 	mkdir -p onboarding-docker-compose
 
+download_xos:
+	make -f ../common/Makefile.services xos_core
+
 download_services:
 	make -f ../common/Makefile.services
 
@@ -48,7 +51,7 @@
 	echo "[FRONTENDCONFIG]"
 	$(RUN_TOSCA) sample.yaml
 
-containers:
+containers: prereqs download_xos
 	make -f ../common/Makefile.containers xos_devel synchronizer onboarding_synchronizer
 
 stop:
diff --git a/test-standalone/Makefile b/test-standalone/Makefile
index 626495a..39d9e41 100644
--- a/test-standalone/Makefile
+++ b/test-standalone/Makefile
@@ -29,7 +29,7 @@
 	sudo docker exec -i teststandalone_xos_ui_1 bash -c "cd /opt/xos/tests/api; npm install --production"
 	sudo docker exec teststandalone_xos_ui_1 pip install dredd_hooks
 
-xos: prereqs dirs download_services bootstrap onboarding
+xos: prereqs dirs download_xos download_services bootstrap onboarding
 
 prereqs:
 	sudo make -f ../common/Makefile.prereqs
@@ -46,6 +46,9 @@
 	bash ../common/wait_for_xos_port.sh 9998
 	sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run -e CONFIG_DIR=$(CONFIG_DIR) xos_bootstrap_ui python /opt/xos/tosca/run.py none - < xos.yaml
 
+download_xos:
+	make -f ../common/Makefile.services xos_core
+
 download_services:
 	make -f ../common/Makefile.services
 
@@ -113,7 +116,7 @@
 devel-container: base-container
 	make -f ../common/Makefile.containers xos_devel synchronizer onboarding_synchronizer
 
-containers: devel-container
+containers: prereqs download_xos devel-container
 	make -f ../common/Makefile.containers xos_test
 
 stop: