Bamboo Tagger plugin

Name Bamboo Tagger plugin
Version 1.0.8
Product Versions 2.x
Author(s) Ross Rowe, Jonathan Doklovic [developer(at)sysbliss(dot)com]
Homepage http://confluence.atlassian.com/display/CODEGEIST/Bamboo+Tagger+plugin
Price Free
License BSD
JavaDocs bamboo-tagger-plugin-javadoc.zip
IssueTracking http://developer.atlassian.com/jira/browse/BTP
Subversion URL https://svn.atlassian.com/svn/public/contrib/bamboo/bamboo-tagger-plugin or browse via fisheye
Download JAR bamboo-tagger-plugin-1.0.8.jar
Download Source bamboo-tagger-plugin-1.0.3-sources.jar

Description/Features

A plugin for Bamboo that provides a post build action to tag completed builds for plans using Subversion, CVS and Perforce repositories.

Usage

The plugin can be installed by copying the bamboo-tagger-plugin-1.0.8.jar file in the BAMBOO_HOME/webapp/WEB-INF/lib directory.

Once the plugin has been installed, an extra set options will appear on the build plan's Post Actions page (on the Configuration screen). Here you can specify if you'd like to enable Post Build Tagging of Builds. If this option is checked, then you are presented with the option to enable tagging of failed or successful builds (or both).

Within each option, you can specify the label of the tag and the destination. The destination field is only required for plans using Subversion as the source code repository.

The plugin supports the following replacement variables within both the 'Tag Label' and 'Comment Text' fields:

  • %B - this is replaced by the build number
  • %C - this is replaced by the SCM comments included with the change set being built
  • %J - this is replaced by the Jira issues included with the change set being built
  • %d{ddMMyyyy} - this is replaced by the current date, in the format specified within the curly brackets. The date formatting characters are those specified by the Java SimpleDateFormat class.

The plugin also supports the usage of Bamboo Global or Build-specific variables (eg. ${bamboo.buildNumber})

If a build has been enabled to tag a successful/unsuccessful build, then a new tag will be created once the build has completed.

Version History

Version Date Description
1.0.8 28 Oct 2008 Ensure that CVS output is logged to the bamboo.log file
1.0.7 25 Oct 2008 Updated CvsTagger to use correct source code location
1.0.6 24 Oct 2008 Fixed critical bug in build configuration present in 1.0.5, see comments
1.0.5 22 Oct 2008 Added ability to specify either 'rtag' or 'tag' for the CVS support. Version 1.0.5 contained a critical bug, users should use 1.0.6 instead
1.0.4 20 Oct 2008 Added ability to specify the comment used for the tag via the configuration, and also added the ability to include the Jira issues and SCM comment information as replacement variables, which can be used in both the Tag Label and Comment Text fields
1.0.3 5 Sep 2008 Fixed issue with custom build properties not expanding properly
1.0.2 27 Aug 2008 Included correct version in plugin descriptor
1.0.1 22 Aug 2008 Ensured that the custom configuration of the build definition is used as part of the variable substitution
1.0.0 8 Aug 2008 Added ability to delete contents of tag prior to tagging a build in Subversion
0.0.9 5 Aug 2008 Use vcsRevisionKey for Subversion tagging
0.0.8 4 May 2008 Added i18n support
0.0.7 29 Apr 2008 Added some more unit tests
0.0.6 25 Apr 2008 Ensure that Subversion destination urls that have trailing slashes generate svn copy correctly
0.0.5 20 Apr 2008 Added support for global/build variable replacement in tag name
0.0.4 9 Apr 2008 Added support for Perforce tagging
0.0.3 7 Apr 2008 Added support for CVS tagging
0.0.2 28 Mar 2008 Added support for Subversion tagging
0.0.1 25 Mar 2008 Initial plugin version

Screenshots

Labels

codegeist_2008_bamboo codegeist_2008_bamboo Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Apr 16, 2008

    Edwin Wong says:

    Hey Ross, Cool to see your submission. This is definitely one we wanted to do ...

    Hey Ross,

    Cool to see your submission.

    This is definitely one we wanted to do for a while now - so it's cool that you're on it here!

    One idea - for the tag - you might want to use the meta-data substitution syntax that we use for other configuration screens (e.g. ${bamboo.buildNumber})? Some information on how to do this is here: http://docs.atlassian.com/atlassian-bamboo/2.0/com/atlassian/bamboo/build/AbstractSubstitutionBean.html

    Cheers,
    Edwin

    1. Apr 18, 2008

      Ross Rowe says:

      Hey Edwin, thanks for the heads up re: the substitution syntax, I'll definitely ...

      Hey Edwin, thanks for the heads up re: the substitution syntax, I'll definitely look at incorporating it into the plugin.

      Cheers,

      Ross

  2. Apr 24, 2008

    Eric Jain says:

    This plug-in would be real useful – if I could get it to work! I have set...

    This plug-in would be real useful – if I could get it to work!

    I have set up:

    Post Actions
    Tag Successful Builds
    Tag: foo_%d{yyyyMMdd}
    Destination: svn://svn.foo.test/bar/tags/

    This is what happens:

      2008-04-24 16:26:04,163 ERROR [pool-8-thread-1] [SubversionTagger] 
      org.tmatesoft.svn.core.SVNException: svn: Commit failed (details follow):
      svn: Path 'tags/foo_20080424' not present
    

    Any ideas?

    1. Apr 24, 2008

      David Peterson [CustomWare] says:

      Make sure that the 'tags' parent directory already exists before trying to tag. ...

      Make sure that the 'tags' parent directory already exists before trying to tag. SVN will create the new tag directory, but won't create the path up to that point.

      1. Apr 24, 2008

        Eric Jain says:

        Thanks, I've checked that. Just to be clear, I'm expecting the final tag URL sho...

        Thanks, I've checked that. Just to be clear, I'm expecting the final tag URL should be something like:

        svn://svn.foo.test/bar/tags/foo_20080424

        Everything up to foo_20080424 exists already (and contains some other "tags" with different names). Perhaps I should try to enable more verbose logging to see what's going on?

        1. Apr 24, 2008

          Ross Rowe says:

          I've just checked this, and I replicated the error when the destination url has ...

          I've just checked this, and I replicated the error when the destination url has a trailing '/'. However, if I try this without a trailing '/', the tag gets created successfully.

          Can you update the destination to not include the trailing '/' and try again? In the meantime, I'll update the code to work with trailing '/'s and will release a new version ASAP.

          Cheers,

          Ross

          1. Apr 25, 2008

            Ross Rowe says:

            Just FYI, I've put up a version 0.0.6 which should fix the problem

            Just FYI, I've put up a version 0.0.6 which should fix the problem

          2. Apr 25, 2008

            Eric Jain says:

            Thanks for the quick response. Removing the trailing slash does indeed fix the p...

            Thanks for the quick response. Removing the trailing slash does indeed fix the problem!

  3. Aug 04

    Mark Barnes says:

    Just looking at the source code, for the subversion tagger, I see the following ...

    Just looking at the source code, for the subversion tagger, I see the following

        getSvnClientManager(svnRepository).getCopyClient().doCopy(
            SVNURL.parseURIDecoded(svnRepository.getRepositoryUrl()),

            SVNRevision.HEAD, destinationUrl, false,         "Automatic copy from Bamboo");I'm concerned that the use of HEAD will mean you are not necessarily tagging the version that has just been built?

    1. Aug 04

      Ross Rowe says:

      Hi Mark, thanks for pointing that out, I'll attempt to fix this to make sure tha...

      Hi Mark, thanks for pointing that out, I'll attempt to fix this to make sure that the correct copy is being tagged.

      Cheers,

      Ross

      1. Aug 05

        Ross Rowe says:

        Hi again, I've just released 0.0.9 which now uses the Subversion revision number...

        Hi again, I've just released 0.0.9 which now uses the Subversion revision number used for the build for the copying operation.

        Cheers,

        Ross

  4. Aug 21

    yurgen says:

    Hi Ross, It would be nice to support JiraVersions variables such as bamboo.cust...

    Hi Ross,

    It would be nice to support JiraVersions variables such as bamboo.custom.jiraversion.name, bamboo.custom.jiraversion.rawname,bamboo.custom.jiraversion.type, bamboo.custom.jiraversion.released when defining tag labels! 

    Do you probably know some quick workaround or solution?

    Thanks 

    1. Aug 21

      Ross Rowe says:

      Hi, I haven't tried the JiraVersions plugin yet, but the Tagger plugin does alre...

      Hi, I haven't tried the JiraVersions plugin yet, but the Tagger plugin does already support the substitution of variables (such as those specified on the Using Global or Build specific Variables page. I'll try to setup my environment to make use of the JiraVersions plugin...I suspect it shouldn't be too difficult to include the variable substitution (if it's not already there).

      Thanks,

      Ross

    2. Aug 22

      Ross Rowe says:

      Hi again, I've just created version 1.0.1, which should support the replacement ...

      Hi again, I've just created version 1.0.1, which should support the replacement of the JiraVersions variables. Please note that the parameters are stored without the preceding 'bamboo', so for the 'bamboo.custom.jiraversion.name' parameter, you should include ${custom.jiraversion.name} in the tag label.

      Cheers,

      Ross

      1. Aug 22

        yurgen says:

        Thanks for the quick release, Ross! I'll test it.

        Thanks for the quick release, Ross! I'll test it.

      2. Aug 25

        yurgen says:

        Hi, I tried new build and it does not seem to work... For some reason only bambo...

        Hi, I tried new build and it does not seem to work... For some reason only
        bamboo.buildKey replacement works for me.  None of bamboo.buildNumber, bamboo.buildResultKey
        and all of bamboo.custom.jiraversion.* variables don't work. (As you recommended I used
        format you mentioned above in the tag label). Where else should I look?

        Thanks

        1. Aug 26

          Ross Rowe says:

          Hi, a couple of things, I was wrong about the including bamboo at the beginning ...

          Hi, a couple of things, I was wrong about the including bamboo at the beginning of the variable, it turns out you do need it. Also, the JiraVersions variables begin with 'custom.jiraversions.' rather than 'custom.jiraversion.'. For instance in my environment, I have managed to define a tag with a '${bamboo.custom.jiraversions.jira.projectkey}' variable present, which seems to get resolved correctly.

          Cheers,

          Ross

          1. Aug 27

            yurgen says:

            Hi, here http://confluence.atlassian.com/display/BAMEXT/JiraVersions+Pluginin th...

            Hi, here http://confluence.atlassian.com/display/BAMEXT/JiraVersions+Pluginin the Usage sections is the list of variables I would like to use. They say I should use 'custom.jiraversion' instead of  'custom.jiraversions' use recommend. However I tried your variant but the behavior was the same.

            Note: The only bamboo.buildKey is being substituted in my case.

            The env. : Bamboo version 2.1,  bamboo-jiraversions-plugin version 1.2.0,  Bamboo Tagger plugin 1.0.2. 

            Thanks

             

            1. Aug 28

              Ross Rowe says:

              Hmm, I'm not sure what's going on, but I'm using the same versions, and when I u...

              Hmm, I'm not sure what's going on, but I'm using the same versions, and when I use 'success_$

              Unknown macro: {bamboo.custom.jiraversions.jira.projectkey}
              ' as the tag label, 'success_TST' is output (where TST is my Jira project name). I've sent an email to the developer of the JiraVersions plugin to see if he's got any ideas.

              Cheers,

              Ross

              1. Aug 28

                yurgen says:

                Hi, the bamboo.custom.jiraversions.jira.projectkey variable you mentioned defini...

                Hi, the bamboo.custom.jiraversions.jira.projectkey variable you mentioned definitely works.

                But what about others variables such as s bamboo.custom.jiraversion.name, bamboo.custom.jiraversion.rawname, bamboo.custom.jiraversion.type, damboo.custom.jiraversion.released and ?

                Could you please check in you env?

                Thanks

      3. Aug 27

        Edwin Wong says:

        Ross, I've also had a play with the latest 1.0.1 plugin. It seems like most of...

        Ross,

        I've also had a play with the latest 1.0.1 plugin.

        It seems like most of the variables don't work. I looked into this further, and found that the plugin jar for version 1.0.1 is actually v0.6 (as specified in the atlassian-plugin.xml)?

        Cheers,
        Edwin

        1. Aug 27

          Ross Rowe says:

          Hi Edwin, I had the wrong version included in the plugin descriptor (the version...

          Hi Edwin, I had the wrong version included in the plugin descriptor (the version in the pom file was correct though)...I've just released 1.0.2 which should fix this.

          Cheers,

          Ross

  5. Aug 29

    jonathan doklovic says:

    Can anyone let me know if this is working now? For clarity....  all versio...

    Can anyone let me know if this is working now?

    For clarity....  all version related info that the end user would want is correct on the JiraVersion plugin page, i.e.:

    property description
    ${bamboo.buildKey} the build key. (i.e. PRJ-PLAN)
    ${bamboo.buildNumber} the build number. (i.e. 14)
    ${bamboo.buildResultKey} the full build key. (i.e. PRJ-PLAN-14)
    ${bamboo.custom.jiraversion.name} the fully expanded version name
    ${bamboo.custom.jiraversion.rawname} the version name as it was returned by Jira
    ${bamboo.custom.jiraversion.type} the version type keyword found (or blank)
    ${bamboo.custom.jiraversion.released} (true or false) if the version has been released in Jira

    Note that it's jiraversion and not jiraversions.
    This is because the variables represent the actual version returned from jira, and thus is labeled as "jiraversion".
    The other variables mentioned (jiraversions.jira.projectkey and others) are used internally by the plugin and thus "jiraversions" denotes that the variable belongs to the JiraVersions plugin.

    Hope that helps clear up the naming a bit.

    -Jonathan

    1. Sep 01

      yurgen says:

      Hi, as I already mentioned the ONLY ${bamboo.buildKey} variable (from the above ...

      Hi, as I already mentioned the ONLY ${bamboo.buildKey} variable
      (from the above list) works.

      1. Sep 05

        jonathan doklovic says:

        I talked with Ross, and since he's a bit busy I went ahead and fixed the issue. ...

        I talked with Ross, and since he's a bit busy I went ahead and fixed the issue.

        v1.0.3 should now expand all custom properties set outside of the tagger plugin.

         - Jonathan

  6. Sep 12

    Bahman Kalali says:

    Hi, I have installed Bamboo Tagger Plugin and configured Tag Label as follows: ...

    Hi,

    I have installed Bamboo Tagger Plugin and configured Tag Label as follows:

    •success_%d

    Unknown macro: {ddmmyyyy}
    _%B

    However, when I look at tag created in my CVS history in Eclipse, I will see this:

    •success_12-47-2008<ProjectKey-BuildPlanKey-BuildNumber>

    I was wondering why I am getting 47 as month number instead of 9 which is the current month.

    I appreciate your help
    BR//Bahman

    1. Sep 12

      Ross Rowe says:

      Hi Bahman, sorry about that...the plugin uses the formatting specified by the ja...

      Hi Bahman, sorry about that...the plugin uses the formatting specified by the java SimpleDateFormat class. 'm' is actually minutes, whereas 'M' is months, so could you try change your label to be 'success_%d{ddMMyyyy}_%B?

      Thanks,

      Ross

      1. Sep 12

        Bahman Kalali says:

        Hi Ross, Yes, that was the issue. Thank you,  BR//Bahman   ...

        Hi Ross,

        Yes, that was the issue.

        Thank you, 

        BR//Bahman    

  7. Sep 25

    Phillip Hancock says:

    Ok what am I doing wrong? I have tried every possible option that I can think ...

    Ok what am I doing wrong?

    I have tried every possible option that I can think of for tagging the build with the subversion revision number

    Tag Successful Build

    Tag = v8.3.${custom.svn.revision.number} or
    Tag = v8_3_${custom.svn.revision.number} or
    Tag = v8_3_${bamboo.buildNumber} or
    Tag = v8.3.${bamboo.buildNumber}
    

    What am I doing wrong.

    -Phillip Hancock

    or

    1. Sep 25

      Phillip Hancock says:

      It seems I had a older version of the jar. Not sure how I downloaded the wrong o...

      It seems I had a older version of the jar. Not sure how I downloaded the wrong one

  8. Sep 26

    Andrei Sereda says:

    Hi, Will it be possible to implement CVS tag command as well (not only rtag) ? ...

    Hi,

    Will it be possible to implement CVS tag command as well (not only rtag) ?

    Thanks,

    Andrei.

    1. Oct 17

      Ross Rowe says:

      Hi Andrei, apologies for not replying to you earlier, I didn't receive an email ...

      Hi Andrei, apologies for not replying to you earlier, I didn't receive an email notification that a comment was made. I think adding an option to perform an CVS tag instead of a rtag command should be pretty straightforward, I'll let you know how I go.

      Cheers,

      Ross

    2. Oct 22

      Ross Rowe says:

      Hi again, I've just popped up version 1.0.5, which allows you to specify either ...

      Hi again, I've just popped up version 1.0.5, which allows you to specify either 'tag' or 'rtag' for CVS plans. Let me know if there are any problems

      Cheers,

      Ross

  9. Oct 17

    Juha Sadeharju says:

    Bamboo Tagger doesn't play nice with our pre-commit hook which requires a valid ...

    Bamboo Tagger doesn't play nice with our pre-commit hook which requires a valid issue key to be found. Instead of hardcoding this value

    com/atlassian/bamboo/plugin/tagger/svn/SubversionTagger.java:                    "Automatic copy from Bamboo");

    could we have it in some text input field so it enables custom commit messages (with e.g. a JIRA issue key).

    1. Oct 17

      Ross Rowe says:

      Hi Juha, yep, I can add a text field to hold the comment details, I'll let you k...

      Hi Juha, yep, I can add a text field to hold the comment details, I'll let you know when I've put up a new version.

      Cheers,

      Ross