aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/editions.sh
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2018-05-24 16:00:06 +0200
committerSonarTech <sonartech@sonarsource.com>2018-06-12 20:20:59 +0200
commit4264ca3f1c21187231007c084844b223a84137d4 (patch)
treef2b55ddc65eebcb4e29b535983ad082acb0b70b5 /scripts/editions.sh
parentded90fa8efaec6c497b066500e1d0f4dc531e4d5 (diff)
downloadsonarqube-4264ca3f1c21187231007c084844b223a84137d4.tar.gz
sonarqube-4264ca3f1c21187231007c084844b223a84137d4.zip
SONAR-10690 start.sh, stop.sh & logs.sh support SQ editions
Diffstat (limited to 'scripts/editions.sh')
-rwxr-xr-xscripts/editions.sh61
1 files changed, 61 insertions, 0 deletions
diff --git a/scripts/editions.sh b/scripts/editions.sh
new file mode 100755
index 00000000000..7913f8fec9a
--- /dev/null
+++ b/scripts/editions.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+
+set -euo pipefail
+
+DEFAULT_EDITION="oss"
+EDITIONS="oss"
+
+function toLower() {
+ echo "$1" | tr '[:upper:]' '[:lower:]'
+}
+
+function checkEditionArgument() {
+ local editionArg="$1"
+ local lowerEditionArg=$(toLower $editionArg)
+
+ if [ "$lowerEditionArg" == "$DEFAULT_EDITION" ]; then
+ return
+ fi
+
+ for t in $EDITIONS; do
+ if [ "$lowerEditionArg" == "$t" ]; then
+ return
+ fi
+ done
+
+ echo "Unsupported edition $editionArg"
+ exit 1
+}
+
+function distributionDirOf() {
+ local edition="$1"
+
+ if [ "$edition" = "oss" ]; then
+ echo "sonar-application/build/distributions/"
+ else
+ echo "unsupported edition $edition"
+ exit 1
+ fi
+}
+
+function baseFileNameOf() {
+ local edition="$1"
+
+ if [ "$edition" = "oss" ]; then
+ echo "sonar-application"
+ else
+ echo "unsupported edition $edition"
+ exit 1
+ fi
+}
+
+function targetDirOf() {
+ local edition="$1"
+
+ if [ "$edition" = "oss" ]; then
+ echo "sonarqube-oss"
+ else
+ echo "unsupported edition $edition"
+ exit 1
+ fi
+}