Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1028125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:20:22+00:00 2026-05-16T12:20:22+00:00

In Hudson we have a job that deploys a specified subversion tag to a

  • 0

In Hudson we have a job that deploys a specified subversion tag to a server. This tag is currently entered in a text field, but since that is just a typing mistake waiting to happen, we would like that text field to be replaced by a drop down list with the currently available tags. That is, we would like Hudson to go to <subversion repo url>/tags and fetch all tags found there.

I’ve searched for a Hudson plugin or some other way to accomplish this, with no success. This can’t be the first time someone wants this, right? Or would this be considered bad practice for some reason that I can not think of at the moment?

EDIT

Someone else did have the same idea (only three weeks ago), but there is no posted solution right now: http://issues.hudson-ci.org/browse/HUDSON-6682?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel

EDIT 2

I have now implemented Zachary Young’s answer and after a few modifications for our environment it works perfectly.

Our modifications:

We have international content encoded in UTF-8 and I had to add that to join.xsl:

<xsl:output method="xml" indent="yes" encoding="UTF-8"/>

and to the curl command that uploads the new config:

curl -H "Content-Type: text/xml; charset=UTF-8" -X POST --data-binary @$WORKING_DIR/new-config.xml $HUDSON_CONFIG_PATH -u $USER:$PASSWORD

That’s what I remember at the moment at least.

This is now placed in an external script, but I will put it in a Hudson job to make it possible for the other developers to run it easily.

I urge everyone to upvote Zachary Young’s answer!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T12:20:23+00:00Added an answer on May 16, 2026 at 12:20 pm

    UPDATE 01:
    This is now is part of the Subversion Plugin that ships with jenkins/hudson.war.

    In lieu of a Hudson plug-in (I do not know Java), how about some XSL (1.0)? In the following solution :

    1. We get a directory list of tags via svn list --xml, saved to svn-list.xml
    2. We run a transform to turn svn-list.xml into Hudson’s internal schema for a choice drop-down, saved to hudson-list.xml
    3. We run another transform to join hudson-list.xml into the job’s config.xml based on a specific name for the list we want to update, saved to new-config.xml, and update the Hudson job with the new config

    1. svn list --xml

      svn list [path-to-svn-tag-directory] --xml > svn-list.xml
    

    2. Convert SVN list to Hudson list

      xsltproc svn-to-hudson.xsl svn-list.xml > hudson-list.xml
    

    svn-to-hudson.xsl:

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output method="xml" indent="yes"/>
      <xsl:template match="/lists/list">
        <hudson.model.ChoiceParameterDefinition>
          <name>[Your Name for the List]</name>
          <description/>
          <choices class="java.util.Arrays$ArrayList">
            <a class="string-array">
              <xsl:apply-templates select="entry"/>
            </a>
          </choices>
        </hudson.model.ChoiceParameterDefinition>
      </xsl:template>
    
      <xsl:template match="entry">
        <string>
          <xsl:value-of select="name"/>
        </string>
      </xsl:template>
    </xsl:stylesheet>
    

    3. Join Hudson List with Job’s config.xml

    The following uses curl to get fetch the old config.xml, and to post the new one, utilizing Hudson’s job API for modifying the config.

    curl -o old-config.xml http://[your-hudson-server]/job/[job-name]/config.xml -u [username]:[password]
    xsltproc join.xsl old-config.xml > new-config.xml
    curl -X POST -d @new-config.xml http://[your-hudson-server]/job/[job-name]/config.xml -u [username]:[password]
    

    join.xsl requires the presence of hudson-list.xml in the same directory:

    <xsl:variable name="tag-list" select="document('hudson-list.xml')"/>
    

    You will also need to modify

    <xsl:variable name="list-name" select="string('Name')"/>
    

    to the name of your list in the job (e.g., ‘SVN tags’, ‘Tagged Builds’, etc…).

    join.xsl:

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output method="xml" indent="yes"/>
    
      <xsl:variable name="tag-list" select="document('hudson-list.xml')"/>
      <xsl:variable name="list-name" select="string('Name')"/>
    
      <xsl:template match="@*|node()">
        <xsl:copy>
          <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
      </xsl:template>
    
      <xsl:template match="hudson.model.ChoiceParameterDefinition">
        <xsl:choose>
          <xsl:when test="name = $list-name"> <!-- If the name matches, swap in new list -->
            <xsl:copy-of select="$tag-list"/>
          </xsl:when>
          <xsl:otherwise>                      <!-- If the name does not match, copy what's already there -->
            <xsl:copy-of select="."/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:template>
    </xsl:stylesheet>
    

    I hope this end-to-end solution works for you.

    Thank you,
    Zachary

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Hudson job that launches a .bat script file that itself launches
I have a Hudson job that just does a check-out/update to a third-party library.
I have a hudson build server (Windows) that does not have Websphere installed. I
I have a job running under Hudson that has not progressed from Started by
I have a job in Hudson that builds on a Windows XP slave. I
I accidentally deleted some builds for a job that I would have rather kept.
I have a Hudson CI server which is building a making a maven build.
I have a job NIGHTLY that runs one time each night by a periodical
Does anyone know how to add a subversion branch to hudson and have it
We build software using Hudson and Maven. We have C#, java and last, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.