#!/bin/bash

source /var/onap/commons
source /var/onap/config/env-vars
source /var/onap/_composed_functions
source /var/onap/_onap_functions

export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' |sort -n | head -1)
export NIC=$(ip route get 8.8.8.8 | awk '{ print $5; exit }')
export IP_ADDRESS=$(ifconfig $NIC | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)

mvn_conf_file=/root/.m2/settings.xml

# configure_dns() - DNS/GW IP address configuration
function configure_dns {
    echo "nameserver 10.0.0.1" >> /etc/resolvconf/resolv.conf.d/head
    resolvconf -u
}

# get_next_ip() - Function that provides the next ip
function get_next_ip {
    local ip=${1:-$IP_ADDRESS}
    ip_hex=$(printf '%.2X%.2X%.2X%.2X\n' `echo $ip | sed -e 's/\./ /g'`)
    next_ip_hex=$(printf %.8X `echo $(( 0x$ip_hex + 1 ))`)
    echo $(printf '%d.%d.%d.%d\n' `echo $next_ip_hex | sed -r 's/(..)/0x\1 /g'`)
}

# _git_timed() - git can sometimes get itself infinitely stuck with transient network
# errors or other issues with the remote end.  This wraps git in a
# timeout/retry loop and is intended to watch over non-local git
# processes that might hang.
function _git_timed {
    local count=0
    local timeout=0

    install_package git
    until timeout -s SIGINT ${timeout} git "$@"; do
        # 124 is timeout(1)'s special return code when it reached the
        # timeout; otherwise assume fatal failure
        if [[ $? -ne 124 ]]; then
            exit 1
        fi

        count=$(($count + 1))
        if [ $count -eq 3 ]; then
            exit 1
        fi
        sleep 5
    done
}

# clone_repo() - Clone Git repository into specific folder
function clone_repo {
    local repo_url=${3:-"https://git.onap.org/"}
    local repo=$1
    local dest_folder=${2:-$git_src_folder/$repo}
    if [ ! -d $dest_folder ]; then
        if [[ "$debug" == "False" ]]; then
            _git_timed clone --quiet ${repo_url}${repo} $dest_folder
        else
            _git_timed clone ${repo_url}${repo} $dest_folder
        fi
    else
        pushd $dest_folder
        _git_timed pull
        popd
    fi
}

# clone_repos() - Function that clones source repositories for a given project
function clone_repos {
    local project=$1
    local repo_name=${2:-$project}

    for repo in ${repos[$project]}; do
        clone_repo $repo ${src_folders[$project]}${repo#*$repo_name}
    done
}

# _install_bind() - Install bind utils
function _install_bind {
    install_packages bind9 bind9utils
}

# install_java() - Install java binaries
function install_java {
    if is_package_installed openjdk-8-jdk; then
        return
    fi
    source /etc/os-release || source /usr/lib/os-release
    case ${ID,,} in
        *suse)
        ;;
        ubuntu|debian)
            install_package software-properties-common
            add-apt-repository -y ppa:openjdk-r/ppa
        ;;
        rhel|centos|fedora)
        ;;
    esac
    update_repos

    # Remove Java 7
    uninstall_packages default-jre openjdk-7-jdk openjdk-7-jre openjdk-7-jre-headless

    install_package openjdk-8-jdk
    # ca-certificates-java is not a dependency in the Oracle JDK/JRE so this must be explicitly installed.
    /var/lib/dpkg/info/ca-certificates-java.postinst configure
}

# install_maven() - Install maven binaries
function install_maven {
    if is_package_installed maven3; then
        return
    fi
    install_java
    source /etc/os-release || source /usr/lib/os-release
    case ${ID,,} in
        *suse)
        ;;
        ubuntu|debian)
            install_package software-properties-common
            add-apt-repository -y ppa:andrei-pozolotin/maven3
        ;;
        rhel|centos|fedora)
        ;;
    esac
    update_repos
    install_package maven3

    # Remove Java 7
    uninstall_package openjdk-7-jdk

    _configure_maven
}

# _configure_docker_settings() - Configures Docker settings
function _configure_docker_settings {
    local docker_conf_backup=/tmp/docker.backup
    local docker_conf=/etc/default/docker
    local chameleonsocks_filename=chameleonsocks.sh
    local max_concurrent_downloads=${1:-3}

    cp $docker_conf $docker_conf_backup
    if [ $http_proxy ]; then
        echo "export http_proxy=$http_proxy" >> $docker_conf
    fi
    if [ $https_proxy ]; then
        echo "export https_proxy=$https_proxy" >> $docker_conf
        #If you have a socks proxy, then use that to connect to the nexus repo
        #via a redsocks container
        if [ $socks_proxy ]; then
            wget https://raw.githubusercontent.com/crops/chameleonsocks/master/$chameleonsocks_filename
            chmod 755 $chameleonsocks_filename
            socks=$(echo $socks_proxy | sed -e "s/^.*\///" | sed -e "s/:.*$//")
            port=$(echo $socks_proxy | sed -e "s/^.*://")
            PROXY=$socks PORT=$port ./$chameleonsocks_filename --install
            rm $chameleonsocks_filename
            cp $docker_conf_backup $docker_conf
        fi
    fi
    rm $docker_conf_backup

    echo "DOCKER_OPTS=\"-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock --max-concurrent-downloads $max_concurrent_downloads \"" >> $docker_conf
    usermod -aG docker $USER

    source /etc/os-release || source /usr/lib/os-release
    case ${ID,,} in
        *suse)
        ;;
        ubuntu|debian)
            service docker restart
            sleep 10
        ;;
        rhel|centos|fedora)
        ;;
    esac
}

# install_nodejs() - Download and install NodeJS
function install_nodejs {
    if is_package_installed nodejs; then
        return
    fi
    curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
    install_package nodejs

    # Update NPM to latest version
    npm install npm -g
}

# install_python() - Install Python 2.7 and other tools necessary for development.
function install_python {
    install_packages python2.7 python-dev
}

# _install_pip() - Install Python Package Manager
function _install_pip {
    install_python
    if ! which pip; then
        curl -sL https://bootstrap.pypa.io/get-pip.py | python
    fi
}

# install_python_package() - Install python modules
function install_python_package {
    local python_packages=$@

    _install_pip
    pip install $python_packages
}

# install_python_requirements() - Install a list of python modules defined in requirement.txt file
function install_python_requirements {
    local python_project_path=$1

    _install_pip
    pushd $python_project_path
    pip install -r requirements.txt
    popd
}

# install_docker() - Download and install docker-engine
function install_docker {
    if $(docker version &>/dev/null); then
        return
    fi
    source /etc/os-release || source /usr/lib/os-release
    case ${ID,,} in
        *suse)
        ;;
        ubuntu|debian)
            install_packages software-properties-common linux-image-extra-$(uname -r) linux-image-extra-virtual apt-transport-https ca-certificates curl
            curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
            add-apt-repository \
            "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
            $(lsb_release -cs) stable"
        ;;
        rhel|centos|fedora)
        ;;
    esac
    update_repos

    install_package docker-ce
    _configure_docker_settings
}

# pull_docker_image() - Pull Docker container image from the Public Docker Registry Hub
function pull_docker_image {
    install_docker
    local image=$1
    local tag=$2
    docker pull ${image}
    if [ ${tag} ]; then
        docker tag ${image} $tag
    fi
}

# run_docker_image() - Starts a Docker instance
function run_docker_image {
    install_docker
    docker run $@
}

# install_docker_compose() - Download and install docker-engine 
function install_docker_compose {
    local docker_compose_version=${1:-1.12.0}
    if [ ! -d /opt/docker ]; then
        mkdir /opt/docker
        curl -L https://github.com/docker/compose/releases/download/$docker_compose_version/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
        chmod +x /opt/docker/docker-compose
    fi
}

# _install_ODL() - Download and Install OpenDayLight SDN controller
function _install_ODL {
    if [ ! -d /opt/opendaylight/current ]; then
        mkdir -p /opt/opendaylight/
        wget "https://nexus.opendaylight.org/content/repositories/public/org/opendaylight/integration/distribution-karaf/"$odl_version"/distribution-karaf-"$odl_version".tar.gz" -P /opt/
        tar xvf "/opt/distribution-karaf-"$odl_version".tar.gz" -C /tmp/
        mv "/tmp/distribution-karaf-"$odl_version /opt/opendaylight/current
        rm -rf "/opt/distribution-karaf-"$odl_version".tar.gz"
    fi
}

# start_ODL() - Start OpenDayLight SDN controller
function start_ODL {
    _install_ODL
    if [ -d /opt/opendaylight ]; then
        export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre
        /opt/opendaylight/current/bin/start
        sleep 180
        /opt/opendaylight/current/bin/client feature:install odl-dlux-all
    fi
}

# compile_src() - Function that compiles the java source code thru maven
function compile_src {
    local src_folder=$1
    pushd $src_folder
    local mvn_build='mvn clean install -DskipTests=true -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dadditionalparam=-Xdoclint:none'
    if [[ "$debug" == "False" ]]; then
        mvn_build+=" -q"
    fi
    if [ -f pom.xml ]; then
        install_maven
        echo "Compiling $src_folder folder..."
        eval $mvn_build
    fi
    popd
}

# compile_repos() - Function that compiles source repositories for a given project
function compile_repos {
    local project=$1

    for repo in ${repos[$project]}; do
        compile_src ${src_folders[$project]}${repo#*$project}
    done
}

# build_docker_image() - Build Docker container image from source code
function build_docker_image {
    local src_folder=$1
    local profile=$2
    install_docker
    pushd $src_folder

    if [ -f pom.xml ]; then
        install_maven
        # Cleanup external repo
        sed -i 's|${docker.push.registry}/||g' pom.xml
        local docker_build="mvn clean package docker:build"
        if [ $profile ]; then
            docker_build+=" -P $profile"
        fi
        if [ $http_proxy ]; then
            if ! grep -ql "docker.buildArg.http_proxy" pom.xml ; then
                docker_build+=" -Ddocker.buildArg.http_proxy=$http_proxy"
            fi
        if ! grep -ql "docker.buildArg.HTTP_PROXY" pom.xml ; then
            docker_build+=" -Ddocker.buildArg.HTTP_PROXY=$http_proxy"
        fi
        fi
        if [ $https_proxy ]; then
            if ! grep -ql "docker.buildArg.https_proxy" pom.xml ; then
                docker_build+=" -Ddocker.buildArg.https_proxy=$https_proxy"
            fi
            if ! grep -ql "docker.buildArg.HTTPS_PROXY" pom.xml ; then
                docker_build+=" -Ddocker.buildArg.HTTPS_PROXY=$https_proxy"
            fi
        fi
    elif [ -f Dockerfile ]; then
        # NOTE: Workaround for dmmapbc images
        sed -i '/LocalKey/d' Dockerfile
        sed -i "s/nexus3.onap.org\:10003\///g" Dockerfile
        local docker_build="docker build -t $profile -f ./Dockerfile ."
        if [ $http_proxy ]; then
            docker_build+=" --build-arg http_proxy=$http_proxy"
            docker_build+=" --build-arg HTTP_PROXY=$http_proxy"
        fi
        if [ $https_proxy ]; then
            docker_build+=" --build-arg https_proxy=$https_proxy"
            docker_build+=" --build-arg HTTPS_PROXY=$https_proxy"
        fi
    fi
    echo $docker_build
    eval $docker_build
    popd
}

# mount_external_partition() - Create partition and mount the external volume
function mount_external_partition {
    local dev_name="/dev/$1"
    local mount_dir=$2

    sfdisk $dev_name << EOF
;
EOF
    mkfs -t ext4 ${dev_name}1
    mkdir -p $mount_dir
    mount ${dev_name}1 $mount_dir
    echo "${dev_name}1  $mount_dir           ext4    errors=remount-ro,noatime,barrier=0 0       1" >> /etc/fstab
}
