DEFAULT_EDITION="oss"
EDITIONS="oss"
-function toLower() {
+toLower() {
echo "$1" | tr '[:upper:]' '[:lower:]'
}
-function checkEditionArgument() {
+checkEditionArgument() {
local editionArg="$1"
local lowerEditionArg=$(toLower $editionArg)
exit 1
}
-function distributionDirOf() {
+distributionDirOf() {
local edition="$1"
if [ "$edition" = "oss" ]; then
fi
}
-function baseFileNameOf() {
+baseFileNameOf() {
local edition="$1"
if [ "$edition" = "oss" ]; then
fi
}
-function targetDirOf() {
+targetDirOf() {
local edition="$1"
if [ "$edition" = "oss" ]; then
set -euo pipefail
-function clean() {
+clean() {
rm -Rf $BUILD_DIR
}
-function createPrivateClone() {
+createPrivateClone() {
BRANCH=$(git symbolic-ref -q HEAD)
BRANCH=${BRANCH##refs/heads/}
BRANCH=${BRANCH:-HEAD}
cd ${BUILD_DIR}${RELATIVE_PATH}
}
-function showHelp() {
+showHelp() {
echo "Usage: $0 -d DIR_PATH [ -l integer ] [ -h URL ] [ -u string ] [ -p string ]
-d : path to directory where batch report bumpds will be created
-l : number of commit in the past (optional: default is $HISTORY_LENGTH)
-p : password to authentication on the SQ instance (optional: default is $SONAR_USER)"
}
-function checkOptions() {
+checkOptions() {
if [[ -z "$DUMP_DIR" ]]; then
>&2 echo "-d option is mandatory"
showHelp
DEFAULT_LINES="25"
LOGS="sonar web ce es"
-function toLower() {
+toLower() {
echo "$1" | tr '[:upper:]' '[:lower:]'
}
-function checkLogArgument() {
+checkLogArgument() {
local logArg="$1"
local lowerLogArg=$(toLower $logArg)
exit 1
}
-function buildTailArgs() {
+buildTailArgs() {
local logArg="$(toLower $1)"
local logLines="$2"
local res=""
echo "$res"
}
-function doTail() {
+doTail() {
local logArg="$1"
local logLines="${2:-"$DEFAULT_LINES"}"
TAIL_ARG=$(buildTailArgs "$logArg" "$logLines")
set -euo pipefail
-function cnt_lines {
+cnt_lines() {
local FILE=$1
wc -l < "$FILE"
}
-function write_prop {
+write_prop() {
local PROPERTY=$1
local VALUE=$2
local FILE=$3
echo "${PROPERTY}=${VALUE}" >> "$FILE"
}
-function set_property {
+set_property() {
local PROPERTY=$1
local VALUE=$2
local FILE=$3
OS='linux-x86-64'
fi
-function stopAny() {
+stopAny() {
for edition in $EDITIONS; do
SONAR_SH="$(distributionDirOf "$edition")/$(targetDirOf "$edition")/sonarqube-*/bin/$OS/sonar.sh"
if ls $SONAR_SH &> /dev/null; then
# JDK is kept in cache. It does not need to be downloaded from Oracle
# at each build.
#
-function installJdk8 {
+installJdk8() {
echo "Setup JDK 1.8u171"
mkdir -p ~/jvm
pushd ~/jvm > /dev/null
#
# Configure Maven settings and install some script utilities
#
-function configureTravis {
+configureTravis() {
mkdir -p ~/.local
curl -sSL https://github.com/SonarSource/travis-utils/tarball/v47 | tar zx --strip-components 1 -C ~/.local
source ~/.local/bin/install
#
# Travis fails on timeout when build does not print logs
-# during 10 minutes. This function aims to bypass this
+# during 10 minutes. This aims to bypass this
# behavior when building the slow sonar-server sub-project.
#
-function keep_alive() {
+keep_alive() {
while true; do
echo -en "\a"
sleep 60