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

      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

       

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

          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  

          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

          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

          Sandeep Kumar added a comment -

          The reporter provided no input. grujicbr if you still see this issue feel free to reopen. Thanks

          Sandeep Kumar added a comment - The reporter provided no input. grujicbr if you still see this issue feel free to reopen. Thanks

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

              Created:
              Updated:
              Resolved: