Jenkins post-test action when test succeeds: pull changes and restart play server

I currently have a server, running a Play Framework instance. The source code of this Play website is located into a GitHub repository. When the repo gets changed, it pokes Jenkins to pull and test the new source files.

What I like to do now, it saying something like ‘if the build succeeds, pull the new code on the server into a specified directory and restart the play instance’.

What would be the best way to achieve this? I was thinking that a simple bash post-test script could work, but I was wondering if there were any neater approaches.

Thanks in advance.

Answer

I would rather create a subsequent job, and trigger it only if the build succeeds, using the “build other projects” action in the post-build actions.

Attribution
Source : Link , Question Author : Tom Naessens , Answer Author : rcomblen

Leave a Comment