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

New post-build action to execute aribtrary shell commands

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Component/s: other
    • Labels:
      None
    • Environment:
      Platform: All, OS: All

      Description

      I would like a post build action to allow me to execute arbitrary commands
      having same environment variables set that are exposed to regular build actions.

      My personal use of this feature would be to programtecially some files that
      appear in files in $

      {WORKSPACE}

      /../builds/$

      {JOB_ID}

      directory. such as the
      build number.

        Issue Links

          Activity

          Hide
          kohsuke Kohsuke Kawaguchi added a comment -

          While such a plugin is certainly conceivable, and perhaps might even make sense
          in some situations, but...

          1. you might just as well choose "shell script" as the main build action and
          then do anything there. There's no practical difference between doing
          something as the main build vs as a publisher.

          2. shell script will not be able to archive files if the build is done on a slave.

          Show
          kohsuke Kohsuke Kawaguchi added a comment - While such a plugin is certainly conceivable, and perhaps might even make sense in some situations, but... 1. you might just as well choose "shell script" as the main build action and then do anything there. There's no practical difference between doing something as the main build vs as a publisher. 2. shell script will not be able to archive files if the build is done on a slave.
          Hide
          pmendelson pmendelson added a comment -

          If I make my build a shell script I can't update the builds/$

          {JOB_ID}

          directory
          because (I think) that directory doesn't get created until after the build
          completes.

          I was hoping that it would be created before the post-build actions occured.

          Show
          pmendelson pmendelson added a comment - If I make my build a shell script I can't update the builds/$ {JOB_ID} directory because (I think) that directory doesn't get created until after the build completes. I was hoping that it would be created before the post-build actions occured.
          Hide
          kohsuke Kohsuke Kawaguchi added a comment -

          The build directory is created as soon as the build starts.

          Show
          kohsuke Kohsuke Kawaguchi added a comment - The build directory is created as soon as the build starts.
          Hide
          pmendelson pmendelson added a comment -

          In my case I'm trying to modify build.xml to change <number> from the hudson
          generated build number to a different value. In my experiment that file is not
          created until after the build is done.

          Show
          pmendelson pmendelson added a comment - In my case I'm trying to modify build.xml to change <number> from the hudson generated build number to a different value. In my experiment that file is not created until after the build is done.
          Hide
          kohsuke Kohsuke Kawaguchi added a comment -
              • Issue 1277 has been marked as a duplicate of this issue. ***
          Show
          kohsuke Kohsuke Kawaguchi added a comment - Issue 1277 has been marked as a duplicate of this issue. ***
          Hide
          mdonohue mdonohue added a comment -

          I think pmendelson's need would be best served by issue 53.

          Show
          mdonohue mdonohue added a comment - I think pmendelson's need would be best served by issue 53.
          Hide
          mindless Alan Harder added a comment -

          Closing this issue.. the requestor's intent is a duplicate of JENKINS-53, as mentioned. The request as originally written can be achieved with batch-tasks plugin (create a task with the shell script, invoke it with the post-build option to invoke a batch-task).

          Show
          mindless Alan Harder added a comment - Closing this issue.. the requestor's intent is a duplicate of JENKINS-53 , as mentioned. The request as originally written can be achieved with batch-tasks plugin (create a task with the shell script, invoke it with the post-build option to invoke a batch-task).

            People

            • Assignee:
              Unassigned
              Reporter:
              pmendelson pmendelson
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: