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

execute scripts on axes after all build steps are finished

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • postbuildscript-plugin
    • None
    • jenkins 1.647
      postbuildscript-plugin 0.17

      I have a cluster environment consisting of 2 nodes, each containing single Apache Tomcat instance. The first node contains database as well.

      I have a Matrix project configured to run ant targets on these 2 slaves.
      Since only first node contains database, there are some additional time consuming ant targets needed to be called only on that node. After build is finished on all nodes I would like to bring tomcat instances up.

      At the moment I'm running set of scripts with execute script on Matrix option and I execute commands over SSH for each of the nodes.

      It would be great if postbuildscript plugin could execute script on axes after all nodes have finished all their build steps.

      Currently executing script on axes is done regardless of build process on other nodes.

          [JENKINS-34311] execute scripts on axes after all build steps are finished

          Daniel Heid added a comment -

          Thanks for improving the PostBuildScript plugin, but I'm not sure, that I understood the feature request properly.

          • Why not simply put a second build step after the first one?
          • Could you please provide a config.xml so that it will be clearer for me?

          Daniel Heid added a comment - Thanks for improving the PostBuildScript plugin, but I'm not sure, that I understood the feature request properly. Why not simply put a second build step after the first one? Could you please provide a config.xml so that it will be clearer for me?

          Hi Daniel,

          at the time of creating this ticket I've been struggling with running post action after all build steps on all nodes in cluster (aka slaves in matrix project) were finished. So I created a workaround to run post build script on the whole matrix  and use 'Send files and execute commands oveer ssh' plugin to start servers remotely. Instead I would expect to run simple shell command post action on axes but only when all steps on all slaves are finished (only if build pohase is finished on all nodes). Please have a look at the diagrams. The top one was what I experienced, where one of my applications was being started too early, when db was not ready at the time; the bottom one would be ideal solution in which Post build phase would be executed only if all build phases from slaves were finished.  

          Wojciech Półtorak added a comment - Hi Daniel, at the time of creating this ticket I've been struggling with running post action after all build steps on all nodes in cluster (aka slaves in matrix project) were finished. So I created a workaround to run post build script on the whole matrix  and use 'Send files and execute commands oveer ssh' plugin to start servers remotely. Instead I would expect to run simple shell command post action on axes but only when all steps on all slaves are finished (only if build pohase is finished on all nodes). Please have a look at the diagrams. The top one was what I experienced, where one of my applications was being started too early, when db was not ready at the time; the bottom one would be ideal solution in which Post build phase would be executed only if all build phases from slaves were finished.  

          attached also config file for my workaround with 'Send files and execute commands over SSH'

          Wojciech Półtorak added a comment - attached also config file for my workaround with 'Send files and execute commands over SSH'

            dheid Daniel Heid
            wojtuch Wojciech Półtorak
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: