ONOS-6135, Manifest 'Hello World'
Change-Id: I9549474309cd89136e9f11a561a0ccd1e282118f
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 0000000..43cf505
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,6 @@
+[gerrit]
+host=gerrit.onosproject.org
+port=29418
+project=manifest.git
+defaultremote=origin
+defaultbranch=master
diff --git a/default.xml b/default.xml
new file mode 100644
index 0000000..18d1e00
--- /dev/null
+++ b/default.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<manifest>
+
+ <remote name="onosproject"
+ fetch=".."
+ review="https://gerrit.onosproject.org/"
+ revision="master" />
+ <default revision="master"
+ remote="onosproject"
+ sync-j="4" />
+
+ <project path="onos" name="onos" groups="onos" />
+
+</manifest>
+
diff --git a/repo_bootstrap.sh b/repo_bootstrap.sh
new file mode 100644
index 0000000..f123fbd
--- /dev/null
+++ b/repo_bootstrap.sh
@@ -0,0 +1,58 @@
+#!/usr/bin/env bash
+# repo_bootstrap.sh
+
+# Use master as default version
+REPO_BRANCH=${REPO_BRANCH:-'master'}
+ONOS_REPO_DIR=${ONOS_REPO_DIR:-'~/onos_repo'}
+
+function install_repo_tool() {
+ if [ ! -x "/usr/local/bin/repo" ]
+ then
+ echo "Installing repo..."
+ REPO_SHA256SUM="e147f0392686c40cfd7d5e6f332c6ee74c4eab4d24e2694b3b0a0c037bf51dc5" # not versioned...
+ curl -o /tmp/repo https://storage.googleapis.com/git-repo-downloads/repo
+ echo "$REPO_SHA256SUM /tmp/repo" | sha256sum -c -
+ sudo mv /tmp/repo /usr/local/bin/repo
+ sudo chmod a+x /usr/local/bin/repo
+ fi
+}
+
+function checkout_onos_with_repo() {
+
+ if [ ! -d "$ONOS_REPO_DIR" ]
+ then
+ echo "Checking out ONOS using repo..."
+
+ mkdir $ONOS_REPO_DIR && cd $ONOS_REPO_DIR
+ repo init -u https://gerrit.onosproject.org/manifest -b $REPO_BRANCH -g onos
+ 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
+ fi
+}
+
+# Parse options
+GERRIT_BRANCHES=
+
+while getopts "b:chsv" opt; do
+ case ${opt} in
+ b ) GERRIT_BRANCHES+=("$OPTARG")
+ ;;
+ h ) echo "Usage:"
+ echo " $0 download ONOS using repo [default]"
+ echo " $0 -b <project:changeset/revision> checkout changesets from gerrit. Can"
+ echo " be used multiple times."
+ echo " $0 -h display this help message"
+ \? ) echo "Invalid option: -$OPTARG"
+ exit 1
+ ;;
+ esac
+done
+
+install_repo_tool()
+checkout_onos_with_repo()
+