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

Different behaviour when using Mercurial with "Subdirectory" in MultiSCM vs. SCM

XMLWordPrintable

      I just found that in jobs (created from Job-DSL code if that matters), the Gradle plugin behaves differently depending on whether a Mercurial checkout using the Subdirectory setting is used with plain SCM vs. MultiSCM. Here's a simplified example:

      job('./MultiSCMTest') {
        multiscm {
          hg(repoUrl) {
            branch('default')
            clean(true)
            installation('Mercurial')
            subdirectory('repo')
          }
        }
        triggers {
          scm('H/15 * * * *')
        }
        steps {
          gradle {
            passAllAsProjectProperties(false)
            passAllAsSystemProperties(false)
            rootBuildScriptDir('repo')
            switches('')
            tasks('clean --no-daemon')
            useWorkspaceAsHome(true)
          }
        }
      }

      Executing the resulting job yields the expected result (the Gradle wrapper contained in the repository is executed successfully, like:

      [Gradle] - Launching build.
      [repo] $ /srv/jenkins/workspace/MultiSCMTest/repo/gradlew clean --no-daemon

      However, if I change "multiscm" to just "scm", the build runs into an error:

      [Gradle] - Launching build.
      FATAL: The Gradle wrapper has not been found in these directories: /srv/jenkins/workspace/MultiSCMTest/repo/repo

      Notice the doubled "/repo" at the end of the path. I'd expect both to behave identically.

            wolfs Stefan Wolf
            dhs Dirk Heinrichs
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: