Subversion Tagging Plugin

Skip to end of metadata
Go to start of metadata

Plugin Information

Plugin ID svn-tag Changes In Latest Release
Since Latest Release
Latest Release
Latest Release Date
Required Core
Dependencies
1.16
Nov 03, 2011
1.421
subversion (version:1.34)
Source Code
Issue Tracking
Maintainer(s)
GitHub
Open Issues
Kenji Nakamura (id: k2nakamura)
Usage Installations 2013-Apr 3374
2013-May 3440
2013-Jun 3472
2013-Jul 3549
2013-Aug 3333
2013-Sep 3407
2013-Oct 3477
2013-Nov 3546
2013-Dec 3486
2014-Jan 3644
2014-Feb 3633
2014-Mar 3704


This plugin manages only tagging triggered by a successful build. This plugin is NOT related to "Tag this build" link.

What does this do?

This plugin automatically performs subversion tagging (technically speaking svn copy) on successful build. This is useful when you want to access the stable codebase. The Subversion Plugin has support for manually tagging a particular build via Hudson's user interface. This plugin is for automatic tagging as part of the build.

How tagging works?

  1. Read Subversion authentication information from Hudson's Subversion SCM configuration.
  2. Delete the existing tag if exists.
  3. Perform URL to URL svn copy.

Please note that svn copy is cheap because it doesn't duplicate file contents when not necessary. URL to URL copy is also fast because there is no data transfer from Hudson to Subversion, unlike maven scm plugin's "tag" goal.

Configuration

Subversion Authentication


When you specify subversion repository URL, you are requested to enter authentication information. The values are stored in hudson.scm.SubversionSCM.xml in HUDSON_HOME directory. This plugin obtains the authentication information directly from Hudson core's Subversion SCM class so the principal and credential specified here is used for subversion authentication.

System configuration

Basic configuration for the project with one svn location

The default tag base URL and the template of tag comment can be specified. Those values are automatically populated when this plugin is enabled in the job's configuration.

  • The template of comment recognizes groovy syntax. Map returned from hudson.model.AbsutractBuild#getEnvVars(), System Properties, and repository URL are bound so that you can refer them as env, sys, and repoURL respectively. For repoURL, see repoURL.
  • The value of Map (and Properties) can be refered like this.
    Build: ${env['BUILD_TAG']} on OS ${sys['os.name']} ${sys['os.version']}.
    
  • Compilation happens when the focus is moved from the text field. Please check if the quotes, braces, and brackets are balanced when you get a compilation error. A closing single quote is missing after BUILD_TAG in the case below.
  • Base tag URL's hostname must be identical with the one of Subversion URL. Different notation (e.g. raw IP address and hostname, short hostname and fully qualified hostname, or using alias) is recognized as different servers so that please make sure to use the identical hostname.
    Job name in tag base URL
    Job name is no longer implicitly appended to tag base URL since version 1.2. Please use '${env['JOB_NAME']}' if you need to use job name as a part of tag URL.
Configuration for the project with multiple svn locations
Relative URL
  • Relative URL is accepted since version 1.5. It is resolved by Subversion repository URL. This is useful when you specify multiple locations with uniformed hierarchy.
    myRepo/
    |-- project1
    |   |-- branches
    |   |-- tags
    |   `-- trunk
    |       `-- subproject1
    `-- project2
        |-- branches
        |-- tags
        `-- trunk
            |-- subproject2
    

    Suppose the following svn locations are specified in your project.

    http://svn.example.com/svn/myRepo/project1/trunk/subproject1
    http://svn.example.com/svn/myRepo/project2/trunk/subproject2
    

    Specifying a relative tag

    ../tags/${env['JOB_NAME']}
    

    instead of an absolute tag base URL results in creation of the following tag.

    http://svn.example.com/svn/myRepo/project1/tags/job_name
    and
    http://svn.example.com/svn/myRepo/project2/tags/job_name
    
repoURL
  • The location URL path list delimited by "/" (slash) is bound to groovy runtime as "repoURL" since version 1.6. Any path can be embedded as a part of tag base URL. Suppose you have the following hierarchy.
    svnrepo/
    |-- branches
    |-- tags
    `-- trunk
        |-- project1
        |   |-- a.txt
        |   |-- subproject1
        |   |   `-- subproject1.txt
        |   `-- subproject2
        |       `-- subproject2.txt
        `-- project2
            |-- subproject21
            |   `-- subproject21.txt
            `-- subproject22
                `-- subproject22.txt
    

    You specify two locations in subversion configuration.

    location 1: http://svn.example.com/svn/svnrepo/trunk/project1
    location 2: http://svn.example.com/svn/svnrepo/trunk/project2
    

    Then specify the tag base URL embedding a part of repoURL as tag base URL.

    http://svn.example.com/svn/svnrepo/tags/${env['BUILD_TAG']}/${repoURL[-1]}
    (or)
    ../tags/${env['BUILD_TAG']}/${repoURL[-1]}
    

    You will get the following tags. Please note that repoURL contains [http,svn.example.com,svn,svnrepo,trunk,project1] as List in case of the example above, and groovy allows to access the element from the end by specifying negative index. For example, repoURL[-2] returns trunk as the value.

    svnrepo/
    |-- branches
    |-- tags
        |-- hudson-svnrepo-3
        |   |   |-- project1
        |   |   |   |-- a.txt
        |   |   |   |-- subproject1
        |   |   |   |   `-- subproject1.txt
        |   |   |   `-- subproject2
        |   |   |       `-- subproject2.txt
        |   |   `-- project2
        |   |       |-- subproject21
        |   |       |   `-- subproject21.txt
        |   |       `-- subproject22
        |   |           `-- subproject22.txt
    

Job configuration

You can customize the tag base URL and comment specific for the job. The default values specified at System configuration is populated as the default values when the plugin is enabled.

Known limitations

  • Any authentication method supported by Hudson Subversion core (SubversionSCM.class) should work from v1.4, but haven't tested. Please create an issue ticket if you successfully tag with the authentication methods other than username / password. Please contact me if you have problems with other authentication scheme.
  • Tagging for the project with multiple locations that are not symmetric and needed to be tagged in the different depth are not supported yet. This should be able to be addressed by specifying tag base URL per location, but haven't implemented yet.

Support

Please create an issue ticket and specify svn-tag as the sub-component when you find bugs, improvement ideas, or create a patch.
Please include the version of svn-tag plugin, subversion repository URL location(s), tag base URL, and the layout of your svn repositories.
"Tag this build" link appeared in a build screen is NOT related to this plugin. Please submit the report to subversion instead.

History

01/12/12

  • k2nakamura no longer actively maintain this plugin. Instead, V.Renjith stepped up and take the ownership of the plugin. Thank you Renjith.

11/02/11 Version 1.16

This version requires Hudson 1.421 or later.

07/27/11 Version 1.15

  • Merged the changes to address the issue described in issue #10325. Thanks to Carsten Klein.
This version requires Hudson 1.420 or later.

03/26/10 Version 1.14

  • Fixed doMkdir problem introduced in 1.13 (issue #6066).

02/02/10 Version 1.13

  • Update code for more recent Hudson.
    This version requires Hudson 1.319 or later.

09/21/09 Version 1.12

  • Fixed URL escape issue reported in issue #4453.
  • Added text fields for subversion comment used when deleting an old tag and creating intermediate tag directory requested by issue #4507.

01/29/09 Version 1.10

  • Reflected the patch to support promoted build action. See issue #2924 for the details. Thanks to Ertan.
    This version requires Hudson 1.279 or later.

08/14/08 Version 1.9

08/14/08 Version 1.8

  • Fixed issue #2201 that the last path was created when the intermediate directories were created and resulted in the two levels of the last path.

08/13/08 Version 1.7

  • Fixed the issue that the intermediate directories in tag base URL were not created.

08/12/08 Version 1.6

  • Added "repoURL" binding to tag base URL groovy expression so that a part of repoURL can be embedded in tag base URL.

08/09/08 Version 1.5

  • Added the support for relative tag base URL.

07/31/08 Version 1.4

  • Got rid of parsing hudson.scm.SubversionSCM.xml and obtained SVN authentication information directly from SubversionSCM class.

07/20/08 Version 1.3

  • Added the support for multiple subversion repositories.

05/11/08 Version 1.2

  • Added groovy expression support in tag base URL.
    Change in tag base URL
    The tag base URL no longer appends job name implicitly at the end since this version. Please add '${env['JOB_NAME']}' if you upgrade from version 1.1 and want to keep the original behavior.

04/18/08 Version 1.1

  • Fixed a path issue in help html links.

04/17/08 Version 1.0

  • Initial checkin.

Labels

Edit
plugin-scm-related plugin-scm-related Delete
plugin-post-build plugin-post-build Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Add Comment