You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by jb...@apache.org on 2019/02/28 17:57:23 UTC

[geode-benchmarks] branch develop updated: Adds copy to cluster script

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

jbarrett 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 49cd866  Adds copy to cluster script
49cd866 is described below

commit 49cd866ec6dcb2aebc25817520fd3f2299ed8c13
Author: Jacob Barrett <jb...@pivotal.io>
AuthorDate: Thu Feb 28 09:06:17 2019 -0800

    Adds copy to cluster script
---
 infrastructure/scripts/aws/copy_to_cluster.sh | 64 +++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)

diff --git a/infrastructure/scripts/aws/copy_to_cluster.sh b/infrastructure/scripts/aws/copy_to_cluster.sh
new file mode 100755
index 0000000..0758560
--- /dev/null
+++ b/infrastructure/scripts/aws/copy_to_cluster.sh
@@ -0,0 +1,64 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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.
+
+set -o pipefail
+
+BENCHMARK_REPO='https://github.com/apache/geode-benchmarks'
+BENCHMARK_BRANCH='develop'
+
+REPO='https://github.com/apache/geode'
+
+while getopts ":t:h" opt; do
+  case ${opt} in
+    t )
+      TAG=$OPTARG
+      ;;
+    h )
+      echo "Usage: $(basename "$0") -t tag [--] source_file ... target_directory"
+      echo "Options:"
+      echo "-t : Cluster tag"
+      echo "-h : This help message"
+      exit 1
+      ;;
+    \? )
+      echo "Invalid option: $OPTARG" 1>&2
+      ;;
+    : )
+      echo "Invalid option: $OPTARG requires an argument" 1>&2
+      ;;
+  esac
+done
+shift $((OPTIND -1))
+
+if [ -z "${TAG}" ]; then
+  echo "--tag argument is required."
+  exit 1
+fi
+
+if [[ -z "${AWS_ACCESS_KEY_ID}" ]]; then
+  export AWS_PROFILE="geode-benchmarks"
+fi
+
+SSH_OPTIONS="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ~/.ssh/geode-benchmarks/${TAG}.pem"
+HOSTS=`aws ec2 describe-instances --query 'Reservations[*].Instances[*].PublicIpAddress' --filter "Name=tag:geode-benchmarks,Values=${TAG}" --output text`
+
+for host in ${HOSTS}; do
+  echo "Copying to ${host}."
+  scp ${SSH_OPTIONS} ${@: 1:$#-1} geode@${host}:${@: -1}
+done