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


##########
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:
   ```suggestion
     bin/solr start -c ${START_SOLR_OPTS:-}
   ```



-- 
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