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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • 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

            Hide
            abayer Andrew Bayer added a comment -

            This is a dupe of JENKINS-42771, isn't it?

            Show
            abayer Andrew Bayer added a comment - This is a dupe of JENKINS-42771 , isn't it?
            Hide
            stephendonner Stephen Donner added a comment -

            Sorry, yeah :-\

            Show
            stephendonner Stephen Donner added a comment - Sorry, yeah :-\
            Hide
            bitwiseman Liam Newman added a comment -

            Bulk closing resolved issues.

            Show
            bitwiseman Liam Newman added a comment - Bulk closing resolved issues.

              People

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

                Dates

                Created:
                Updated:
                Resolved: