Versions Compared

Key

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

...

Expand
titleSee generated CLI source


Code Block
languagebash
linenumberstrue
# Exported from https://examplegear.com running Bamboo 6.0.0 on 2017-05-02 by automation using the Bamboo CLI 6.4.0-SNAPSHOT

-a createOrUpdatePlan    --plan ZEXPORT-BASE  --name "Base"  --description "" 

-a removeRepository      --plan @plan@  --repository @all 
-a addRepository         --plan @plan@  --repository "cli" 

-a removeBranch          --plan @plan@  --branch @all 
-a addBranch             --plan @plan@  --branch 2.5.0 \
                                                --name "ZEXPORT - Base - 2.5.0" 

-a removeVariables       --plan @plan@  --field1 @all 
-a addVariables          --plan @plan@  --field1 "v1"  --value1 "xxx" 

-a removeStage           --plan @plan@  --stage @all 
-a addStage              --plan @plan@  --stage "FIRST" 

-a addJob                --plan @plan@  --stage @stage@  --job JOB1 \
                                                --name "JOB1" 
-a addArtifact           --plan @plan@  --job @job@ \
                                                --artifact "out.txt" \
                                                --copyPattern "out.txt" 
-a addTask               --plan @plan@  --job @job@ \
                                                --taskKey com.atlassian.bamboo.plugins.vcs:task.vcs.checkoutCHECKOUT \
                                                --name "Source Code Checkout" \
                                                --description "Checkout Default Repository" 
-a addTask               --plan @plan@  --job @job@ \
                                                --taskKey com.atlassian.bamboo.plugins.scripttask:task.builder.scriptSCRIPT \
                                                --name "Script" \
                                                --field1 "scriptLocation" \
                                                --value1 "INLINE" \
                                                --field2 "scriptBody" \
                                                --value2 "echo xxx > out.txt" \
                                                --field3 "interpreter" \
                                                --value3 "RUN_AS_EXECUTABLE" 
-a addTask               --plan @plan@  --job @job@ \
                                                --taskKey org.swift.bamboo.acli:bambooCLI_BAMBOO \
                                                --name "Bamboo CLI" \
                                                --field1 "scriptLocation" \
                                                --value1 "INLINE" \
                                                --field2 "scriptBody" \
                                                --value2 "--help"


...

For CLI, use one of the following approaches depending on your situation. We use the --continue option to keep going even if something fails along the way. The export was constructed to support updating an existing plan without deleting it first. This is important to maintain references from other plans. Also, some history is retained, but due to a Bamboo limitation, previous logs are lost. Use movePlan to another location (project or key change) in order to save all logs.

Code Block
languagebash
titleCreate same plan key as export
--action run --file example.txt --continue

...