Question

Is it possible to run a Nant script as a Jenkins post build action?

I get the option to run a script as a Build Step but not as a build action. Is there any particular plugin which enables this option.

The reason I am looking for this functionality is that I need to run a script which depends on the ArtifactDeployer post build action. If i specify the code in the build step it gets executed before the ArtifactDeployer and the build fails

Was it helpful?

Solution

You can use the Post Build Task Plugin

Plugin screenshot

edit

One way of getting the build number if it's not working with this plugin is using the Groovy Post Build Plugin

With it you can execute groovy code as a post build action, get the build number and execute NAnt

the build number is accessible from the following property

manager.build.number

OTHER TIPS

Post-build Actions -> Execute a set of script run after a build when it succeeds or fails. My experience shows that it only sometimes runs when a build is aborted.

As advised above, the Post-build Actions -> Post build task (via the named post task plug in) is always evaluated for run (regardless of the build exit status). Additional setting via phrase in the log ("Build was aborted") works reliable for me.

My problem was to run something even on an aborted build and post build task sorted out this problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top