From 6d6736bf917a63579ef047f1ac68a3ac1bc5e00a Mon Sep 17 00:00:00 2001 From: Guido Trotter Date: Mon, 26 Jan 2009 10:34:30 +0000 Subject: [PATCH] Add devel/upload script This eases development/debugging of the os script. It's mostly copied from its ganeti counterpart. Reviewed-by: iustinp --- devel/upload | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 64 insertions(+), 0 deletions(-) create mode 100755 devel/upload diff --git a/devel/upload b/devel/upload new file mode 100755 index 0000000..5205840 --- /dev/null +++ b/devel/upload @@ -0,0 +1,64 @@ +#!/bin/bash + +# Copyright (C) 2006, 2007 Google Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# This is a test script to ease development and testing on test clusters. +# It should not be used to update production environments. + +# Usage: upload node-{1,2,3} + +set -e + +hosts= +while [ "$#" -gt 0 ]; do + opt="$1" + case "$opt" in + -h|--help) + echo "Usage: $0 hosts..." + exit 0 + ;; + -*) + echo "Unknown option: $opt" >&2 + exit 1 + ;; + *) + hosts="$hosts $opt" + ;; + esac + shift +done + +set ${hosts} + +TXD=`mktemp -d` +trap 'rm -rf $TXD' EXIT + +# install the os as a real tree +make install DESTDIR="$TXD" + +echo --- + +( cd "$TXD" && find; ) + +echo --- + +for host; do + echo Uploading code to ${host}... + rsync -v -rlDc ${TXD}/* root@${host}:/ & +done + -- 1.7.2.5