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

Script executed by PostiBuildScript plugin is unable to use Environment variable defined in Jenkins

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • postbuildscript-plugin
    • None
    • OS - Linux, Jenkins Running in Tomcat 7.

      We have configured a job with "Perforce" as source code management, where we haven't defined the depot setting (In this case it is picking perforce setting from environment variable). This is working fine.

      Problem has started when i configured a script on PostBuildScript. This script do some checkin on perforce after build. This script is not working when executing under Jenkins while i am able to use same script from the console.
      Here is error -

      Perforce client error:
      Connect to server failed; check $P4PORT.
      TCP connect to perforce:1666 failed.
      connect: perforce:1666: Connection refused
      Perforce client error:
      Connect to server failed; check $P4PORT.
      TCP connect to perforce:1666 failed.
      connect: perforce:1666: Connection refused

      Value for P4PORT environment variable using by this script (perorce:1666 as shown in logs) and set value in Jenkins are different.
      That mean PostBuildScript doesn't pass the environment variable to script which it execute.

            dheid Daniel Heid
            parmendratyagi Parmendra Tyagi
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: