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

New post-build action to execute aribtrary shell commands

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Major Major
    • other
    • None
    • Platform: All, OS: All

      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.

          [JENKINS-684] New post-build action to execute aribtrary shell commands

          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.

          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.

          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.

          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.

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

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

          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.

          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.

              • Issue 1277 has been marked as a duplicate of this issue. ***

          Kohsuke Kawaguchi added a comment - Issue 1277 has been marked as a duplicate of this issue. ***

          mdonohue added a comment -

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

          mdonohue added a comment - I think pmendelson's need would be best served by issue 53.

          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).

          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).

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

              Created:
              Updated:
              Resolved: