#!/usr/bin/env bash
#
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# onos-bootstrap.sh
# Bootstraps repo for ONOS, downloads source

set -e -u -o pipefail

# Use master as default version
REPO_BRANCH=${REPO_BRANCH:-'master'}

ONOS_REPO_DIR="${CORDDIR:-${HOME}/onosrepo}"

function install_repo() {
  if [ ! -x "/usr/local/bin/repo" ]
  then
    echo "Installing repo..."
    # v1.23, per https://source.android.com/source/downloading
    REPO_SHA256SUM="e147f0392686c40cfd7d5e6f332c6ee74c4eab4d24e2694b3b0a0c037bf51dc5"
    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() {

  if [ ! -d "$ONOS_REPO_DIR" ]
  then

    # Create default git config if unconfigured
    if [ ! -e "${HOME}/.gitconfig" ]
    then
      echo "No ${HOME}/.gitconfig, setting testing defaults"
      git config --global user.name 'Test User'
      git config --global user.email 'test@null.com'
      git config --global color.ui false
    fi

    echo "Checking out ONOS using repo..."

    mkdir -p $ONOS_REPO_DIR && cd $ONOS_REPO_DIR
    repo init -u https://gerrit.onosproject.org/manifest -b $REPO_BRANCH
    repo sync

    # check out gerrit branches using repo
    if [[ ! -z ${GERRIT_PATCHES[@]-} ]]
    then
      for gerrit_patch in "${GERRIT_PATCHES[@]-}"
      do
        echo "Checking out gerrit changeset: '$gerrit_patch'"
        repo download ${gerrit_patch/:/ }
      done
    fi
  fi
}

# Parse options
GERRIT_PATCHES=()

while getopts "p:h" opt; do
  case ${opt} in
    h ) echo "Usage:"
      echo "    $0                download ONOS using repo [default]"
      echo "    $0 -p <project:changeset/revision>  checkout patchsetsfrom gerrit. Can"
      echo "                      be used multiple times."
      echo "    $0 -h             display this help message"
      ;;
    p ) GERRIT_PATCHES+=("$OPTARG")
      ;;
    \? ) echo "Invalid option: -$OPTARG"
      exit 1
      ;;
  esac
done

install_repo
checkout_onos

