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

CpsScmFlowDefinition does not resolve variables

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: workflow-cps-plugin
    • Labels:
    • Environment:
      Jenins 1.613, Workflow plugin 1.6
      Also: Jenkins 1.651.1, workflow-job 2.3
    • Similar Issues:

      Description

      When selecting the "Groovy CPS DSL from SCM" option for a worflow job, the SCM plugins do not appear to resolve build parameters or environment variables. I am using the git plugin and when I use it from other jobs I can specify a build parameter, like "BuildBranch", and use that when specifying what branch should be built:

      Branches to build: */${BuildBranch}

      This does not work when I use the Groovy CPS DSL from SCM.

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -
            Show
            jglick Jesse Glick added a comment - Johnny Willemsen seeĀ  JENKINS-42836 .
            Hide
            atikhono Anna Tikhonova added a comment -

            Jesse Glick Thanks, with lightweight checkout off ${branch} is resolved. Still, git reference repository path is not. Should I file another issue for that?

            Show
            atikhono Anna Tikhonova added a comment - Jesse Glick Thanks, with lightweight checkout off ${branch} is resolved. Still, git reference repository path is not. Should I file another issue for that?
            Hide
            jglick Jesse Glick added a comment -

            Anna Tikhonova that sounds like an RFE for git-plugin not specific to Pipeline.

            Show
            jglick Jesse Glick added a comment - Anna Tikhonova that sounds like an RFE for git-plugin not specific to Pipeline.
            Hide
            asfaltboy Pavel Savshenko added a comment -

            Jesse Glick I came across this issue as well, and unchecking "lightweight checkout" also helped. However I cannot figure out why exactly, can you give a bit more context into why the env/parameter interpolation is disabled when LC is on ?

            Show
            asfaltboy Pavel Savshenko added a comment - Jesse Glick I came across this issue as well, and unchecking "lightweight checkout" also helped. However I cannot figure out why exactly, can you give a bit more context into why the env/parameter interpolation is disabled when LC is on ?
            Hide
            jglick Jesse Glick added a comment -

            Lightweight checkout is going through a completely unrelated code path, and currently SCMFileSystem implementations do not honor variables (or even have an API allowing them to honor variables IIRC). Would have to be a separate feature.

            Show
            jglick Jesse Glick added a comment - Lightweight checkout is going through a completely unrelated code path, and currently SCMFileSystem implementations do not honor variables (or even have an API allowing them to honor variables IIRC). Would have to be a separate feature.

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                nsnewland Nicholas Newland
              • Votes:
                50 Vote for this issue
                Watchers:
                65 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: