#!/bin/bash
if [ $# -eq 1 ]
then
  DEPLOYMENT=$1
else
  echo "string describing planned deployment required for tag message"
  exit
fi

TAGNAME=$(date --utc +Tethys_%Y_%m_%d)
SVN=/usr/bin/svn
GREP=/bin/grep
SVNSERVER=tethyscode
TAGPATH="svn/repos/lrauv/tags"
URL=$($SVN info | $GREP ^URL:)
REV=$($SVN info | $GREP ^Revision:)

$SVN up

msg="Tag from $URL, $REV, for $DEPLOYMENT"
cmd="svn copy . svn+ssh://$SVNSERVER/$TAGPATH/$TAGNAME -m'$msg'"

echo $cmd;eval $cmd
