Skip to content
Snippets Groups Projects
Commit 564dc59b authored by rds's avatar rds
Browse files

messages during running...

parent affbe9d7
No related branches found
No related tags found
No related merge requests found
......@@ -14,13 +14,14 @@ CVS_CHECKOUT_SCRIPT=./build_bootstrap.sh
GLOBAL_LOG=~/BUILDS/latest.build.log
ERROR_RECIPIENT=zmapdev@sanger.ac.uk
ENSURE_UP_TO_DATE=yes
SLEEP=15
# For development make sure these are set
#CVS_CHECKOUT_SCRIPT=./build_bootstrap.sh
#GLOBAL_LOG=~/BUILDS/OVERNIGHT.BUILD.LOG
#ERROR_RECIPIENT=
#ENSURE_UP_TO_DATE=no
#SLEEP=1
# ================== MAIN PART ==================
if ! echo $GLOBAL_LOG | egrep -q "(^)/" ; then
GLOBAL_LOG=$(pwd)/$GLOBAL_LOG
......@@ -28,20 +29,79 @@ fi
rm -f $GLOBAL_LOG
# make sure a couple of things are sane.
SCRIPT_NAME=$(basename $0)
INITIAL_DIR=$(pwd)
SCRIPT_DIR=$(dirname $0)
if ! echo $SCRIPT_DIR | egrep -q "(^)/" ; then
BASE_DIR=$INITIAL_DIR/$SCRIPT_DIR
else
BASE_DIR=$SCRIPT_DIR
fi
if ! echo $CVS_CHECKOUT_SCRIPT | egrep -q "(^)/" ; then
CVS_CHECKOUT_SCRIPT=$INITIAL_DIR/$SCRIPT_DIR/$CVS_CHECKOUT_SCRIPT
fi
# ================== RUN INFO ==================
cat <<EOF
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Welcome to the '$0' build script
We are running on '$(hostname)' and are going to run on the
bootstrap build script '$CVS_CHECKOUT_SCRIPT'
on '$SRC_MACHINE' (via ssh).
The global output log is '$GLOBAL_LOG'
Errors will be reported to '$ERROR_RECIPIENT'
EOF
# If we need to update from cvs...
if [ "x$ENSURE_UP_TO_DATE" == "xyes" ]; then
old_dir=$(pwd)
new_dir=$(dirname $CVS_CHECKOUT_SCRIPT)
up2date=$(basename $CVS_CHECKOUT_SCRIPT)
cd $new_dir
export CVS_RSH=ssh
cat <<EOF
Now we are going to cvs update '$CVS_CHECKOUT_SCRIPT' in $(pwd)
EOF
cvs update -C $up2date || { echo "Failed to update $CVS_CHECKOUT_SCRIPT"; exit 1; }
cd $old_dir
echo "cvs updated."
fi
[ ! -f $CVS_CHECKOUT_SCRIPT ] || { echo "Failed to find $CVS_CHECKOUT_SCRIPT"; exit 1; }
[ -f $CVS_CHECKOUT_SCRIPT ] || { echo "Failed to find $CVS_CHECKOUT_SCRIPT"; exit 1; }
cat <<EOF
After a short pause ($SLEEP seconds), we'll begin.
First some questions:
Does password-less ssh login work?
Have you committed all your code?
Have you tested it?
[last opportunity to hit Ctrl-C]...
EOF
sleep $SLEEP
# A one step copy, run, cleanup!
cat $CVS_CHECKOUT_SCRIPT | ssh $SRC_MACHINE '/bin/bash -c "\
cat $CVS_CHECKOUT_SCRIPT | ssh zmap@$SRC_MACHINE '/bin/bash -c "\
function _rm_exit \
{ \
echo Master Script Failed...; \
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment