Plugin Information
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 a record. UsageWhen 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:
Change LogVersion 1.17 (Fev. 24, 2013)
Version 1.16 (May 1, 2012)
Version 1.15 (Apr 5, 2012)
Version 1.14 (Nov 11, 2010) - requires Hudson 1.383+
Version 1.13 (Feb 10, 2010)
Version 1.12 (Feb 5, 2010)
Version 1.11 (Jan 3, 2010)
Version 1.10 (Dec 7, 2009)
Version 1.9 (Nov 5, 2009)
Version 1.8 (Aug 28, 2009)
Version 1.7 (Mar 31, 2009)
Version 1.6 (Feb 27, 2009)
Version 1.5 (Jan 27, 2009)
Version 1.3 (Jan 29, 2008)
Version 1.2 (Nov 16, 2007)
Version 1.0 (Oct 18, 2007)
|
Batch Task Plugin
Skip to end of metadata
Go to start of metadata




Comments (19)
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
wbatelaan - 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
jbrook - 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
Mar 09, 2012
Marvi Benedet says:
Hi James. This would be very useful to me too. As it seems that after 3 years t...Hi James.
This would be very useful to me too. As it seems that after 3 years the plugin didn't get the new feature, did you find any workaround for this?
Thanks, Marvix
Feb 22, 2009
shibug - 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, 2009
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, 2009
adamarmistead - 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.
Jul 12, 2010
Kalpesh Soni says:
+1 for paramerterizing batch builds koshuke where are thou?+1 for paramerterizing batch builds
koshuke where are thou?
Nov 10, 2009
Ben J Warner says:
When a user kicks off a task, it would be great to have their username available...When a user kicks off a task, it would be great to have their username available in an environment variable. I've used the tasks plugin to trigger all our deployment tasks. We record in a database who did each deployment, so at the moment user the tasks plugin, the "user" is an unknown. This is raised as issue #1628, but just thought I'd vote for it here as well.
Nov 12, 2009
krischan83 - says:
First, this plugin is great! What I miss a bit is: global environment prope...First, this plugin is great!
What I miss a bit is: global environment properties (set in Hudson main configuration) are not available to the batch task. But that's not a crucial issue for me. More a nice-to-have.
Christian
Dec 09, 2009
jamesclinton - says:
Great plugin. Thanks. Feature request: It would be great if the task history c...Great plugin. Thanks.
Feature request:
It would be great if the task history could be visible for a past Job.
The tasks history is currently refreshed after building the job, so someway of getting this for a previous job would be useful.
Hope that's clear.
Dec 15, 2009
Douglas Borg says:
This plugin is great! I second James' feature request above, and would like to...This plugin is great!
I second James' feature request above, and would like to add my own:
Would it be possible to allow batch tasks to run on a scheduled basis?
Why:
I have indexing jobs that I would like to run as a batch task for the deployment jobs they are related to. Currently, I have separate jobs in Hudson that check out the same workspace as the deployment job and I would like to avoid this if possible. It would also be nicer if it was a batch task because then I could directly relate the indexing runs to the deployment "build" number and not run the indexing jobs while the deployment job is running. Right now my indexing jobs just fail while the deployment is actually running. I hope this makes sense; please let me know if you have any questions or suggestions for other ways of accomplishing this.
Also, please let me know if there is a more appropriate place to request features for plugins than the plugin wiki page.
Thanks again!
Jan 26, 2010
Hugo Monteiro says:
Hi there, Thanks for this plugin, it's very useful. I have a feature request a...Hi there,
Thanks for this plugin, it's very useful.
I have a feature request and a "bug"(?) issue for it:
1) Bug(?): "Task" Menu should show every time if there are tasks configured and/or tasks defined for execution for the job.
"Task" Menu isn't shown if there are no tasks configured in the current job, although there are tasks defined for execution (invoke batch tasks) in job's configuration, provided from a different job.
2) Feature Request: It would be nice that the fields in the job's configuration section "Invoke batch tasks" could be automatically updated when entering a value (mimicking the behavior hudson has when creating a new Job by copying an existing job, when entering values in "copy from field"). Currently, one has to enter the job's name in the "Project field", save the job, and returning to configuration to be able to see all related tasks from the previously specified job.
Thanks!
Feb 17, 2010
ndierauf - says:
Any chance that the task name can be exposed as an environment variable? Thanks...Any chance that the task name can be exposed as an environment variable?
Thanks,
Nick.
May 12, 2010
Vivek R says:
Hi, I have some problems with batch tasks, its failing to excute the task Huds...Hi,
I have some problems with batch tasks, its failing to excute the task
Hudson ver. 1.354 Plugin: 1.13
Task: echo hello
Test-BuildConf $ cmd /c call C:\WINDOWS\TEMP\hudson25025.bat
The directory name is invalid
FATAL: command execution failed
[8mha:AAAAWB+LCAAAAAAAAABb85aBtbiIQSmjNKU4P08vOT+vOD8nVc8DzHWtSE4tKMnMz/PLL0ldFVf2c+b/lb5MDAwVRQxSaBqcITRIIQMEMIIUFgAAckCEiWAAAAA=[0mjava.io.IOException: Cannot run program "cmd" (in directory "d:\hudson\workspace\Test-BuildConf"): CreateProcess error=267, The directory name is invalid
at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
at hudson.Proc$LocalProc.<init>(Proc.java:149)
at hudson.Proc$LocalProc.<init>(Proc.java:121)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:633)
at hudson.Launcher$ProcStarter.start(Launcher.java:268)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:778)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:754)
at hudson.remoting.UserRequest.perform(UserRequest.java:114)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:270)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.IOException: CreateProcess error=267, The directory name is invalid
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
at java.lang.ProcessImpl.start(ProcessImpl.java:30)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
... 15 more
but it works fine on a different system with same version
Jun 17, 2010
tieTYT - says:
I think I have a related problem here. I named my project from "AppName" to "Ap...I think I have a related problem here. I named my project from "AppName" to "App Name" but the batch tasks are still trying to execute the script in the old path so it can't find the script.
Here's the exception:
workspace $ /bin/sh -xe /tmp/hudson3200245917642124053.sh
FATAL: command execution failed
[8mha:AAAAWB+LCAAAAAAAAABb85aBtbiIQSmjNKU4P08vOT+vOD8nVc8DzHWtSE4tKMnMz/PLL0ldFVf2c+b/lb5MDAwVRQxSaBqcITRIIQMEMIIUFgAAckCEiWAAAAA=[0mjava.io.IOException: Cannot run program "/bin/sh" (in directory "/opt/hudson/jobs/AppName/workspace"): java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
at hudson.Proc$LocalProc.<init>(Proc.java:149)
at hudson.Proc$LocalProc.<init>(Proc.java:121)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:638)
at hudson.Launcher$ProcStarter.start(Launcher.java:273)
at hudson.Launcher$ProcStarter.join(Launcher.java:280)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:83)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:58)
at hudson.plugins.batch_task.BatchRun.run(BatchRun.java:295)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:124)
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
at java.lang.ProcessImpl.start(ProcessImpl.java:65)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
... 10 more
Dec 02, 2010
robig - says:
Hi Is it possibe to do a Task before any other operation, also before the SCM p...Hi
Is it possibe to do a Task before any other operation, also before the SCM plugin?
We're using a svn mirror to checkout, but switching to main repo to do some commits. To use the advantage of updating the working copy, we have to switch back to the main repo. But in a batch task it will only switch on successful and unstable build.
thanks for your plugin, its very useful for release purposes.
robert
Dec 19, 2010
Indra Gunawan says:
I am trying to setup a job that will invoke batch task of another project in Pos...I am trying to setup a job that will invoke batch task of another project in Post-Build Action. How do I pass to batch task (Downstream Tasks) parameters?
Thank you,
-Indra
Add Comment