You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by sm...@apache.org on 2019/05/10 20:09:22 UTC

[geode-benchmarks] branch develop updated: Make expire_clusters.sh executable from anywhere. (#82)

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

smgoller pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-benchmarks.git


The following commit(s) were added to refs/heads/develop by this push:
     new 707133a  Make expire_clusters.sh executable from anywhere. (#82)
707133a is described below

commit 707133adfedd3a4f9fb2523b54391031f42f06dd
Author: Sean Goller <se...@goller.net>
AuthorDate: Fri May 10 13:09:18 2019 -0700

    Make expire_clusters.sh executable from anywhere. (#82)
---
 infrastructure/scripts/aws/expire_clusters.sh | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/infrastructure/scripts/aws/expire_clusters.sh b/infrastructure/scripts/aws/expire_clusters.sh
index 3b1ad9d..a0329a0 100755
--- a/infrastructure/scripts/aws/expire_clusters.sh
+++ b/infrastructure/scripts/aws/expire_clusters.sh
@@ -16,13 +16,21 @@
 # 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.
+SOURCE="${BASH_SOURCE[0]}"
+while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
+  SCRIPTDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
+  SOURCE="$(readlink "$SOURCE")"
+  [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
+done
+SCRIPTDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
 
 set -e
 
 if [[ -z "${AWS_ACCESS_KEY_ID}" ]]; then
   export AWS_PROFILE="geode-benchmarks"
 fi
-
+pushd ${SCRIPTDIR}
 pushd ../../../
 ./gradlew expireClusters
 popd
+popd