| Name | Pre/Post Build Command Plugin |
|---|---|
| Version | 2.1.0 |
| Product Versions | 2.x (1.2.4 also available) |
| Author(s) | Jonathan Doklovic [developer(at)sysbliss(dot)com] |
| Homepage | http://blog.sysbliss.com |
| Price | Free |
| License | BSD |
| JavaDocs | |
| IssueTracking | http://developer.atlassian.com/jira/browse/BPBC |
| Subversion URL | https://svn.atlassian.com/svn/public/contrib/bamboo/bamboo-prepostcommand-plugin or browse via fisheye |
| Download JAR | prepost-build-command-2.1.0.jar |
| Download Source | prepost-build-command-2.1.0-sources.jar |
Description/Features
This plugin can run an arbitrary command before a build runs or when a build passes or fails.
The pre command is specified on the Builder Configuration page.
The pass and fail commands are specified on the Post Actions configuration page.
Ability to specify if commands run in the bamboo build thread or in their own spawned thread
Sysout and Syserr from the command are logged to the bamboo.log file.
Sysout and Syserr also go to the build log in the web interface if a pre command runs in the bamboo thread.
note: since the commands are meant to run asynchronously, they are run on the bamboo server, not on agent machines.
Usage
- Download and install the plugin into your Bamboo WEB-INF/lib folder
- Select your build and edit the Builder Configuration under the Configuration tab.
- Enter the complete command line to run before the build in the Command field.
- Select your build and edit the Post Actions under the Configuration tab.
- Enter the complete command line(s) to run in the Success and Failed Command fields
- After each build, the system will run either the Success or Failed command as appropriate if it's filled in
Configuration Details
Each command field will expand ALL global and custom variables including:
| property | description |
|---|---|
| ${bamboo.buildKey} | the build key. (i.e. PRJ-PLAN) |
| ${bamboo.buildNumber} | the build number. (i.e. 14) |
| ${bamboo.fullBuildKey} | the full build key. (i.e. PRJ-PLAN-14) |
| ${bamboo.buildResultsUrl} | the build results url |
Screenshots
Open Issues
|
|
||||
|---|---|---|---|---|
| T | Key | Summary | Reporter | Status |
|
|
BPBC-13 | Add ability to skip running the command based on Null version from the JiraVersion plugin | jonathan doklovic |
|
|
|
BPBC-14 | Post Command Runner custom build complete action failed to run | Andy Martin |
|
Version History
2.1.0
|
|
|||
|---|---|---|---|
| Key | Summary | Pr | Status |
| BPBC-18 | Log information to the build log in the web interface |
|
|
| BPBC-17 | Ability to specify if commands should run in their own thread or not |
|
|
| BPBC-15 | Request ability to fail build if pre-command returns non-zero exit code |
|
|
2.0.3
|
|
|||
|---|---|---|---|
| Key | Summary | Pr | Status |
| BPBC-12 | Pre build plugin logs error if command field is blank |
|
|
2.0.2
|
|
|||
|---|---|---|---|
| Key | Summary | Pr | Status |
| BPBC-11 | Allow expansion of ALL custom build data in command lines |
|
|
2.0.1
|
|
|||
|---|---|---|---|
| Key | Summary | Pr | Status |
| BPBC-8 | Save "Post Actions" triggers NullPointerException |
|
|
2.0.0
|
|
|||
|---|---|---|---|
| Key | Summary | Pr | Status |
| BPBC-6 | Update plugin to be Bamboo 2.x compatible |
|
|
1.1.0
|
|
|||
|---|---|---|---|
| Key | Summary | Pr | Status |
| BPBC-7 | Add support to run PRE build commands |
|
|
1.0.0
|
|
|||
|---|---|---|---|
| Key | Summary | Pr | Status |
| BPBC-3 | Expand defined build properties used in command string |
|
|
| BPBC-2 | Ability to sepcify command to run after an errored build |
|
|
| BPBC-1 | Ability to sepcify command to run after a successful build |
|
|
| BPBC-5 | Syserr of command should be logged to bamboo.log |
|
|
| BPBC-4 | Sysout of command should be logged to bamboo.log |
|
|

Comments (6)
Apr 24
Eric Jain says:
Doesn't seem to be working with Bamboo 2.x?Doesn't seem to be working with Bamboo 2.x?
May 08
jonathan doklovic says:
The current version is only for 1.2.4. I will be adding 2.0 support either toda...The current version is only for 1.2.4.
I will be adding 2.0 support either today or tomorrow.
May 08
jonathan doklovic says:
2.0 compatible version now available version2.0 compatible version now available version
Aug 12
Ben Gamble says:
This is probably some simple user error, but I'm running plugin version 2.0.1 wi...This is probably some simple user error, but I'm running plugin version 2.0.1 with bamboo v2.0.4 and the post command simply doesn't run after a successful build. Log snippets:
simple 12-Aug-2008 15:01:04 Executing build PLAT-NIGHTLY-59
simple 12-Aug-2008 15:01:04 Running pre-build action: Build Number Stamper
simple 12-Aug-2008 15:01:04 Running pre-build action: VCS Version Collector
simple 12-Aug-2008 15:01:04 Running pre-build action: Pre Command Runner
simple 12-Aug-2008 15:01:04 Building started with ScriptBuilder
command 12-Aug-2008 15:01:04 Starting to build 'Platform - Nightly'<br /> ... running command line: /bin/sh build-script all<br /> ... in : /a/Bamboo/xml-data/build-dir/PLAT-NIGHTLY<br /> ... using java: null<br /> ... using environment variables:
build 12-Aug-2008 15:01:04 /a/Bamboo/xml-data/build-dir/PLAT-NIGHTLY
[...]
build 12-Aug-2008 15:01:19 ...found 484 target(s)...
simple 12-Aug-2008 15:01:19 Build process for 'Platform - Nightly' returned with return code = 0
simple 12-Aug-2008 15:01:19 Running post build plugin 'Artifact Copier'
simple 12-Aug-2008 15:01:19 Running post build plugin 'Clover Results Collector'
simple 12-Aug-2008 15:01:19 Finalising the build...
simple 12-Aug-2008 15:01:19 Stopping timer.
simple 12-Aug-2008 15:01:19 Build PLAT-NIGHTLY-59 completed.
simple 12-Aug-2008 15:01:19 Running post build plugin on server 'Clover Delta Calculator'
I see a "Pre Command Runner" but no hint of any post commands despite the build being successful. Atlassian support made some vague noises about "running my build on an agent" (the agent is local) but had no clue whether that would cause the plugin to run locally or ignore the configured commands or what.
Aug 13
Ben Gamble says:
nm, found all my commands, conveniently located in a server-level log file total...nm, found all my commands, conveniently located in a server-level log file totally inaccessible from the web interface.
Aug 15
jonathan doklovic says:
This is due to the fact that the post command runner plugin is a BuildCompleteAc...This is due to the fact that the post command runner plugin is a BuildCompleteAction.
BuildCompleteActions do not log anything to the web interface's build log since they run after the build is finished.
I plan to convert the post command plugin to a BuildProcessor instead of a BuildComplete Action which will allow you to see the output in the web interface, but only if it is running in the Bamboo build thread. In v 2.1 of the plugin, you have the ability to run the command in a separate thread, and in that case, it will not log to the bamboo build log since it's in a separate thread.
Hope that makes sense.
- Jonathan