You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by gu...@apache.org on 2021/02/18 00:55:09 UTC

[lucene-solr] branch branch_8x updated: SOLR-14704 add download option to cloud.sh (#1715), also ensure lucene libs exist (#2394)

This is an automated email from the ASF dual-hosted git repository.

gus pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8x by this push:
     new 2e97a7a  SOLR-14704 add download option to cloud.sh (#1715), also ensure lucene libs exist (#2394)
2e97a7a is described below

commit 2e97a7a510efb5ef4dd04afeae060b835a6187e1
Author: Gus Heck <46...@users.noreply.github.com>
AuthorDate: Wed Feb 17 19:54:47 2021 -0500

    SOLR-14704 add download option to cloud.sh (#1715), also ensure lucene libs exist (#2394)
    
    (cherry picked from commit 65da5ed32c940529b27a518deb8ffd1e61aa2e96)
---
 solr/cloud-dev/cloud.sh | 29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/solr/cloud-dev/cloud.sh b/solr/cloud-dev/cloud.sh
index 3b6d710..ba79588 100644
--- a/solr/cloud-dev/cloud.sh
+++ b/solr/cloud-dev/cloud.sh
@@ -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
@@ -253,6 +257,12 @@ cleanIfReq() {
 #################################
 recompileIfReq() {
   if [[ "$RECOMPILE" = true ]]; then
+    pushd "$VCS_WORK"/lucene
+    ant clean package-all-binary
+    if [[ "$?" -ne 0 ]]; then
+      echo "BUILD FAIL - cloud.sh stopping, see above output for details"; popd; exit 7;
+    fi
+    popd
     pushd "$VCS_WORK"/solr
     ant clean server create-package
     if [[ "$?" -ne 0 ]]; then
@@ -267,17 +277,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