pgj commented on code in PR #62:
URL: https://github.com/apache/couchdb-ci/pull/62#discussion_r1383883215


##########
bin/install-clouseau.sh:
##########
@@ -0,0 +1,129 @@
+#!/usr/bin/env bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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.
+
+# stop on error
+set -e
+
+CLOUSEAU_VSN=${CLOUSEAU_VERSION:-2.22.0}
+CLOUSEAU_DIST=https://github.com/cloudant-labs/clouseau/releases/download/"${CLOUSEAU_VSN}"/clouseau-"${CLOUSEAU_VSN}"-dist.zip
+
+# Dependencies:
+# - SLF4J Provider
+SLF4J_VSN=${SLF4J_VERSION:-1.6.1}
+SLF4J_SIMPLE_JAR=https://repo1.maven.org/maven2/org/slf4j/slf4j-simple/"${SLF4J_VSN}"/slf4j-simple-"${SLF4J_VSN}".jar
+# - JDK
+ZULU_VSN=${ZULU_VERSION:-7.56.0.11-ca-jdk7.0.352}
+ZULU_PLATFORM=${ZULU_ARCH:-linux_x64}
+ZULU_DIST=https://static.azul.com/zulu/bin/zulu"${ZULU_VSN}"-"${ZULU_PLATFORM}".tar.gz
+
+SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+# Zulu 7 requires x86_64
+case "${ARCH}" in
+    x86_64)
+       ;;
+    *)
+       echo "Clouseau cannot run on ${ARCH} hence it will not be installed"
+       exit 0
+       ;;
+esac
+
+# Check if running as root
+if [[ ${EUID} -ne 0 ]]; then
+    echo "Sorry, this script must be run as root."
+    echo "Try: sudo $0 $*"
+    exit 1
+fi
+
+function ensure_tool() {
+    _tool="$1"
+
+    if ! type "${_tool}" > /dev/null 2>&1; then
+       echo "Please install `${_tool}`"
+       exit 1
+    fi
+}
+
+function download() {
+    _output="$1"
+    _url="$2"
+
+    wget -q --max-redirect=1 -O "${_output}" "${_url}"

Review Comment:
   For what it is worth, first I wanted to use `curl` but then saw in 
`install-elixir.sh` that `wget` is in use.  In parallel to that, I was trying 
to make those two scripts similar so that their common parts could be factored 
out into a shared library.  But yeah, sure, I can switch to `curl` there, maybe 
we could do the same to `install-elixir.sh` later on.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to