add the ability to pull gerrit reviews with cord-in-a-box.sh script, lint, spelling
clarification of language
change to multiple -b options rather than a long parsed string

Change-Id: I834e171be3c53d46436bc27b94cf7e1efca56a30
diff --git a/ansible/roles/docker/handlers/main.yml b/ansible/roles/docker/handlers/main.yml
new file mode 100644
index 0000000..3b78ba9
--- /dev/null
+++ b/ansible/roles/docker/handlers/main.yml
@@ -0,0 +1,7 @@
+---
+
+- name: docker-restart
+  service:
+    name: docker
+    state: restarted
+
diff --git a/ansible/roles/docker/tasks/debian.yml b/ansible/roles/docker/tasks/debian.yml
index d2e27f1..cb080f9 100644
--- a/ansible/roles/docker/tasks/debian.yml
+++ b/ansible/roles/docker/tasks/debian.yml
@@ -27,24 +27,15 @@
   template:
     src: "{{ docker_cfg }}"
     dest: "{{ docker_cfg_dest }}"
-  register: copy_result
   tags: [docker]
-
-- name: Debian Daemon is reloaded
-  command: systemctl daemon-reload
-  when: copy_result|changed and is_systemd is defined
-  tags: [docker]
+  notify:
+    - docker-restart
 
 - name: vagrant user is added to the docker group
   user:
     name: "{{ ansible_env['SUDO_USER'] }}"
     group: docker
-  register: user_result
   tags: [docker]
+  notify:
+    - docker-restart
 
-- name: Debian Docker service is restarted
-  service:
-    name: docker
-    state: restarted
-  when: copy_result|changed or user_result|changed
-  tags: [docker]
diff --git a/config/onlab_develop_pod.yml b/config/onlab_develop_pod.yml
index c1882b0..6d72075 100644
--- a/config/onlab_develop_pod.yml
+++ b/config/onlab_develop_pod.yml
@@ -1,9 +1,9 @@
-# Deployment configuration for a phyical hardware POD
+# Deployment configuration for a physical hardware POD
 ---
 seedServer:
   ip: '10.90.0.251'
   # User name and password used by Ansible to connect to the host for remote
-  # provisioning. These default values are used for automated testing, change 
+  # provisioning. These default values are used for automated testing, change
   # with care.
   user: 'cord'
   password: 'cord'
diff --git a/docs/quickstart.md b/docs/quickstart.md
index b59f88e..31dd925 100644
--- a/docs/quickstart.md
+++ b/docs/quickstart.md
@@ -64,6 +64,21 @@
 
 The file `~/install.out` contains the full output of the build process.
 
+### Using cord-in-a-box.sh to download development code from Gerrit
+
+There is an `-b` option to cord-in-a-box.sh that will checkout a specific
+changset from a gerrit repo during the run.  The syntax for this is `<project
+path>:<changeset>/<revision>`.  It can be used multiple times - for example:
+
+```
+bash ~/cord-in-a-box.sh -b build/platform-install:1233/4 -b orchestration/service-profile:1234/2"
+```
+
+will check out the `platform-install` repo with changeset 1233, revision 4, and
+`service-profile` repo changeset 1234, revision 2.
+
+You can find the project path used by the `repo` tool in the [manifest/default.xml](https://gerrit.opencord.org/gitweb?p=manifest.git;a=blob;f=default.xml) file.
+
 ## Inspecting CORD-in-a-Box
 
 CORD-in-a-Box installs the target server as a CORD head node, with OpenStack,
diff --git a/scripts/cord-in-a-box.sh b/scripts/cord-in-a-box.sh
index ec882c4..3547c9c 100755
--- a/scripts/cord-in-a-box.sh
+++ b/scripts/cord-in-a-box.sh
@@ -81,6 +81,12 @@
     repo init -u https://gerrit.opencord.org/manifest -b master -g build,onos,orchestration
     repo sync
 
+    # check out gerrit branches using repo
+    for gerrit_branch in ${GERRIT_BRANCHES[@]}; do
+      echo "checking out opencord gerrit branch: $gerrit_branch"
+      repo download ${gerrit_branch/:/ }
+    done
+
     cd $CORDDIR/build
     sed -i "s/user: 'ubuntu'/user: \"$USER\"/" $CONFIG
 
@@ -231,15 +237,15 @@
 }
 
 # Parse options
+GERRIT_BRANCHES=
 RUN_TEST=0
 SETUP_ONLY=0
-SETUP_BRANCH="master"
 DIAGNOSTICS=0
 CLEANUP=0
 
 while getopts "b:cdhst" opt; do
   case ${opt} in
-    b ) XOS_BRANCH=$OPTARG
+    b ) GERRIT_BRANCHES+=("$OPTARG")
       ;;
     c ) CLEANUP=1
       ;;
@@ -247,7 +253,8 @@
       ;;
     h ) echo "Usage:"
       echo "    $0                install OpenStack and prep XOS and ONOS VMs [default]"
-      echo "    $0 -b <branch>    checkout <branch> of the xos git repo"
+      echo "    $0 -b <project:changeset/revision>  checkout a changesets from gerrit. Can"
+      echo "                      be used multiple times."
       echo "    $0 -c             cleanup from previous test"
       echo "    $0 -d             run diagnostic collector"
       echo "    $0 -h             display this help message"