CORD-2473 Allow PODCONFIG or PODCONFIG_PATH
Change-Id: Ie62f2c2936fe95d02706364e80d2aa25724b2003
diff --git a/Jenkinsfile.newBuildSystem b/Jenkinsfile.newBuildSystem
index 78685e4..3f2f298 100644
--- a/Jenkinsfile.newBuildSystem
+++ b/Jenkinsfile.newBuildSystem
@@ -83,7 +83,7 @@
}
stage ("Generate CORD configuration") {
- sh "make USECASE=${pod_config.cord_profile} PODCONFIG_D=../orchestration/profiles PODCONFIG=automation/${deployment_config.pod_config.file_name} config"
+ sh "make PODCONFIG_PATH=../orchestration/profiles/automation/${deployment_config.pod_config.file_name} config"
}
if (deployment_config.fabric_switches != null) {
diff --git a/Makefile b/Makefile
index c86725e..c3c3038 100644
--- a/Makefile
+++ b/Makefile
@@ -3,9 +3,6 @@
# Timestamp for log files
TS := $(shell date +'%Y%m%dT%H%M%SZ')
-# Podconfig must be specified, so an invalid default
-PODCONFIG ?= invalid
-
# Source path
BUILD ?= .
CORD ?= ..
@@ -14,7 +11,14 @@
ONOS_APPS ?= $(CORD)/onos-apps
# Configuration paths
-USECASE := $(shell echo $(PODCONFIG) | awk -F '-' '{ print $$1}')
+ifdef PODCONFIG_PATH
+ USECASE := $(shell grep cord_profile: $(PODCONFIG_PATH) | awk '{print $$2}')
+else ifdef PODCONFIG
+ USECASE := $(shell echo $(PODCONFIG) | awk -F '-' '{print $$1}')
+else
+ USECASE = invalid
+endif
+
PROFILE_D ?= $(CORD)/orchestration/profiles/$(USECASE)
PODCONFIG_D ?= $(PROFILE_D)/podconfig
@@ -96,7 +100,7 @@
@echo "Run 'make -j4 build' to continue."
$(CONFIG_FILES):
- test -e "$(PODCONFIG_PATH)" || { echo "PODCONFIG file $(PODCONFIG_PATH) doesn't exist!" ; exit 1; }
+ @test -e "$(PODCONFIG_PATH)" || { echo ""; echo "PODCONFIG file $(PODCONFIG_PATH) doesn't exist!" ; echo "*** Specify a valid CORD config file using PODCONFIG or PODCONFIG_PATH ***"; echo ""; exit 1; }
ansible-playbook -i 'localhost,' --extra-vars="cord_podconfig='$(PODCONFIG_PATH)' genconfig_dir='$(GENCONFIG_D)' scenarios_dir='$(SCENARIOS_D)' platform_install_dir='$(PI)' cord_profile_src_dir='$(PROFILE_D)' " $(BUILD)/ansible/genconfig.yml $(LOGCMD)
printconfig:
diff --git a/docs/install.md b/docs/install.md
index ae1e19f..9904a29 100644
--- a/docs/install.md
+++ b/docs/install.md
@@ -133,13 +133,16 @@
[build/platform-install/profile_manifests](https://github.com/opencord/platform-install/tree/{{
book.branch }}/profile_manifests).
-The included POD configs are generally named `<profile>-<scenario>.yml`, except
+The included POD configs must be named `<profile>-<scenario>.yml`, except
for the `physical-example.yml` file which is used for a [Physical
POD](install_physical.md) and requires a bit more work to configured.
POD configs are used during a build by passing them with the `PODCONFIG`
variable to `make` - ex: `make PODCONFIG=rcord-virtual.yml config`
+You can also specify a full path to the POD config file to use with
+`PODCONFIG_PATH`. This will override the `PODCONFIG` variable.
+
### Profiles
The set of services that XOS on-boards into CORD -- the _Service Graph_, and