Use svn number for build number

is it possible to use the svn number as the build number? Or if that is not possible to loo in a java file for the build number?

14 comments
Comment actions Permalink

It not very good. Subversion is used revision number for entire repository. For repository with multiple projects you can not get valid build numbering.

Instead of this you can setup agent triggering per each commit to SVN. It will be closest numbering to Subversion revision number, but to exact.

0
Comment actions Permalink

Yeah that is why it might be nice to have the build number determined by a java file or even ant directive. That way the version of the app being built will match teamcity

0
Comment actions Permalink

Hello Barry,

Barry Kaplan wrote:

Yeah that is why it might be nice to have the build number determined by a java file or even ant directive. That way the version of the app being built will match teamcity


I see no problem with defining your custom build number. TeamCity provides a pattern for
defining build numbers, like 2.0.nnn where nnn is a counter provided by TeamCity.
The counter value can be edited at any time, so you can migrate from version
1.0.789 to 2.0.1 easily.

Such a build number is passed to the build as build.number system variable and can be
used by your build script for integration with your application.

Kind regards,
KIR


--
Kirill Maximov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Is there a way to access the subersion changeset number as well? I would really like to make something like this

ver 187.{svn cvhangeset}.{teamcity.build}

That way I can trace every release of code to an exact changeset in subversion.

0
Comment actions Permalink

Barry Kaplan wrote:

Is there a way to access the subersion changeset number as well? I would really like to make something like this

ver 187.{svn cvhangeset}.{teamcity.build}


It's a little bit tricky. Just because your project may contain sources from different
VCS roots and even different VCS (in JetBrains we have a mix of Perforce and SVN).

And because of this it is unclear, changeset number of which VCS should
be passed to the build.


That way I can trace every release of code to an exact changeset in subversion.


Why can't you simply use Change Log page of TeamCity to understand which changes
went to particular build?

Kind regards,
KIR

--
Kirill Maximov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Yeah i guess I understand that a lot of projects do use only 1 VCS. The change log page doe let me know the changes, but what i really want to be able to do is checkout from VCS the exact code for that build. Not just take a look at what changed from last time.

0
Comment actions Permalink

Barry Kaplan wrote:

Yeah i guess I understand that a lot of projects do use only 1 VCS. The change log page doe let me know the changes, but what i really want to be able to do is checkout from VCS the exact code for that build. Not just take a look at what changed from last time.


Changelog page contains the exact VCS changelist number which you can use for the checkout.
Like svn:123 or perforce:13452.

Regards,
KIR


--
Kirill Maximov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

I don't see this (using Subversion 1.3, TC build 1641). Am I looking in
the wrong place?
http://buildserver:8111/viewLog.html?tab=buildChangesDiv&buildTypeId=bt5&buildId=89
http://buildserver:8111/viewType.html?buildTypeId=bt5&tab=buildTypeHistoryList&jsp=allChanges.jsp

0
Comment actions Permalink

Robert Gibson wrote:

I don't see this (using Subversion 1.3, TC build 1641). Am I looking in
the wrong place?
http://buildserver:8111/viewLog.html?tab=buildChangesDiv&buildTypeId=bt5&buildId=89

http://buildserver:8111/viewType.html?buildTypeId=bt5&tab=buildTypeHistoryList&jsp=allChanges.jsp


Looks like valid link. Take a look here, at our public server. It contains svn:version column in
the rightmost column:

http://teamserver.jetbrains.com/viewType.html?buildTypeId=buildType2&tab=buildTypeHistoryList&jsp=allChanges.jsp

Please send your screenshot if there your's is different.

Regards,
KIR


--
Kirill Maximov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

I just have
svn: 2006/10/09 14:24:14 +0200
in the right-hand column. Maybe this was changed between builds 1641 and
1654?
(And I notice that neither your server nor mine has the revision in the
Changes tab of a given build.)
Thanks,
R

0
Comment actions Permalink

Yeah I don't have svn repository numbers anywhere either.

0
Comment actions Permalink

Robert Gibson wrote:

I just have
svn: 2006/10/09 14:24:14 +0200
in the right-hand column. Maybe this was changed between builds 1641 and
1654?
(And I notice that neither your server nor mine has the revision in the
Changes tab of a given build.)


Wow. That's our bug. Thanks. It worked before.

Please monitor http://www.jetbrains.net/jira/browse/TW-931.

Regards,
KIR


--
Kirill Maximov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

How can I access the repository changeset number from my ant script? I took a look and it seems the way you check things out of subversion does not leave the .subversion directories so I am at a bit of a loss. Taking your suggestion of using the version number in the script I also want to put any and all repository changeset in my code, like a my MANIFEST. How do I do this?

0
Comment actions Permalink

Barry Kaplan wrote:

How can I access the repository changeset number from my ant script? I took a look and it seems the way you check things out of subversion does not leave the .subversion directories so I am at a bit of a loss. Taking your suggestion of using the version number in the script I also want to put any and all repository changeset in my code, like a my MANIFEST. How do I do this?


Please watch/vote for http://www.jetbrains.net/jira/browse/TW-916

--
Kirill Maximov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0

Please sign in to leave a comment.