You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by jpyork <jp...@hotmail.com> on 2008/01/29 16:45:22 UTC

Ant and Subversion

Is it possible to create a task that creates a tag every time you do a build?
-- 
View this message in context: http://www.nabble.com/Ant-and-Subversion-tp15162188p15162188.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Ant and Subversion

Posted by Steve Loughran <st...@apache.org>.
David Brown wrote:
> Hello, the blog link works but the antbook.org does not go anywhere. I don't get anything from whois or dns. Please advise, David.

ooh. will check

(pause)

try now. I'm running confluence on a Xen linux VM image, and it seems to 
leak memory and then eventually halt. I should just switch to a static 
site instead...Java sites are too much high maintenance unless you are 
doing interesting things with them.

-steve

-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Ant and Subversion

Posted by David Brown <da...@davidwbrown.name>.
Hello, the blog link works but the antbook.org does not go anywhere. I don't get anything from whois or dns. Please advise, David.

Steve Loughran wrote ..
> Antti Luoma wrote:
> > Hello,
> > 
> > I suggest you to take a look at CruiseControl. This can be easily done with
> > it.
> > 
> 
> We do something different @work: we have the cruise control build 
> numbers tied to the SVN repository revision number. If build 6152 worked 
> and build 6153 stopped, then it was transaction #6153 that broke it (or 
> some change in the outside universe). We only tag when we cut a release 
> itself
> 
> -steve
> 
> -- 
> Steve Loughran                  http://www.1060.org/blogxter/publish/5
> Author: Ant in Action           http://antbook.org/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Ant and Subversion

Posted by Steve Loughran <st...@apache.org>.
Antti Luoma wrote:
> Hello,
> 
> I suggest you to take a look at CruiseControl. This can be easily done with
> it.
> 

We do something different @work: we have the cruise control build 
numbers tied to the SVN repository revision number. If build 6152 worked 
and build 6153 stopped, then it was transaction #6153 that broke it (or 
some change in the outside universe). We only tag when we cut a release 
itself

-steve

-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Ant and Subversion

Posted by Antti Luoma <an...@gmail.com>.
Hello,

I suggest you to take a look at CruiseControl. This can be easily done with
it.

-antti-

2008/1/29, jpyork <jp...@hotmail.com>:
>
>
> Is it possible to create a task that creates a tag every time you do a
> build?
> --
> View this message in context:
> http://www.nabble.com/Ant-and-Subversion-tp15162188p15162188.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


-- 
-Antti-

Re: Ant and Subversion

Posted by David Weintraub <qa...@gmail.com>.
Just to make things clear here, you normally do not "tag" your daily
builds in Subversion. Instead, you simply use the source archive's
revision number to refer to the build. This is like an automatic tag.

Now, getting back to Subversion and Ant. The Subversion tasks have
been removed from Ant. Instead, these tasks are now part of a separate
AntLib that you would include in your Ant installation. I just
checked, and although Subversion is suppose to have an AntLib, nothing
has been released.

However, the subclipse team has developed a set of Subversion ant
tasks. You can find those at: http://subclipse.tigris.org/svnant.html.
To find the revision number of your archive, which you can use as a
revision number, you can do this:

<svn>
    <status path="." revisionProperty="build.number"/>
</svn>

When this completes, the ${build.number} will equal the revision of
the source archive.

If you want a separate build number that is independent of
Subversion's source archive revision number, you can use the
<buildnumber> task. This stores a build number in a file (called
build.number by default). Every time you execute the <buildnumber>
task, it increments the build number in that file. You can read in
that build number using the <property file> task:

<buildnumber/>
<property file="build.number"/>
<echo message="The build number is ${build.number}"/>

You make a tag in Subversion by doing a copy to the TAG directory:

<svn>
    <copy srcPath="${project.root}"
        destUrl="${svn.root.url}/TAGS/${tag.name}"
        message="${commit.message}"/>
</svn>

On Jan 29, 2008 10:45 AM, jpyork <jp...@hotmail.com> wrote:
>
> Is it possible to create a task that creates a tag every time you do a build?
> --
> View this message in context: http://www.nabble.com/Ant-and-Subversion-tp15162188p15162188.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>



-- 
--
David Weintraub
qazwart@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Ant and Subversion

Posted by Chuck Holzwarth <ch...@yahoo.com>.
Not sure of why you would need to create a branch for each build. If you are just trying to keep artifacts, you may want to just put each build into its own directory. I do that by:
<tstamp>
    <format pattern="yyyyMMddHHmm" property="build_time"/>
</tstamp>
<propertyregex property="cjh_tmp" input="${basedir}" regexp="C:\\[A-Za-z0-9 _-]*\\(.*)" select="\1"/>
<property name="release_dir" value="C:/Builds/${cjh_tmp}/${build_time}"/>

The build results go into ${release_dir}. Some of the artifacts I produce during the build are the detailed list of changes and the version number of the repository that exists at the time of the build. The code to get the detailed list is as follows:



<target name="__assemble_chg_log">
<!--
#######################################################################################################################################
TARGET: __assemble_chg_log
Purpose: The property "release_start_rev" contains the subversion version number for when the last branch was made from a specific
    branch. The property "targetRevision" contains the subversion version number for the release being built. The subversion comments
    for all versions from the start to target inclusive are then retrieved and placed into a file. This file is then added uploaded
    to the task that is sent to QA so they can see all of the changes that have been made.  These changes include all that are
    specific to the branch being built and the changes merged from other branches.
See:
#######################################################################################################################################
-->
<!--
##################################################
This target pulls the subversion logs from where the last branch was created to the current version.
##################################################
-->
<if>
    <isset property="release_start_rev"/>
<then>
    <echo level="info">Issuing: ${svn} log --verbose --revision ${release_start_rev}:${targetRevision} ${baseTargetURL}</echo>
    <echo level="info">Output will be in: ${release_dir}/svn_log_info.txt</echo>
    <exec executable="${svn}" output="${release_dir}/svn_log_info.txt">
        <arg value="--username"/>
        <arg value="${svnuser}"/>
        <arg value="--password"/>
        <arg value="${svnpass}"/>
        <arg value="log"/>
        <arg value="--verbose"/>
        <arg value="--revision"/>
        <arg value="${release_start_rev}:${targetRevision}"/>
        <arg value="${baseTargetURL}"/>
    </exec>
</then>
</if>
</target>




I just use an exec for the svn command. You should be able to use the fragments above, along with the subversion manual, to come up with a target to create tags if you need to. The problem you can have is that subversion could change between the beginning of your build and the end of the build if you wait to until you determine if the build is successful to add the branch. If you add the branch at the beginning of the build, you could create a branch for an unsuccessful build.

jpyork <jp...@hotmail.com> wrote: 
Is it possible to create a task that creates a tag every time you do a build?
-- 
View this message in context: http://www.nabble.com/Ant-and-Subversion-tp15162188p15162188.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org




Thank you,
Chuck Holzwarth
(804) 403-3478 (home)
(540) 335-3171 (cell)
       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.