SOLR-14704 add download option to cloud.sh (#1715)

This commit is contained in:
Gus Heck 2020-09-04 09:39:23 -04:00 committed by GitHub
parent d31a42763b
commit 65da5ed32c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 8 deletions

View File

@ -25,6 +25,7 @@
# -n <num> number of nodes to create/start if this doesn't match error
# -w <path> path to the vcs checkout
# -z <num> port to look for zookeeper on (2181 default)
# -d <url> Download solr tarball from this URL
#
# Commands:
# new Create a new cluster named by the current date or [name]
@ -109,7 +110,7 @@ NUM_NODES=0 # need to detect if not specified
VCS_WORK=${DEFAULT_VCS_WORKSPACE}
ZK_PORT=2181
while getopts ":crm:a:n:w:z:" opt; do
while getopts ":crm:a:n:w:z:d:" opt; do
case ${opt} in
c)
CLEAN=true
@ -132,6 +133,9 @@ while getopts ":crm:a:n:w:z:" opt; do
z)
ZK_PORT=$OPTARG
;;
d)
SMOKE_RC_URL=$OPTARG
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
@ -267,17 +271,20 @@ recompileIfReq() {
# Copy tarball #
################
copyTarball() {
echo "foo"
pushd ${CLUSTER_WD}
echo "bar"
rm -rf solr-* # remove tarball and dir to which it extracts
echo "baz"
pushd # back to original dir to properly resolve vcs working dir
echo "foobar:"$(pwd)
if [[ ! -f $(ls "$VCS_WORK"/solr/package/solr-*.tgz) ]]; then
echo "No solr tarball found try again with -r"; popd; exit 10;
if [ ! -z "$SMOKE_RC_URL" ]; then
pushd ${CLUSTER_WD}
RC_FILE=$(echo "${SMOKE_RC_URL}" | rev | cut -d '/' -f 1 | rev)
curl -o "$RC_FILE" "$SMOKE_RC_URL"
pushd
else
if [[ ! -f $(ls "$VCS_WORK"/solr/package/solr-*.tgz) ]]; then
echo "No solr tarball found try again with -r"; popd; exit 10;
fi
cp "$VCS_WORK"/solr/package/solr-*.tgz ${CLUSTER_WD}
fi
cp "$VCS_WORK"/solr/package/solr-*.tgz ${CLUSTER_WD}
pushd # back into cluster wd to unpack
tar xzvf solr-*.tgz
popd