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

jenkins pipelines Environment not working

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • Jenkins ver. 2.46.2

      Pipeline 2.5
      Pipeline Graph Analysis Plugin 1.3
      Pipeline: Groovy 2.32

      Create simple pipeline:

      // Add fancy build parameter.
      properties([
        parameters([
          string( 
            defaultValue: "asd",
            description: 'Some description',
            name: 'foo'
          ),
        ])
      ])
      
      print foo
      if (foo == "true") {
         print "true"
      }
      else {
         print "false"
      }
      

      call pipeline/job with foo=true

      Result:

      [Pipeline] echo
      asd
       [Pipeline] echo
      false
       [Pipeline] End of Pipeline
      Finished: SUCCESS

      parametrized build passed variables is not being propagated to the pipeline.

      I might be doing something wrong but this works on simple job. 

            Unassigned Unassigned
            mangirdas Mangirdas Judeikis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: