Plugin Information
| Plugin ID |
batch-task |
| Latest Release |
1.9 |
| Latest Release Date |
Nov 05, 2009 |
| Changes in Latest Release |
via Fisheye |
| Maintainer(s) |
n/a (java.net id: mindless) |
| Issue Tracking |
Open Issues |
This plugin adds batch tasks that are not regularly executed to projects, such as releases, integration, archiving, etc. In this way, anyone in the project team can execute them in a way that leaves record.
Usage
When you install this plugin, your project configuration page gets additional "batch tasks" option as illustrated below:

A batch task consists of a shell script and a name. When you execute a build, the shell script gets run on the workspace, just like a build. Batch tasks and builds "lock" the workspace, so when one of those activities is in progress, all the others will block in the queue.
Once a task is configured, the project top page gets "task(s)" link, as illustrated below:

If you click that, you can see the status of all the tasks. You can schedule the execution of a task from here, too. Task executions are numbered like "123-456" where 123 portion refers to the latest build and 456 portion refers to the sequential number (so that you can execute a task multiple times with the same build.) The build number portion is significant because when a batch task runs, it sees the workspace as of the result of this build.

The details of the task execution and its console output are available by further clicking a task of the interest, as below:

Changelog
Version 1.9 (2009/11/05)
- Add "trigger even if build is unstable" selector for invoking tasks as a post-build action. Previously the tasks were always invoked (even for failed builds); now they will only run if the build result meets the required threshold (and never for failed builds).
- Fix build number written to job log when task is invoked as a post-build action (was off by one)
- Fix broken image for aborted task (grey ball)
- On task page, show only builds for this task in Build History (instead of all tasks)
- Avoid error if try to run a task when there are no builds for the project
Version 1.8 (2009/08/28)
- Improved the error diagnosis and recovery when a build no longer has a workspace (report) – requires Hudson 1.319 or higher.
Version 1.7 (2009/03/31)
- Allow non-admin users ability to manage and execute tasks (issue #1198)
Version 1.6 (2009/02/27)
- Updated to work with recent versions of Hudson (issue #3173)
Version 1.5 (2009/01/27)
- Fixed a bug "batchtask in queue causes NPE at startup" (issue #2925)
Version 1.3 (2008/01/29)
- Updated to work with the latest version of Hudson, so that it won't cause AbstractMethodError (report)
- Last successful/failed builds were computed incorrectly (issue #1012)
- Icon size in task list is now configurable (issue #1010)
Version 1.2 (2007/11/16)
- Task can be now individually deleted from the left menu
- Build number should start from 1 (issue #991)
- Tasks now work on Windows (issue #985)
Build icon in task list is not larger than the other icons (issue #1010)
Version 1.0 (2007/10/18)
Comments (7)
Jul 24, 2008
fabrice says:
Ok nice but only admin role can execute batch task ! So it is not anyone. ...Ok nice but only admin role can execute batch task ! So it is not anyone.
Should I opened a issue on jira ?
Oct 01, 2008
Wouter Batelaan says:
I'm confused about this plugin - I don't see its usefulness, since it seems to d...I'm confused about this plugin - I don't see its usefulness, since it seems to do what the locks plugin does
( http://hudson.gotdns.com/wiki/display/HUDSON/Locks+and+Latches+plugin ).
And the tasks it allows to create are less flexible than the tasks in a normal job.
How do the batch plugin tasks relate to the normal tasks that a job performs?
Do they run before, after, or in paralel?
Oct 01, 2008
Purnank Harjivanbhai Ghumalia says:
Hi Wouter, This plug-in allows to have jobs to be executed in isolation! It he...Hi Wouter,
This plug-in allows to have jobs to be executed in isolation!
It helps for the jobs that are not executed very frequently, or at-least not nightly!
The jobs are just a "click" away!
--PG
Jan 23, 2009
James Brook says:
Is it possible to use this plugin to execute tasks against builds that are not t...Is it possible to use this plugin to execute tasks against builds that are not the latest build? It would seem useful to be able to select a build from the build history and then have a 'tasks' link to run tasks for that particular build, for example a 'release/deploy' task. You don't always want to deploy the most recent build. --James
Feb 22, 2009
Shibu Gope says:
This plugin is causing Hudson (v1.285) to crash with the following exception: ja...This plugin is causing Hudson (v1.285) to crash with the following exception:
javax.servlet.ServletException: org.apache.commons.jelly.JellyTagException: jar:file:/ACN/app/jboss/server/ci/tmp/deploy/tmp41576hudson-exp.war/WEB-INF/lib/hudson-core-1.285.jar!/lib/hudson/queue.jelly:60:62: <j:set> java.lang.IncompatibleClassChangeError
org.kohsuke.stapler.jelly.JellyClassTearOff.serveIndexJelly(JellyClassTearOff.java:48)
org.kohsuke.stapler.jelly.JellyFacet.handleIndexRequest(JellyFacet.java:70)
org.kohsuke.stapler.Stapler.invoke(Stapler.java:427)
org.kohsuke.stapler.Stapler.invoke(Stapler.java:459)
org.kohsuke.stapler.Stapler.invoke(Stapler.java:356)
org.kohsuke.stapler.Stapler.service(Stapler.java:116)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
...
Aug 07
Jim Patterson says:
Here is an idea for enhancement of this plugin: Make the batch tasks plugin ...Here is an idea for enhancement of this plugin: Make the batch tasks plugin have the same functionality as the "This build is parameterized" checkbox in the configuration page of the projects. It would be best if each individual task had its own per task "This task is parameterized" checkbox. However it would still be helpful if there was a single "These tasks are parameterized" checkbox for all the tasks to share. In either case, when a parameterized task is executed, the parameters would asked for and the values of the parameters would be setup as environment variables that are available for the tasks to use. With this functionality, tasks could be written to do almost anything to the workspace independent of the last build of the project.
Sep 04
Adam Armistead says:
I totally second this idea. This would be quite helpful. I am lookin...I totally second this idea. This would be quite helpful. I am looking for a way to deploy my project and prompt for the software version number for the deployment, and this idea would fit that nicely.