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

CpsScmFlowDefinition does not resolve variables

    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
            mmallard Matthew Mallard added a comment -

            Has this "separate feature" been added yet to the "lightweight checkout" functionality? In my case, I have a pipeline job that is parameterized. One of the parameters is the branch name which I intend to use later on in the job when selecting the definition "Pipeline script from SCM". When selecting that you have the option to select your Git repository and Branches to build, but it doesn't recognize the parameter when "Lightweight checkout" is selected.

            Show
            mmallard Matthew Mallard added a comment - Has this "separate feature" been added yet to the "lightweight checkout" functionality? In my case, I have a pipeline job that is parameterized. One of the parameters is the branch name which I intend to use later on in the job when selecting the definition "Pipeline script from SCM". When selecting that you have the option to select your Git repository and Branches to build, but it doesn't recognize the parameter when "Lightweight checkout" is selected.
            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.
            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 -

            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
            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?

              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: