In this post, I will show you an example bash script for creating svn tag.
First, if you would like to create tag on svn, you simply execute the following command.
Okay then, we simply call the above command in bash script.
I use revision number and time stamp as tag name.
Instead of using revision number, maybe you can prepare version number file and count up it when creating tag.
The book covers almost all stuffs about subversion.
First, if you would like to create tag on svn, you simply execute the following command.
svn copy 'source_url' 'tag_url'
Okay then, we simply call the above command in bash script.
I use revision number and time stamp as tag name.
Instead of using revision number, maybe you can prepare version number file and count up it when creating tag.
#!/bin/bash SVN_USERNAME=dukesoftware SVN_PASSWORD=some_password SVN_INFO_COMMAND="svn info --username $SVN_USERNAME --password $SVN_PASSWORD --non-interactive" SVN_COPY_COMMAND="svn copy --username $SVN_USERNAME --password $SVN_PASSWORD --non-interactive" svn_project_trunk="http://somewhere.svn/project/trunk" svn_project_base=${svn_project_trunk/trunk/} # Getting revision from svn info command # Need this line for displaying message of svn info command in English forcibly. export LC_MESSAGES=C revision=`$SVN_INFO_COMMAND $svn_project_trunk |grep '^Revision:' | sed -e 's/^Revision: //'` timestamp=`date +%Y%m%d%H%M%S` # Determine tag name - in this example, using revision + timestamp tag_version="tags"/"r"$revision"_"$timestamp svn_tag_url=$svn_project_base$tag_version # Creating tag!! echo "target tag url $svn_tag_url" echo "creating tag from $svn_project_trunk ...." `$SVN_COPY_COMMAND copy $svn_project_trunk $svn_tag_url -m 'Auto created by script'` echo "tag created! - $svn_tag_url"If you would like to know more details about subversion, you sould definitely read the following book.
The book covers almost all stuffs about subversion.
コメント