Custom command executable

This page describes how to configure a Bamboo task that uses a command (e.g. Bash) executable.

See  Configuring a builder task for an overview of Bamboo builder tasks.

Related pages:

To configure a command task:

  1. Navigate to the Tasks configuration tab for the job (this will be the default job if creating a new plan).
  2. Click the name of an existing Command task, or click Add Task and then Command to create a new task.
  3. Complete the following settings:

    Task Description A description of the task, which is displayed in Bamboo.
    DIsable this task Check, or clear, to selectively run this task.

    The command executable that is available to perform the task (e.g. Bash). The executable that you select will become one of the task's (and so, the job's) requirements.

    You can add other executables, if required.

    (Optional) The relevant argument to pass to the command. Note that arguments which contain spaces must be quoted. You can include variables (see Bamboo variables).
    Environment Variables (Optional)  Additional system environment variables that you want to pass to your build. Note that existing environment variables are automatically available to the executable. You can also include Bamboo global or build-specific variables (see Using global, plan or build-specific variables).
    Multiple variables should be separated with spaces. Parameters with spaces must be quoted (e.g ANT_OPTS="-Xms200m -Xmx700m").
    Working Sub Directory (Optional)  An alternative subdirectory, relative to the job's root directory, where Bamboo will run the executable. The root directory contains everything checked out from the job's configured source repository. If you leave this field blank, Bamboo will look for build files in the root directory. This option is useful if your task has a build script in a subdirectory and the executable needs to be run from within that subdirectory.
  4. Click Save.

Was this helpful?

Thanks for your feedback!

16 Archived comments

  1. User avatar


    Is there any way of passing commands with quotes, without Bamboo sticking newlines in there?  e.g. I want to run "cmake -G "Unix Makefiles" ../folder" (note that the quotes around "Unix Makefiles" need to stay there)

    11 Oct 2012
  2. User avatar


    I have the same problem.  It causes my task to fail because the command I am trying to execute requires the arguments, but they are on another line.  It somehow interpolates from the custom Executable and Argument fields into this

     \n/usr/local/bin/build_perl_for_bamboo\n -b 8\n

    Full log line entry:

    22-Jan-2013 11:26:24	Beginning to execute external process for build 'My Proj - subproj - subsub - main - Default Job'\n ... running command line: \n/usr/local/bin/build_perl_for_bamboo\n -b 8\n ... in: /opt/atlassian-bamboo-agent/xml-data/build-dir/MYPROJ-MAIN-JOB1\n
    22 Jan 2013
  3. User avatar


    Can a custom command executable produce test results?  It seems like this capability was available in past releases (Custom Command Executable), but I've been unable to figure out where to specify this.

    I am trying to use the Gradle wrapper to build and test our project.  My plan configuration consists of a single stage, with a default job.  The tasks of the job are "source code checkout" and "command", where the command is "./gradlew check".  If tests fail, the build fails but test results are not reported.  There's no place that I can find to specify that "this build produces test results."


    12 Feb 2013
    1. User avatar

      James Dumay [Atlassian]

      Would using a JUnit Parser task to the Job after your command executable task not work for you?

      17 Feb 2013
      1. User avatar


        I had originally tried to do this but was confused with the quarantine / unleash process.  I would quarantine a failing test, run the custom executable, the test would fail, and then the JUnit Parser task would run.  The output from the parser task indicated first that it failed, then that it was changing its failure status to success since all failing tests were quarantined.  But the overall build would still fail.

        It took me a while to figure out, but the custom command was exiting with a non-zero status, then the parser task was running and exiting successfully.  I had to set the gradle test task to "not break the build" when the verifications failed.  (

        17 Feb 2013
  4. User avatar

    Chris Marshall

    I need to write a very simple command: /usr/bin/unzip

    Some of the files in my repository are checked in as zipped (several reasons nonnegotiable -they must remain zipped).

    I need to unzip them, but the command tells me that it can't find the files.

    Obviously, I am relating from the wrong working directory.

    It was my assumption (ASS out of U and ME) that the working directory was the job root directory, which I thought was one level down from the root directory specified on the (remote) agent's config.

    That one down would be the job dir.

    So, if the root was set to /autobuild , and the job dir was /autobuild/JOB-Daily-1 , I would assume the latter (/autobuild/JOB-Daily-1) would be the base for a relative path for the working directory and input for the executable.

    Can someone clue me in on my mistake?


    22 May 2013
  5. User avatar


    Trying to execute command

    /bin/bash etc/

    but it failes, no explanation. From command line where the project is checked out it works perfectly!

    20 Jul 2013
    1. User avatar

      Alex Soto

      I'd guess if it works when logged in, then you need to run in a login shell


      /bin/bash --login etc/

      07 Jun 2014
  6. User avatar


    I have the following issue:

    I need to run a command that launches an external application. But I need the build to keep going instead of waiting for the application to "finish". Is this possible? I've tried with Script and Executable and both wait for the external app to close. I even tried placing the command inside a bat file and calling this bat from Script but still it waits on the launched app to finish.


    Is there any way to accomplish what I described above?


    05 Nov 2013
  7. User avatar

    Nathan Pye [Atlassian]

    Have you tried to adapt your script so that it starts the external application as a background task?

    05 Nov 2013
  8. User avatar


    Hi Nathan,


    Thank you for your reply. Yes I've started the app using start "" /B <exe> <args>.

    Also tried without the /B, tried inline script, file script (from bat), even tried adding the Executable as a capability.

    But the result is always the same, the build stops at the step where it opens the application and doesn't continue until I go to the agent and close the application (which I can't do since I need it running during the build).


    Any ideas?


    06 Nov 2013
    1. User avatar

      Armen Khachatryan [Atlassian]

      Which version of Bamboo are you using? In the latest Bamboo versions there is a checkbox in the Advanced Options section of Script task configuration page (for PowerShell scripts); try to check that and see if that helps.

      Also, I found these issues - BAM-11488 - Starting a command in the background Open , BAM-11887 - Launching Tasks in the Background from Bamboo fails Open . If you are still facing problems, please create a support ticket on


      06 Nov 2013
  9. User avatar

    Marc Eiler

    How do you edit or delete a command line task from the dropdown list of command executions? When I create one there doesn't appear to be an option to edit or even view what it is. I have some trial ones that are cluttering up my list of pre-defined execution commands. Thanks.

    30 Apr 2014
    1. User avatar

      James Dumay [Atlassian]

      Command executables are provided by capabilities defined on your agents. You will need to remove the command capabilities from a agents to get rid of them.

      30 Apr 2014
  10. User avatar

    Gian Luca Decurtins

    Hi all

    How can I pass a stdin value to the executable?

    I do have got Google's App Engine Python SDK defined as Executable ( In order to deploy to Google App Engine requires the email as argument and a password to be provided via stdin.

    I tried the following Argument without success: --passin update . <<< """PASSWORD"""

    When I execute the whole command through the console it does work:

    /opt/google_appengine-1.9/ --passin update . <<< """PASSWORD"""



    10 Apr 2015
  11. User avatar

    Alex Soto

    You probably need to run in a shell.  Something like


    /bin/bash -c 'YOUR COMMAND'
    10 Apr 2015
Powered by Confluence and Scroll Viewport