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

expose "Stream Codeline" as an environment variable

      I retrieve the pipeline script from SCM. See attached screenshot for context.
      Now it would be helpful to be able to use the value of (at least) "Stream Codeline" inside my pipeline script.

      As far as I understand this is not possible so far?

          [JENKINS-39107] expose "Stream Codeline" as an environment variable

          Heiko Nardmann created issue -
          Daniel Hoerner made changes -
          Rank New: Ranked higher
          Daniel Hoerner made changes -
          Rank New: Ranked higher
          Karl Wirth made changes -
          Labels New: P4_VERIFY

          Karl Wirth added a comment -

          Still not possible but a possible workaround is to use P4Groovy. For example:

          def p4 = p4(credential: 'MyCredential', workspace: staticSpec(charset: 'none', name: env.P4_CLIENT))
          def myClient = p4.fetch('client', env.P4_CLIENT)
          println ("Stream is: " + myClient.get("Stream") )
          

          The output seen is:

          Stream is: //streams/main
          

           

           

          Karl Wirth added a comment - Still not possible but a possible workaround is to use P4Groovy. For example: def p4 = p4(credential: 'MyCredential' , workspace: staticSpec(charset: 'none' , name: env.P4_CLIENT)) def myClient = p4.fetch( 'client' , env.P4_CLIENT) println ( "Stream is: " + myClient.get( "Stream" ) ) The output seen is: Stream is: //streams/main    
          Paul Allen made changes -
          Labels Original: P4_VERIFY New: P4_BACKLOG
          Karl Wirth made changes -
          Labels Original: P4_BACKLOG New: P4_VERIFY
          Karl Wirth made changes -
          Priority Original: Minor [ 4 ] New: Blocker [ 1 ]
          Karl Wirth made changes -
          Labels Original: P4_VERIFY New: P4_SUPPORT

          Karl Wirth added a comment -

          Reports that this does not work when libraries have been loaded first.

           

          e.g.

           

          import GLOBAL Lib
          ...
          p4sync
          

           

          Need to confirm with a test case.

           

          Karl Wirth added a comment - Reports that this does not work when libraries have been loaded first.   e.g.   import GLOBAL Lib ... p4sync   Need to confirm with a test case.  

            naveenboni Naveen Boni
            heiko_nardmann Heiko Nardmann
            Votes:
            9 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated: