Return-Path: X-Original-To: apmail-brooklyn-commits-archive@minotaur.apache.org Delivered-To: apmail-brooklyn-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DB34817211 for ; Sat, 27 Sep 2014 19:09:12 +0000 (UTC) Received: (qmail 11342 invoked by uid 500); 27 Sep 2014 19:09:12 -0000 Delivered-To: apmail-brooklyn-commits-archive@brooklyn.apache.org Received: (qmail 11321 invoked by uid 500); 27 Sep 2014 19:09:12 -0000 Mailing-List: contact commits-help@brooklyn.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.incubator.apache.org Delivered-To: mailing list commits@brooklyn.incubator.apache.org Received: (qmail 11312 invoked by uid 99); 27 Sep 2014 19:09:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 27 Sep 2014 19:09:12 +0000 X-ASF-Spam-Status: No, hits=-1999.8 required=5.0 tests=ALL_TRUSTED,HK_RANDOM_FROM,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 27 Sep 2014 19:09:11 +0000 Received: (qmail 11203 invoked by uid 99); 27 Sep 2014 19:08:51 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 27 Sep 2014 19:08:51 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id D9EE89B7783; Sat, 27 Sep 2014 19:08:50 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: grkvlt@apache.org To: commits@brooklyn.incubator.apache.org Date: Sat, 27 Sep 2014 19:08:52 -0000 Message-Id: <140bf883ff704dd0a5f340ea7ccdb513@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [3/8] git commit: Add version option to install script X-Virus-Checked: Checked by ClamAV on apache.org Add version option to install script Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/8b56cd76 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/8b56cd76 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/8b56cd76 Branch: refs/heads/master Commit: 8b56cd76042c43abc3d349edd0f82d434d6fd9e1 Parents: b79e830 Author: Andrew Kennedy Authored: Wed Sep 24 20:12:11 2014 +0100 Committer: Andrew Kennedy Committed: Wed Sep 24 20:12:11 2014 +0100 ---------------------------------------------------------------------- brooklyn-install.sh | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/8b56cd76/brooklyn-install.sh ---------------------------------------------------------------------- diff --git a/brooklyn-install.sh b/brooklyn-install.sh index 179b6a0..137d20b 100755 --- a/brooklyn-install.sh +++ b/brooklyn-install.sh @@ -18,7 +18,7 @@ # Brooklyn remote install script. # # Usage: -# brooklyn-install.sh [-h] [-q] [-s] [-e] [-u user] [-k key] [-r root] [-p port] hostname +# brooklyn-install.sh [-h] [-q] [-s] [-e] [-u user] [-k key] [-r root] [-p port] [-v version] hostname # #set -x # DEBUG @@ -30,20 +30,23 @@ Brooklyn remote install script. Options -q Quiet install - -s Create and set up user account + -s Create and set up user account (set with -u option) -e Set up random entropy for SSH -u Change the Brooklyn username (default 'brooklyn') -r Change the remote root username (default 'root') -k The private key to use for SSH (default '~/.ssh/id_rsa') -p The SSH port to connect to (default 22) + -v Set the Brooklyn version to install (default '0.7.0-M1') Usage - brooklyn-install.sh [-q] [-s] [-e] [-u user] [-r root] [-k key] [-p port] hostname + brooklyn-install.sh [-q] [-s] [-e] [-u user] [-r root] [-k key] [-p port] [-v version] hostname Installs Brooklyn on the given hostname as 'brooklyn' or the specified -user. Optionally it creates and configures the Brooklyn user. -Passwordless SSH access as root to the remote host must be enabled with the given key. +user. Optionally it creates and configures the Brooklyn user. + +Passwordless SSH access as 'root' (or a user that has 'sudo' privileges) to the +remote host must be available, with the given key. EOF exit 0 @@ -73,7 +76,7 @@ function error() { } function usage() { - echo "Usage: $(basename ${0}) [-h] [-q] [-s] [-e] [-u user] [-r root] [-k key] [-p port] hostname" + echo "Usage: $(basename ${0}) [-h] [-q] [-s] [-e] [-u user] [-r root] [-k key] [-p port] [-v version] hostname" exit 1 } @@ -86,7 +89,7 @@ function retry() { while [[ $n -le $MAX_ATTEMPTS ]]; do eval "${1}" 2>&1 RESULT=$? - if [[ $RESULT -eq 0 ]]; then + if [[ $RESULT -eq 0 ]]; then return 0 fi log "waiting ${INTERVAL} before next retry [${n} of ${MAX_ATTEMPTS}]" @@ -102,7 +105,7 @@ BROOKLYN_VERSION="0.7.0-M1" SSH=ssh ROOT=root -while getopts ":hqseu:r:k:p:" o; do +while getopts ":hqseu:r:k:p:v:" o; do case "${o}" in h) help ;; @@ -119,7 +122,9 @@ while getopts ":hqseu:r:k:p:" o; do k) PRIVATE_KEY_FILE="${OPTARG}" ;; p) PORT="${OPTARG}" - ;; + ;; + v) BROOKLYN_VERSION="${OPTARG}" + ;; *) usage "Invalid option: $*" ;; esac @@ -253,7 +258,7 @@ ssh ${SSH_OPTS} ${USER}@${HOST} "cat > .brooklyn/catalog.xml" < Deploys a Nodejs TODO application around the world classpath://nodejs-logo.png - +