Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table plus
DescriptionDetails

Common

Some common fields are handled with specific CLI parameters

CLI FieldPOST FieldDiscussion
planplanKeyThe POST field value is a 3 part name including job. CLI uses 2 separate fields for this.
job 3rd part of planKey POST field
taskKeycreateTaskKeyRequired for add. We have defined some common aliases (case insensitive):
  • ANT
  • CHECKOUT
  • CLI_BAMBOO
  • CLI_CONFLUENCE
  • CLI_CRUCIBLE
  • CLI_FISHEYE
  • CLI_HIPCHAT
  • CLI_JIRA
  • CLI_STASH
  • COMMAND
  • GANT
  • GINT
  • GRADLE
  • GRADLEW
  • GROOVY
  • MAVEN2
  • MAVEN3
  • SCP
  • SCRIPT
  • SSH
descriptionuserDescription 
disabletaskDisabled=true 

Source checkout

POST FieldExample POST ValueDiscussion
createTaskKey

com.atlassian.bamboo.plugins.vcs%3Atask.vcs.checkout

  • Task keys are in the form xxx:yyy. Use : in place of %3A.
  • taskKey: com.atlassian.bamboo.plugins.vcs:task.vcs.checkout
  • alias: CHECKOUT
selectedRepository_0

defaultRepository

Says to use the default repository for the plan. Default (not specifying the parameters) should just use the default as well.

For other repositories, you will need the repository id either explicitly or from Variable replacement using @repositoryId@.

  • The variable in a script after an addRepository or getRepository action
cleanCheckouttrueDefaults to false.
checkoutDir_0 You must set it to blank or a specific value (otherwise you will get an NullPointerException).

Using the default repository

Code Block
-a addTask --plan XX-XX --job JOB1 --taskKey CHECKOUT --description "get source" --disable --field1 selectedRepository_0 --value1 defaultRepository --field2 cleanCheckout --value2 true --field3 checkoutDir_0 --value3 ""

Using another respository in a script

Code Block
-a addRepository         --plan @plan@ --repository my-repository
-a addTask               --plan @plan@ --job @job@ --taskKey CHECKOUT --fields selectedRepository_0:@repositoryId@,checkoutDir_0:,cleanCheckout:true

Script

POST FieldExample POST ValueDiscussion
createTaskKey

com.atlassian.bamboo.plugins.scripttask%3Atask.builder.script

  • Task keys are in the form xxx:yyy. Use : in place of %3A.
  • taskKey: com.atlassian.bamboo.plugins.scripttask:task.builder.script
  • alias: SCRIPT
scriptLocation

INLINE

INLINE or FILE.
scriptBodyexit -1Body for INLINE scripts. Use " \n " for new lines (leading and trailing blanks are significant.
scriptmyscript.sh File for FILE scripts.
argument Command line arguments. Defaults to blank.
environmentVariables Environment variables. Defaults to blank.
workingSubDirectory Working subdirectory. Defaults to blank.
runWithPowershelltrueDefaults to false.
Code Block
-a addTask --plan XX-XX --job JOB1 --taskKey SCRIPT --field1 scriptLocation --value1 INLINE --field2 scriptBody --value2 "exit -1"

Maven

POST FieldExample POST ValueDiscussion
createTaskKey

com.atlassian.bamboo.plugins.maven%3Atask.builder.mvn2

  • Task keys are in the form xxx:yyy. Use : in place of %3A. 
  • taskKeys: 
    • com.atlassian.bamboo.plugins.maven:task.builder.mvn2
    • com.atlassian.bamboo.plugins.maven:task.builder.mvn3
  • aliases: MAVEN2, MAVEN3
label

Maven 2

Executable label of type Maven 2.
buildJdkJDKBuild JDK.
environmentVariables Environment variables. Defaults to blank.
workingSubDirectory Working subdirectory. Defaults to blank.
testCheckedtrueDefaults to false.
testDirectoryOptionstandardTestDirectoryDefaults to standardTestDirectory. Alternate is customTestDirectory.
testResultsDirectory Defaults to **/target/surefire-reports/*.xml.
projectFile Defaults to blank.
Code Block
-a addTask --plan XX-XX --job JOB1 --description "Simple" --taskKey MAVEN2 --field1 label --value1 "Maven 2" --field2 goal --value2 "compile" --field3 buildJdk --value3 JDK

Groovy

Gradle

Gradle Wrapper

Gant

POST FieldExample POST ValueDiscussion
createTaskKey

org.swift.bamboo.groovy%3Agroovy

  • Task keys are in the form xxx:yyy. Use : in place of %3A. 
  • taskKeys:
    • org.swift.bamboo.groovy:groovy
    • org.swift.bamboo.groovy:gradle
    • org.swift.bamboo.groovy:gradlew
    • org.swift.bamboo.groovy:gant
  • aliases: GROOVY, GRADLE, GRADLEW, GANT
label

Groovy

Executable label like Groovy, Gradle, Gradle Wrapper, or Gant.
scriptLocation

FILE

INLINE or FILE.
script
my-script.groovy
Script location for FILE.
scriptBody INLINE script. Use " \n " for new lines (leading and trailing blanks are significant.
buildJdkJDKBuild JDK.
environmentVariables Environment variables. Defaults to blank
workingSubDirectory Working subdirectory. Defaults to blank.
testCheckedtrueDefaults to false.
testDirectoryOptionstandardTestDirectoryDefaults to standardTestDirectory. Alternate is customTestDirectory.
testResultsDirectory Defaults to **/target/surefire-reports/*.xml.
Code Block
-a addTask --plan XX-XX --job JOB1 --description "Simple" --taskKey GROOVY --field1 label --value1 "Groovy" --field2 scriptLocation --value2 FILE --field3 script --value3 my-script.groovy --field4 buildJdk --value4 JDK

GINT

POST FieldExample POST ValueDiscussion
createTaskKey

org.swift.bamboo.groovy%3Agint

  • Task keys are in the form xxx:yyy. Use : in place of %3A.
  • taskKey: org.swift.bamboo.groovy:gint
  • alias: GINT
label

Gant

Executable label referencing a Gant executable.
scriptLocation

FILE

INLINE or FILE.
script
integration-test.gant
Script location for FILE.
scriptBody INLINE script. Use " \n " for new lines (leading and trailing blanks are significant.
targets Specific testcases (targets) to run. Defaults to blank.
levelAlltrueInclude all integer levels. Equivalent to command line -Dlevel=all. Defaults to false.
includeLevelsAlltrueInclude all named levels. Equivalent to command line -DincludeLevels=all. Defaults to false.
cleantrueIgnore previous run state, run tearDown and setUp. Equivalent to command line -Dclean. Defaults to false.
verbosetrueLog additional information. Equivalent to command line -Dverbose. Defaults to false.
stopOnFail Stop running more testcases once a testcase fails. Equivalent to command line -DstopOnFail. Defaults to false.
propertyLocation

FILE

INLINE or FILE.
propertyFile
 
Property location for FILE.
propertyBody INLINE script.
buildJdkJDKBuild JDK.
environmentVariables Environment variables. Defaults to blank.
workingSubDirectory Working subdirectory. Defaults to blank.
testCheckedtrueDefaults to false.
testDirectoryOptionstandardTestDirectoryDefaults to standardTestDirectory. Alternate is customTestDirectory.
testResultsDirectory Defaults to **/*reports/*.xml.
Code Block
-a addTask --plan XX-XX --job JOB1 --description "Integration test" --taskKey GINT --field1 label --value1 "Gant" --field2 scriptLocation --value2 FILE --field3 script --value3 integration-test.gant --field4 buildJdk --value4 JDK --fields levelAll:true,includeLevelsAll:true,clean:true,verbose:true,stopOnFail:false,testChecked:true

CLI

POST FieldExample POST ValueDiscussion
createTaskKey

org.swift.bamboo.acli%3Ajira

  • Task keys are in the form xxx:yyy. Use : in place of %3A. 
  • taskKeys: 
    • org.swift.bamboo.acli:jira
    • org.swift.bamboo.acli:confluence
    • org.swift.bamboo.acli:bamboo
    • org.swift.bamboo.acli:stash
    • org.swift.bamboo.acli:hipchat
    • org.swift.bamboo.acli:crucible
    • org.swift.bamboo.acli:fisheye
  • alias: CLI_JIRA, CLI_CONFLUENCE, CLI_BAMBOO, CLI_STASH, CLI_HIPCHAT, CLI_CRUCIBLE, CLI_FISHEYE
scriptLocation

FILE

INLINE or FILE.
script
create-jira-issue.txt
Script location for FILE.
scriptBody--action ...INLINE script. Use " \n " for new lines (leading and trailing blanks are significant.
Code Block
-a addTask --plan @plan@ --job @job@ --description "Create JIRA issue" --taskKey org.swift.bamboo.acli:jira --field1 scriptLocation --value1 FILE --field2 script --value2 "create-jira-issue.txt"

Docker run

Div
POST FieldExample POST ValueDiscussion
createTaskKeycom.atlassian.bamboo.plugins.bamboo-docker-plugin:task.docker.cli  
commandOptionrun 
imageregistry.address:port/namespace/repository:tag 
dockerfileOptioninline 
Code Block
-a addTask --plan @plan@ --job @job@ --description "Run a container" --taskKey com.atlassian.bamboo.plugins.bamboo-docker-plugin:task.docker.cli --field1 commandOption --value1 run --field2 image --value2 registry.address:port/namespace/repository:tag --field3 dockerfileOption --value3 inline

Docker build

Div
POST FieldExample POST ValueDiscussion
createTaskKeycom.atlassian.bamboo.plugins.bamboo-docker-plugin:task.docker.cli  
commandOptionbuild 
repositoryregistry.address:port/namespace/repository:tag 
dockerfileOptionexisting 
Code Block
-a addTask --plan @plan@ --job @job@ --description "Build Docker image" --taskKey com.atlassian.bamboo.plugins.bamboo-docker-plugin:task.docker.cli --field1 commandOption --value1 build --field2 repository --value2 registry.address:port/namespace/repository:tag --field3 dockerfileOption --value3 existing

Docker push

Div
POST FieldExample POST ValueDiscussion
createTaskKeycom.atlassian.bamboo.plugins.bamboo-docker-plugin:task.docker.cli  
commandOptionpush 
repositoryOptioncustom 
dockerfileOptioninline 
pushRepository

registry.address:port/namespace/repository:tag

 
Code Block
-a addTask --plan @plan@ --job @job@ --description "Push image" --taskKey com.atlassian.bamboo.plugins.bamboo-docker-plugin:task.docker.cli --field1 commandOption --value1 push --field2 dockerfileOption --value2 inline --field3 registryOption --value3 custom --field4 pushRepository --value4 registry.address:port/namespace/repository:tag

Artifact download

Div
POST FieldExample POST ValueDiscussion
createTaskKey

com.atlassian.bamboo.plugins.bamboo-artifact-downloader-plugin:artifactdownloadertask

  • Alias since 5.2: ARTIFACT_DOWNLOAD
 
sourcePlanKeyX 
artifactId_0-1

First artifact id, use -1 to download all shared artifacts.

 Must be the numeric id (sad) .

localPath_0 First directory path relative to the working directory. Blank is valid. 
artifactId_112345Second artifact id.
localPath_1targetSecond directory path.
etc...  
Code Block
-a addTask --plan @plan@ --job @job@ --description "Get artifacts" --taskKey ARTIFACT_DOWNLOAD --field1 sourcePlanKey --value1 XXX-PLAN1  --field2 artifact_0 --value2 -1 --field3 localPath_0 --value ""
NPM
Div
POST FieldExample POST ValueDiscussion
createTaskKey

com.atlassian.bamboo.plugins.bamboo-nodejs-plugin:task.builder.npm

 
runtimeNode.js 
commandinstall

 

Code Block
-a addTask --plan @plan@ --job @job@ --description "NPM install" --taskKey com.atlassian.bamboo.plugins.bamboo-nodejs-plugin:task.builder.npm --field1 runtime --value1 Node.js  --field2 command --value2 install
SQL
Div
POST FieldExample POST ValueDiscussion
createTaskKey

com.appfire.bamboo.sql:sql

Required for add. Alias: SQL (since 5.5)
scriptLocation

FILE

INLINE or FILE.
script
update-tracking-database.sql
Script location for FILE.
scriptBody INLINE script.
dbProfiledbUrl = jdbc:postgresql://examplegear.com:5432/test dbUser = automation | dbPassword = automationRequired.
outputFormatRAW_WITH_LINE_BREAKS

Optional. Defaults to RAW_WITH_LINE_BREAKS. Values: RAW, RAW_WITH_LINE_BREAKS, WIKI, HTML

outputFile Optional. Path to file for result output

 

 

Code Block
-a addTask --plan @plan@ --job @job@ --description "Database update" --taskKey com.appfire.bamboo.sql:sql --field1 script --value1 update-tracking-database.sql --field2 dbProfile --value2 "dbUrl = jdbc:postgresql://examplegear.com:5432/test dbUser = automation | dbPassword = automation"

...