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

Multi-line, concatenated-string values aren't parsed/passed in/to "environment" variable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Duplicate
    • Labels:
      None
    • Environment:
      Jenkins 2.32.2
      Pipeline Model Definition Plugin 1.1.1 (and all associated/dependent plugins, same/greater versions)
    • Similar Issues:

      Description

      Given the following snippet of a Jenkinsfile:

      environment

      { PYTEST_ADDOPTS = "-n=10 " + "--color=yes " + "--tb=short " + "--driver=SauceLabs " + "--variables=capabilities.json" }

      When trying to run the above, we get:

      Actual Results:

      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      WorkflowScript: 19: Environment variable values must either be strings or function calls. @ line 19, column 5.
      PYTEST_ADDOPTS =
      ^

      The workaround is to do:

      environment

      { PYTEST_ADDOPTS = "-n=10 --color=yes --tb=short --driver=SauceLabs --variables=capabilities.json" }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                stephendonner Stephen Donner
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: