• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • envinject-plugin
    • None

      I'm using both a properties file path and script file path in a pre-build section. The properties file path resolves to the relative workspace correctly however, when using a script file it does not. One must enter a fully qualified path.

      NON WORKING:
      11:26:56 Changelog calculated successfully.
      11:26:56 Run condition [Boolean condition] enabling prebuild for step [Execute Windows batch command]
      11:26:56 No emails were triggered.
      11:26:56 [EnvInject] - Executing scripts and injecting environment variables after the SCM step.
      11:26:57 [EnvInject] - Injecting as environment variables the properties file path 'properties/environment.properties'
      11:26:57 [EnvInject] - Variables injected successfully.
      11:26:57 [EnvInject] - Injecting as environment variables the properties content
      11:26:57 AO_APPLICATION=WebSphereBuilds
      11:26:57 AO_ENVIRONMENT=SND
      11:26:57
      11:26:57 [EnvInject] - Variables injected successfully.
      11:26:57 Executing 'setupClasspath.bat'.
      11:26:57 [SND-WebSphereBuilds] $ setupClasspath.bat
      11:26:57 [EnvInject] - [ERROR] - [EnvInject] - [ERROR] - Problems occurs on injecting env vars as a build wrap: Error occurs on execution script file path.
      11:26:57 Run condition [Boolean condition] enabling perform for step [Execute Windows batch command]
      11:26:57 [SND-WebSphereBuilds] $ cmd /c call E:\TEMP\hudson614402344419560499.bat

      WORKING:
      11:30:19 Run condition [Boolean condition] enabling prebuild for step [Execute Windows batch command]
      11:30:19 No emails were triggered.
      11:30:19 [EnvInject] - Executing scripts and injecting environment variables after the SCM step.
      11:30:19 [EnvInject] - Injecting as environment variables the properties file path 'properties/environment.properties'
      11:30:19 [EnvInject] - Variables injected successfully.
      11:30:19 [EnvInject] - Injecting as environment variables the properties content
      11:30:19 AO_APPLICATION=WebSphereBuilds
      11:30:19 AO_ENVIRONMENT=SND
      11:30:19
      11:30:19 [EnvInject] - Variables injected successfully.
      11:30:19 Executing 'E:/JenkinsWAND/workspace/SND-WebSphereBuilds/bin/setupClasspath.bat'.
      11:30:19 [SND-WebSphereBuilds] $ E:/JenkinsWAND/workspace/SND-WebSphereBuilds/bin/setupClasspath.bat
      11:30:19 [EnvInject] - Script executed successfully.
      11:30:19 [locks-and-latches] Checking to see if we really have the locks
      11:30:19 [locks-and-latches] Have all the locks, build can start
      11:30:19 [EnvInject] - Injecting environment variables from a build step.
      11:30:19 [EnvInject] - Injecting as environment variables the properties file path 'E:/JenkinsWAND/workspace/SND-WebSphereBuilds/properties/classpath.properties'
      11:30:19 [EnvInject] - Variables injected successfully.

          [JENKINS-16398] Relative pre-build Script paths don't work

          More a Jenkins issue
          Try with the following snippet and it should work:
          ./bin/setupClasspath.${CMD_SUFFIX}

          Gregory Boissinot added a comment - More a Jenkins issue Try with the following snippet and it should work: ./bin/setupClasspath.${CMD_SUFFIX}

          Does it work for you?

          Gregory Boissinot added a comment - Does it work for you?

          Although the scrip file has changed, the path problem still exists:

          13:38:22 Building remotely on Slave01 in workspace E:\JenkinsWAND\workspace\SND-Environment
          13:38:27 [EnvInject] - Executing scripts and injecting environment variables after the SCM step.
          13:38:27 [EnvInject] - Injecting as environment variables the properties file path './environment/properties/environment.properties'
          13:38:27 [EnvInject] - Variables injected successfully.
          13:38:27 Executing './bin/setupEnvironment.bat'.
          13:38:27 [SND-Environment] $ ./bin/setupEnvironment.bat
          13:38:27 [EnvInject] - [ERROR] - [EnvInject] - [ERROR] - Problems occurs on injecting env vars as a build wrap: java.io.IOException: Cannot run program "./bin/setupEnvironment.bat" (in directory "E:\JenkinsWAND\workspace\SND-Environment"): CreateProcess error=2, The system cannot find the file specified
          13:38:27 Finished: FAILURE

          Maybe this is due to a multi-configuration project type build? I have attached by build XML.

          Walter Kacynski added a comment - Although the scrip file has changed, the path problem still exists: 13:38:22 Building remotely on Slave01 in workspace E:\JenkinsWAND\workspace\SND-Environment 13:38:27 [EnvInject] - Executing scripts and injecting environment variables after the SCM step. 13:38:27 [EnvInject] - Injecting as environment variables the properties file path './environment/properties/environment.properties' 13:38:27 [EnvInject] - Variables injected successfully. 13:38:27 Executing './bin/setupEnvironment.bat'. 13:38:27 [SND-Environment] $ ./bin/setupEnvironment.bat 13:38:27 [EnvInject] - [ERROR] - [EnvInject] - [ERROR] - Problems occurs on injecting env vars as a build wrap: java.io.IOException: Cannot run program "./bin/setupEnvironment.bat" (in directory "E:\JenkinsWAND\workspace\SND-Environment"): CreateProcess error=2, The system cannot find the file specified 13:38:27 Finished: FAILURE Maybe this is due to a multi-configuration project type build? I have attached by build XML.

            gbois Gregory Boissinot
            walterk82 Walter Kacynski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: