gerlowskija commented on code in PR #124:
URL: https://github.com/apache/solr-sandbox/pull/124#discussion_r2407656835


##########
scripts/gatling/lib/solr.sh:
##########
@@ -0,0 +1,66 @@
+#!/bin/bash
+
+function solr_checkout_source_in() {
+  if [[ -z $1 ]]; then
+    >&2 echo "Required argument 'location' was not provided"
+    return 1
+  fi
+
+  local location=$1
+  if [[ -d $location/solr ]]; then
+    # The checkout already exists I guess?
+    return 0
+  fi
+
+  pushd $location
+    git clone [email protected]:apache/solr.git
+  popd
+}
+
+# Returns with an exit status indicating whether Solr is (or isn't)
+# running at the specified port.  Callers provide the port as a required
+# argument.  Assumes that the wording directory is positioned so that
+# 'bin/solr' can be invoked.
+#   Usage: solr_is_running 8983
+function solr_is_running() {
+  if [[ -z ${1:-} ]]; then
+    >&2 echo "Required argument 'port' was not provided"
+    return 1
+  fi
+
+  local port=$1
+  bin/solr assert --started "http://localhost:$port/solr";
+  return $?
+}
+
+function solr_kill_all() {
+  ps -ef | grep solr | grep java | awk {'print $2'} | xargs kill -9
+}
+
+# Start Solr (with custom ops pulled from START_SOLR_OPTS)
+# Assumes cwd of the Solr package root
+function solr_start() {
+  bin/solr start ${START_SOLR_OPTS:-}

Review Comment:
   Yeah, that's why the current version omits the '-c'; I've mostly been 
testing on `main`.
   
   For now I've tweaked the command so that we try both with and without the 
`-c` before erroring out.  We'll want a better solution to these types of Solr 
major version syntax differences at some point, but I'm going to punt on 
figuring out that better solution now.  Hopefully as we see more of these types 
of things we'll get a better sense of what that should look like.
   
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to