Add -p option to build specitif cord project

Change-Id: Ib2805fad18ed41154e0d265b6e1e98760aac2cdd
diff --git a/config/mcord_in_a_box.yml b/config/mcord_in_a_box.yml
new file mode 100644
index 0000000..8c0bec1
--- /dev/null
+++ b/config/mcord_in_a_box.yml
@@ -0,0 +1,65 @@
+# Deployment configuration for VirtualBox based head node.
+#
+# This deployment configuration can be utilized with the head node created
+# via `vagrant up headnode` from the gerrit.opencord.org/maas repository.
+---
+debug: false
+
+# this is used to generate the genconfig/cord-inv file
+headnode:
+  ip: '10.100.198.201'
+  ansible_user: 'vagrant'
+  ansible_ssh_pass: 'vagrant'
+  ansible_ssh_port: 22
+
+common:
+  # all of these are written to genconfig/config.yml, and needs a rework
+
+  # set to the "flavor" of cord you want to install
+  cord_profile: 'mcord'
+  cord_dir: '/opt/cord'
+  cord_profile_dir: '/opt/cord_profile'
+
+  # Specifies tasks within the head node provisioning not to execute, including:
+  #
+  # switch_support -   don't download the switch ONL images as there are no
+  #                    switches in this configuration
+  # interface_config - don't update the network configuration of the headnode
+  #                    as it is configured by vagrant to the proper settings
+  skipTags:
+    - 'switch_support'
+    - 'reboot'
+    - 'interface_config'
+
+  fabric_ip: '10.6.1.1/24'
+  management_ip: '10.1.0.1/24'
+  external_iface: 'eth0'
+  management_network: '10.1.0.0/24'
+
+  # Specifies the extra settings required for this configuration
+  #
+  # virtualbox_support - install support for managing virtual box based
+  #                      compute nodes
+  # virtualbox_support: 1
+  # power_helper_user: 'cord'
+
+  # on_cloudlab: True
+  cord_in_a_box: True
+
+  extraVars:
+    - 'fabric_include_names=eth2'
+    - 'fabric_include_module_types=omit'
+    - 'fabric_exclude_names=eth0,eth1'
+    - 'management_include_names=eth1'
+    - 'management_exclude_names=eth0,eth2'
+
+docker:
+  imageVersion: candidate
+  registry: '10.100.198.201:5000'
+
+otherServers:
+  # Specifies the configuration for dynamically added compute nodes
+  fabric:
+    network: '10.6.1.1/24'
+    management: '10.1.0.0/24'
+
diff --git a/scripts/cord-in-a-box.sh b/scripts/cord-in-a-box.sh
index 4d1bad7..581736c 100755
--- a/scripts/cord-in-a-box.sh
+++ b/scripts/cord-in-a-box.sh
@@ -315,7 +315,7 @@
 #needed, use -n option
 NUM_COMPUTE_NODES=1
 
-while getopts "b:cdfhn:stv" opt; do
+while getopts "b:cdfhn:stvp:" opt; do
   case ${opt} in
     b ) GERRIT_BRANCHES+=("$OPTARG")
       ;;
@@ -337,6 +337,7 @@
       echo "    $0 -s             run initial setup phase only (don't start building CORD)"
       echo "    $0 -t             do install, bring up cord-pod configuration, run E2E test"
       echo "    $0 -v             print CiaB version and exit"
+      echo "    $0 -p             Specific which project you want to build.(rcord, mcord, or ecord)"
       exit 0
       ;;
     n ) NUM_COMPUTE_NODES=$OPTARG
@@ -348,6 +349,21 @@
     v ) echo "$VERSION_STRING ($REPO_BRANCH branch)"
       exit 0
       ;;
+    p ) # Change config files to build specific cord project
+        if [[ $OPTARG == "mcord" ]]
+        then
+            CONFIG=config/mcord_in_a_box.yml
+        elif [[ $OPTARG == "ecord" ]]
+        then
+            CONFIG=config/ecord_in_a_box.yml
+        elif [[ $OPTARG == "rcord" ]]
+        then
+            CONFIG=config/cord_in_a_box.yml
+        else
+            echo "Invalid option: Please select project from rcord, mcord or ecord"
+            exit 1
+        fi
+        ;;
     \? ) echo "Invalid option: -$OPTARG"
       exit 1
       ;;