#!/usr/bin/env bash
# ============LICENSE_START=======================================================
#  Copyright (C) 2018-2019 Nordix 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.
#
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
set -o nounset
set -o errexit
set -o pipefail
#set -o xtrace

# Set build tools versions base on the:
# https://github.com/apache/geode-native/blob/develop/docker/Dockerfile
CLANG_VERSION="6.0.1"
GEODE_VERSION="1.10.0"
RAT_VERSION="0.13"
CMAKE_VERSION="3.12.2"

# Additional repositories and build 3PPs
CLANG_SLES_REPO="https://download.opensuse.org/repositories/devel:/languages:/swift/SLE_15/"
GAMES_SLES_REPO="https://download.opensuse.org/repositories/games/SLE_15_SP1/"
GEODE_LOCATION="https://www.apache.org/dyn/closer.cgi?action=download&filename=geode/${GEODE_VERSION}/apache-geode-${GEODE_VERSION}.tgz"
RAT_LOCATION="https://www.apache.org/dyn/closer.cgi?action=download&filename=creadur/apache-rat-${RAT_VERSION}/apache-rat-${RAT_VERSION}-bin.tar.gz"
CMAKE_LOCATION="https://cmake.org/files/v${CMAKE_VERSION%.*}/cmake-${CMAKE_VERSION}-Linux-x86_64.sh"

install_dev_packages() {
  # Add Swift repository with clang6 compiler.
  if ! zypper lr -n | egrep Swift-Programming-Language > /dev/null ; then
    sudo zypper addrepo ${CLANG_SLES_REPO} "Swift-Programming-Language(SLES_15)"
  fi
  # Add Games repository with libjsoncpp library.
  if ! zypper lr -n | egrep Games > /dev/null ; then
    sudo zypper addrepo ${GAMES_SLES_REPO} "Games(SLE_15_SP1)"
  fi

  echo "Info: Upgrade SLES and install all available patches"
  echo "-------------------------------------------------------------"
  sudo zypper --gpg-auto-import-keys refresh ; sudo zypper update -y
  sudo zypper -q patches

  echo "Info: Install clang development environment"
  echo "-------------------------------------------------------------"
  sudo zypper install -y \
    libc++-devel \
    libc++abi-devel \
    libopenssl-devel \
    zlib-devel \
    clang${CLANG_VERSION:0:1} \
    clang${CLANG_VERSION:0:1}-checker \
    clang${CLANG_VERSION:0:1}-devel \
    gcc \
    make \
    patch \
    doxygen \
    git \
    graphviz \
    java-1_8_0-openjdk-devel \
    wget

  if [[ ! -L /etc/alternatives/clang ]] ; then
    sudo update-alternatives --install /usr/bin/clang  clang  /usr/bin/clang-${CLANG_VERSION} 999
  fi
  if [[ ! -L /etc/alternatives/clang++ ]] ; then
    sudo update-alternatives --install /usr/bin/clang++  clang++  /usr/bin/clang++-${CLANG_VERSION} 999
  fi
  if [[ ! -L /etc/alternatives/clang-tidy ]] ; then
    sudo update-alternatives --install /usr/bin/clang-tidy  clang-tidy  /usr/bin/clang-tidy-${CLANG_VERSION} 999
  fi
  if [[ ! -L /etc/alternatives/cc ]] ; then
    sudo update-alternatives --install /usr/bin/cc  cc  /usr/bin/clang-${CLANG_VERSION} 999
  fi
  if [[ ! -L /etc/alternatives/cc++ ]] ; then
    sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-${CLANG_VERSION} 999
  fi
}

configure_geode_build() {
  echo "Info: Install 3PPs required to build geode-native"
  echo "-------------------------------------------------------------"
  # The Geode is required on build server to compile geode-native
  if [[ ! -d /opt/apache-geode-${GEODE_VERSION} ]] ; then
    wget ${GEODE_LOCATION} -O - | sudo tar xzvf - -C /opt
  else
    echo "The Geode ${GEODE_VERSION} already installed."
  fi
  echo "-------------------------------------------------------------"

  # The Rat (Apache Release Audit Tool) is required to compile geode-native
  if [[ ! -d /opt/apache-rat-${RAT_VERSION} ]] ; then
    wget ${RAT_LOCATION} -O - | sudo tar xzvf - -C /opt
  else
    echo "The Apache RAT ${RAT_VERSION} already installed."
  fi
  echo "-------------------------------------------------------------"

  # cmake is required to generate a build system for geode-native
  if [[ ! -f /usr/local/bin/cmake ]] ; then
    wget ${CMAKE_LOCATION} -O /tmp/cmake
    sudo bash /tmp/cmake --skip-license --prefix=/usr/local
    rm -rf /tmp/cmake
  elif ! /usr/local/bin/cmake -version | grep -q ${CMAKE_VERSION} ; then
    echo "ERROR: Incorrect cmake version installed"
    exit 3
  else
    echo "The CMAKE ${CMAKE_VERSION} already installed."
  fi

  # Export 3PPs location for geode-native build
  export JAVA_HOME="/usr/lib64/jvm/java-openjdk"
  export GEODE_HOME="/opt/apache-geode-${GEODE_VERSION}"
  export RAT_HOME="/opt/apache-rat-${RAT_VERSION}"
  export PATH="$PATH:$GEODE_HOME/bin"

  # Update hosts file with ip6-localhost required by geode-native Integration tests
  sudo sed  -i '/ipv6-loopback$/s/$/ ip6-localhost/' /etc/hosts
}

get_geode_build_docker_image() {
  echo "Info: Start and enable docker on system"
  echo "-------------------------------------------------------------"
  sudo systemctl enable docker
  sudo systemctl start docker
  echo "Info: Remove all previous stopped docker containers and images"
  echo "-------------------------------------------------------------"
  sudo docker container prune -f
  sudo docker image prune -f
  echo "Info: Get the latest geode-native build docker image"
  echo "-------------------------------------------------------------"
  docker pull ${GEODE_NATIVE_DOCKER_IMAGE:-apachegeode/geode-native-build}
}

# Make sure the build server is SLES15 based
source /etc/os-release
case ${ID,,} in
  sles)
    if [[ "${VERSION}" != "15" ]] ; then
      echo "ERROR: Incorrect version on SLES on the build server: ${VERSION}"
      exit 1
    else
      install_dev_packages
      configure_geode_build
      get_geode_build_docker_image
    fi
  ;;
  ubuntu)
    DPKG_LOCK="/var/lib/dpkg/lock-frontend"
    # Wait for other apt process to finish by checking the dpkg lock file.
    try=0
    while sudo lsof ${DPKG_LOCK}  > /dev/null 2>&1 ; do
      echo "DPKG file locked: ${DPKG_LOCK}."
      echo "   Waiting for another pkg instalaltion process to finish ..."
      sleep 10
      if [[ ${try} -gt 60 ]] ; then
        echo "ERROR: Max number of re-tries reached, exiting..."
        exit 1
      fi
      try=$((try + 1))
    done
    get_geode_build_docker_image
  ;;
  *)
    echo "ERROR: Only SLES15 and Ubuntu OS can be use as a build server geode-native"
    exit 2
  ;;
esac
