Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-4547

Subversion checkout directory does not expand variables

    • Icon: Improvement Improvement
    • Resolution: Cannot Reproduce
    • Icon: Critical Critical
    • subversion-plugin
    • None
    • Platform: All, OS: All

      In order to save on configuration effort, I have set a parameter
      "APPLICATION_NAME" that can be reused in several places in may job configuration.

      One of these places is a svn checkout dir. Unfortunately, when I set "Local
      module directory" to ${APPLICATION_NAME} the svn tree is checked out to the dir
      "${APPLICATION_NAME}" instead of expanding this.

          [JENKINS-4547] Subversion checkout directory does not expand variables

          voorth added a comment -

          Come to think of it, it's perfectly logical for the SCM not to trigger on a variable that hasn't been set yet....

          voorth added a comment - Come to think of it, it's perfectly logical for the SCM not to trigger on a variable that hasn't been set yet....

          oscarLoras added a comment -

          I have the same problem. I describe in the JENKINS-5792.

          Is there any solution that can be applied to solve this problem?

          oscarLoras added a comment - I have the same problem. I describe in the JENKINS-5792 . Is there any solution that can be applied to solve this problem?

          kief added a comment - - edited

          I have this isssue with Hudson 1.355. I have set a parameter BRANCH to the value "trunk".

          I set the Source Code Management field "Repository URL" to "http://mysvn.mydomain.com/mysvn/$BRANCH/MyApp". The configuration panel gives an error that "/$BRANCH/MyApp" doesn't exist, but as @mdonohue says, this is not an issue. I can save it, run the build setting the BRANCH parameter to "trunk", and it checks out "http://mysvn.mydomain.com/mysvn/trunk/MyApp".

          However, when I set the Local module directory to $BRANCH, it uses this literally, checking out to "workspace/my-hudson-project/$BRANCH/MyApp", rather than "workspace/my-hudson-project/trunk/MyApp".

          So it seems that I can't get the parameter to expand in the "Local module directory", as voorth described.

          I have found a workaround, which is to use the Advanced Project Options / Use custom workspace field. I set this to workspace/$JOB_NAME/$BRANCH, and this checks out my source into the "workspace/my-hudson-project/trunk/MyApp".

          However, the Local module directory would be cleaner, so hopefully that can be changed at some point.

          kief added a comment - - edited I have this isssue with Hudson 1.355. I have set a parameter BRANCH to the value "trunk". I set the Source Code Management field "Repository URL" to "http://mysvn.mydomain.com/mysvn/$BRANCH/MyApp". The configuration panel gives an error that "/$BRANCH/MyApp" doesn't exist, but as @mdonohue says, this is not an issue. I can save it, run the build setting the BRANCH parameter to "trunk", and it checks out "http://mysvn.mydomain.com/mysvn/trunk/MyApp". However, when I set the Local module directory to $BRANCH, it uses this literally, checking out to "workspace/my-hudson-project/$BRANCH/MyApp", rather than "workspace/my-hudson-project/trunk/MyApp". So it seems that I can't get the parameter to expand in the "Local module directory", as voorth described. I have found a workaround, which is to use the Advanced Project Options / Use custom workspace field. I set this to workspace/$JOB_NAME/$BRANCH, and this checks out my source into the "workspace/my-hudson-project/trunk/MyApp". However, the Local module directory would be cleaner, so hopefully that can be changed at some point.

          tapiomtr added a comment -

          I'd like to create parameterized build, so that I can enter that parameter value into SCM Repository URL like this: https://xxxx/svn/repos/xxx/xxx/builds/${BUILD}
          and into it's optional parameter Local module directory (optional) like this:$BUILD

          It seams that the SCM URL works fine, but the optional Local module parameter doesn't work, e.g. the check out goes to directory $BUILD.

          tapiomtr added a comment - I'd like to create parameterized build, so that I can enter that parameter value into SCM Repository URL like this: https://xxxx/svn/repos/xxx/xxx/builds/$ {BUILD} and into it's optional parameter Local module directory (optional) like this:$BUILD It seams that the SCM URL works fine, but the optional Local module parameter doesn't work, e.g. the check out goes to directory $BUILD.

          dogfood added a comment -

          Integrated in plugins_subversion #104
          [FIXED JENKINS-4547] Subversion checkout directory is now expanded (based on build paramaters and global env variables)

          rseguy :
          Files :

          • /trunk/hudson/plugins/subversion/src/main/java/hudson/scm/SubversionSCM.java

          dogfood added a comment - Integrated in plugins_subversion #104 [FIXED JENKINS-4547] Subversion checkout directory is now expanded (based on build paramaters and global env variables) rseguy : Files : /trunk/hudson/plugins/subversion/src/main/java/hudson/scm/SubversionSCM.java

          Code changed in jenkins
          User: rseguy
          Path:
          src/main/java/hudson/scm/SubversionSCM.java
          http://jenkins-ci.org/commit/subversion-plugin/99c78ce39b3ac00b44d790f995fa6d66d0211cee
          Log:
          [FIXED JENKINS-4547] Subversion checkout directory is now expanded (based on build paramaters and global env variables)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: rseguy Path: src/main/java/hudson/scm/SubversionSCM.java http://jenkins-ci.org/commit/subversion-plugin/99c78ce39b3ac00b44d790f995fa6d66d0211cee Log: [FIXED JENKINS-4547] Subversion checkout directory is now expanded (based on build paramaters and global env variables)

          Code changed in jenkins
          User: rseguy
          Path:
          src/main/java/hudson/scm/SubversionSCM.java
          http://jenkins-ci.org/commit/subversion-plugin/99c78ce39b3ac00b44d790f995fa6d66d0211cee
          Log:
          [FIXED JENKINS-4547] Subversion checkout directory is now expanded (based on build paramaters and global env variables)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: rseguy Path: src/main/java/hudson/scm/SubversionSCM.java http://jenkins-ci.org/commit/subversion-plugin/99c78ce39b3ac00b44d790f995fa6d66d0211cee Log: [FIXED JENKINS-4547] Subversion checkout directory is now expanded (based on build paramaters and global env variables)

          Bassam Khouri added a comment - - edited

          I'm seeing this issue in the following environment:

          Jenkins Version 2.32.2
          Subversion Plugin: 2.7.1
          Jenkins Master is running Windows
          Jenkins Slave is running Windows

           

          In  the Local Directory, I tried %MYDIR%, ${MYDIR} and neither of them work.

          Bassam Khouri added a comment - - edited I'm seeing this issue in the following environment: Jenkins Version 2.32.2 Subversion Plugin: 2.7.1 Jenkins Master is running Windows Jenkins Slave is running Windows   In  the Local Directory, I tried %MYDIR% , ${MYDIR } and neither of them work.

          Alex Earl added a comment -

          Is MYDIR a parameter to the job?

          Alex Earl added a comment - Is MYDIR a parameter to the job?

          Alex Earl added a comment -

          This works for me just fine with the latest bits.

          Alex Earl added a comment - This works for me just fine with the latest bits.

            Unassigned Unassigned
            voorth voorth
            Votes:
            11 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: