• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • None
    • Platform: All, OS: All

      I found to my annoyance than when running a project which uses a shell command,
      Hudson creates a hudson*sh file in the project workspace. This is not polite;
      the user expects that the workspace contains just the checkout and build
      products. Stray files can confuse scripts.

      Shell/BatchFile call FilePath.createTempFile. At first I thought to just delete
      this method and change e.g. Shell to say

      File script = null;
      // ...
      script = File.createTempFile("hudson","sh");
      script.deleteOnExit();
      Writer w = new FileWriter(script);
      // ...

      But then I noticed the line

      String[] cmd = new String[]

      { DESCRIPTOR.getShell(),"-xe",script.getRemote()}

      ;

      I have never used slaves and so I do not know the significance of the remote
      path here. Surely the hudson*sh file is not used from other machines? Can this
      simply be written (with File script) as

      String[] cmd = new String[]

      { DESCRIPTOR.getShell(),"-xe",script.getAbsolutePath()}

      ;

      without breaking remote builds?

          [JENKINS-183] Shell scripts add temp file to workspace

          Unfortunately the shell script needs to be inside the workspace for it to be
          visible from the slave that executes it.

          Maybe we can run the shell and then send commands to its stdin?

          Kohsuke Kawaguchi added a comment - Unfortunately the shell script needs to be inside the workspace for it to be visible from the slave that executes it. Maybe we can run the shell and then send commands to its stdin?

          Jesse Glick added a comment -

          I guess. Can't be of much help; have no idea how the master/slave setup works.

          Jesse Glick added a comment - I guess. Can't be of much help; have no idea how the master/slave setup works.

          Fixed in 1.71.

          Kohsuke Kawaguchi added a comment - Fixed in 1.71.

            Unassigned Unassigned
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: