Support branches in meta-ci jenkins job

The gerrit trigger will extract the correct meta-* branch but need to
be sure to extract the matching openbmc/openbmc branch.

Once openbmc-test-automation branches, support for that will be added
to this script.

Testing:
Put up dummy commit in thud branch and verified it extracted appropriate
branch and built ok.

Change-Id: Idfe02cdcc9a11ff282df6ee4ba70450ba601b7b1
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/jenkins/run-meta-ci b/jenkins/run-meta-ci
index 8f05c62..124022c 100755
--- a/jenkins/run-meta-ci
+++ b/jenkins/run-meta-ci
@@ -8,20 +8,28 @@
 #  WORKSPACE:      Directory which contains the extracted meta-*
 #                  layer test is running against
 #  GERRIT_PROJECT: openbmc/meta-* layer under test (i.e. openbmc/meta-phosphor)
+#  GERRIT_BRANCH:  Branch under test (default is master)
 
 export LANG=en_US.UTF8
 cd $WORKSPACE
 
+GERRIT_BRANCH=${GERRIT_BRANCH:-"master"}
+
 # Grab this for the downstream job
-git clone https://github.com/openbmc/openbmc-test-automation.git
+# TODO - Need test repo to branch
+# git clone https://github.com/openbmc/openbmc-test-automation.git --branch ${GERRIT_BRANCH} --single-branch
+git clone https://github.com/openbmc/openbmc-test-automation.git --branch master --single-branch
 
 export META_REPO=`basename $GERRIT_PROJECT`
 
 # Move the extracted meta layer to a dir based on it's meta-* name
 mv $GERRIT_PROJECT $META_REPO
 
+# Remove openbmc dir in prep for full repo clone
+rm -rf openbmc
+
 # Clone openbmc/openbmc
-git clone https://github.com/openbmc/openbmc.git
+git clone https://github.com/openbmc/openbmc.git --branch ${GERRIT_BRANCH} --single-branch
 
 # Make sure meta-* directory is there
 mkdir -p ./openbmc/$META_REPO/