4 # This script creates a delivery tag
11 # Environment variable that MUST be defined
12 # by the calling script
14 # SVN_URL SVN_USER SVN_PASS
19 . `dirname $0`/functions
25 BIN_SVN="/usr/bin/svn"
41 if [ $EXIT -eq 0 ] ; then
44 $BIN_ECHO "-> SVN delivery parameter is missing"
50 $BIN_ECHO "-> SVN version parameter is missing"
56 if [ $EXIT -eq 0 ] ; then
57 $BIN_SVN list --username $SVN_USER --password $SVN_PASS $SVN_URL/trunk/delivery/$SVN_DELIVERY >> /dev/null 2>&1
58 if [ $? -ne 0 ] ; then
59 $BIN_ECHO "-> Directory '$SVN_URL/trunk/delivery/$SVN_DELIVERY' does not exist"
63 if [ $EXIT -eq 0 ] ; then
64 $BIN_SVN list --username $SVN_USER --password $SVN_PASS $SVN_URL/tags/delivery/$SVN_DELIVERY >> /dev/null 2>&1
65 if [ $? -ne 0 ] ; then
66 $BIN_SVN mkdir --username $SVN_USER --password $SVN_PASS -m "Create tag directory of delivery $SVN_DELIVERY" $SVN_URL/tags/delivery/$SVN_DELIVERY >> /dev/null 2>&1
67 if [ $? -ne 0 ] ; then
68 $BIN_ECHO "-> Error while creating directory '$SVN_URL/tags/delivery/$SVN_DELIVERY'"
73 if [ $EXIT -eq 0 ] ; then
74 $BIN_SVN list --username $SVN_USER --password $SVN_PASS $SVN_URL/tags/delivery/$SVN_DELIVERY/$SVN_VERSION >> /dev/null 2>&1
75 if [ $? -eq 0 ] ; then
76 $BIN_ECHO "-> Directory '$SVN_URL/tags/delivery/$SVN_DELIVERY/$SVN_VERSION' already exists"
80 if [ $EXIT -eq 0 ] ; then
81 $BIN_SVN copy --username $SVN_USER --password $SVN_PASS -m "Create tag $SVN_VERSION of delivery $SVN_DELIVERY" $SVN_URL/trunk/delivery/$SVN_DELIVERY $SVN_URL/tags/delivery/$SVN_DELIVERY/$SVN_VERSION >> /dev/null 2>&1
82 if [ $? -ne 0 ] ; then
83 $BIN_ECHO "-> Error while creating tag '$SVN_URL/tags/delivery/$SVN_DELIVERY/$SVN_VERSION' from '$SVN_URL/trunk/delivery/$SVN_DELIVERY'"