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

Pipeline Script from SCM (Perforce) set's environment variables wrong for the p4sync that run's during pipeline

    XMLWordPrintable

Details

    Description

      We are trying to use pipelinescript from SCM feature of the p4 plugin, but are running into an issue with the wrong environment variables being set in the pipeline while the pipeline script is actually executing.

      The setup that we have is a workspace / stream that syncs specific scripts and than run's that specific pipeline script.

      Inside the pipeline script we run p4sync to sync to a DIFFERENT workspace/stream as the guidelines say we should be using different workspaces, however the  value of "${env.P4_CHANGELIST}" that we access inside the script body of a step is reporting the changelist from the initial sync from the declarative workspace and not the sync step that just ran during the p4sync

       

      How do we get the changelist that was ran from the last p4sync and is it possible to fix the plugin to update the environment variable to match the last p4sync

       

      Attachments

        Activity

          grujicbr Branislav Grujic created issue -
          grujicbr Branislav Grujic made changes -
          Field Original Value New Value
          Priority Minor [ 4 ] Blocker [ 1 ]
          grujicbr Branislav Grujic added a comment - I have also found that someone else ran into the same issue: https://stackoverflow.com/questions/59845893/jenkins-pipeline-script-from-scm-shares-perforce-workspace-with-sync-inside-of-s  
          p4karl Karl Wirth made changes -
          Labels perforce pipeline pipeline-p4 plugin P4_SUPPORT perforce pipeline pipeline-p4 plugin
          p4karl Karl Wirth added a comment -

          Hi grujicbr - Sorry for the delay. This case slipped through my notification monitoring scripts.

          It's possible what you are seeing is a variation on this behavior: JENKINS-64747

          Can you please add some debugging to display P4_CHANGELIST after each sync step in your scripts then get me the scripts and the full console log.

          Regards,

          Karl

          p4karl Karl Wirth added a comment - Hi grujicbr  - Sorry for the delay. This case slipped through my notification monitoring scripts. It's possible what you are seeing is a variation on this behavior:  JENKINS-64747 Can you please add some debugging to display P4_CHANGELIST after each sync step in your scripts then get me the scripts and the full console log. Regards, Karl

          People

            Unassigned Unassigned
            grujicbr Branislav Grujic
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: