Add some comments to deploySICS.sh
This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# $Revision: 1.28.10.1 $
|
|
||||||
# $Date: 2010-01-27 03:15:13 $
|
|
||||||
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
||||||
# Last revision by $Author: jgn $
|
# Author: Douglas Clowes (dcl@ansto.gov.au)
|
||||||
|
|
||||||
# Deploys SICServer and configuration files to
|
# Deploys SICServer and configuration files to
|
||||||
# an instrument control computer.
|
# an instrument control computer.
|
||||||
@@ -54,8 +52,10 @@ copy_server_config() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Set shell matches to be case insensitive
|
||||||
shopt -s nocasematch
|
shopt -s nocasematch
|
||||||
|
|
||||||
|
# If the first argument is "-n" then it is a dry-run only
|
||||||
if [[ "$1" = "-n" ]]
|
if [[ "$1" = "-n" ]]
|
||||||
then
|
then
|
||||||
DEPLOY="NO"
|
DEPLOY="NO"
|
||||||
@@ -64,12 +64,17 @@ else
|
|||||||
DEPLOY="YES"
|
DEPLOY="YES"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If the wrong number of arguments is given, print usage info and exit
|
||||||
if [ $# -eq 0 -o $# -gt 3 ]
|
if [ $# -eq 0 -o $# -gt 3 ]
|
||||||
then
|
then
|
||||||
usage
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Allow test/animal or animal/test or just animal
|
||||||
|
# animal produces TESTING=".", INSTRUMENT=animal
|
||||||
|
# test/animal produces TESTING=test, INSTRUMENT=animal
|
||||||
|
# animal/test produces TESTING=animal, INSTRUMENT=test (we then swap them)
|
||||||
TESTING=$(dirname "$1")
|
TESTING=$(dirname "$1")
|
||||||
INSTRUMENT=$(basename "$1")
|
INSTRUMENT=$(basename "$1")
|
||||||
if [[ "$INSTRUMENT" = "test" ]]
|
if [[ "$INSTRUMENT" = "test" ]]
|
||||||
@@ -81,7 +86,10 @@ fi
|
|||||||
SRCDIR="."
|
SRCDIR="."
|
||||||
TEMPDIR=$HOME/tmp
|
TEMPDIR=$HOME/tmp
|
||||||
|
|
||||||
|
# We allow the instrument to be specified as either the animal name or the
|
||||||
|
# mnemonic as we have to map between the two. This is because the source
|
||||||
|
# directory is named by the mnemonic and the destination directory is named by
|
||||||
|
# the animal. Any instrument-specific processing should be done within the case.
|
||||||
|
|
||||||
# Set the destination host
|
# Set the destination host
|
||||||
# instrument name and the
|
# instrument name and the
|
||||||
@@ -138,8 +146,10 @@ INSTSRC=$SRCDIR/dingo;;
|
|||||||
esac
|
esac
|
||||||
INSTCFDIR=$INSTSRC/config
|
INSTCFDIR=$INSTSRC/config
|
||||||
|
|
||||||
|
# Perform any instrument-specific make processing
|
||||||
make -C ../ $INSTRUMENT || exit $?
|
make -C ../ $INSTRUMENT || exit $?
|
||||||
|
|
||||||
|
# Set up the staging directories and, if testing, the testing parts
|
||||||
if [[ "$TESTING" = "test" ]]
|
if [[ "$TESTING" = "test" ]]
|
||||||
then
|
then
|
||||||
DESTHOST=${2:-ics1-test.nbi.ansto.gov.au}
|
DESTHOST=${2:-ics1-test.nbi.ansto.gov.au}
|
||||||
@@ -162,8 +172,10 @@ else
|
|||||||
mkdir -p $TEMPDIR/$DESTDIR
|
mkdir -p $TEMPDIR/$DESTDIR
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Notify progress and intention
|
||||||
echo "Deploying $INSTRUMENT to $DESTHOST:$DESTDIR"
|
echo "Deploying $INSTRUMENT to $DESTHOST:$DESTDIR"
|
||||||
|
|
||||||
|
# Set up the commands that we will be using for the "deploy" phase
|
||||||
EXTRACT_CMDS="tar vxzp -C /; touch /$DESTDIR/{DataNumber,extraconfig.tcl,newserver/config/nexus/nexus.dic,script_validator/DataNumber}"
|
EXTRACT_CMDS="tar vxzp -C /; touch /$DESTDIR/{DataNumber,extraconfig.tcl,newserver/config/nexus/nexus.dic,script_validator/DataNumber}"
|
||||||
if [[ "$DESTHOST" = "localhost" ]]
|
if [[ "$DESTHOST" = "localhost" ]]
|
||||||
then
|
then
|
||||||
@@ -178,6 +190,7 @@ EXTRACT="ssh $DESTHOST $EXTRACT_CMDS"
|
|||||||
EXTRACT_NODEPLOY="ssh $DESTHOST $EXTRACT_CMDS"
|
EXTRACT_NODEPLOY="ssh $DESTHOST $EXTRACT_CMDS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Ensure that we have the needed manifest files
|
||||||
if [ ! -e $SRCDIR/MANIFEST.TXT ]
|
if [ ! -e $SRCDIR/MANIFEST.TXT ]
|
||||||
then
|
then
|
||||||
echo "$SRCDIR/MANIFEST.TXT not found"
|
echo "$SRCDIR/MANIFEST.TXT not found"
|
||||||
|
|||||||
Reference in New Issue
Block a user