Versions Compared

Key

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

...

Internally, we have the same problem and the fix was to get plan creation scripts under source control where changes could be controlled and similar plans created from the same source. We maintain multiple Bamboo sites including multiple production build instances (restricted instances for releasing products) and developer build instances. Prior to this ability, the plans diverge. Release 4.3 contains the basics for creating build plans using the most common elements. Now we have hundreds of plans created this way! More capabilities will be added based on feedback, please open an issue with your specific requirements.

There are a number of Bamboo limitations that have been worked around as best as possible. It is hoped these can be improved with future Bamboo support. For instance, plan or job deletes take place in the background and replacement plans or jobs cannot be created until they are fully deleted. Scripting will wait for this to occur, but it can take a minute or so. This means recreate scenarios take longer than one would expect. Adding tasks can be difficult to get working. We have some examples (Examples for AddTask Action), but, some careful work is required to get new ones working correctly :(. The best approach is to use exportPlan of an existing plan that represents the main elements of the kind of plan you want to create. The export provides insight and a starting point for your new plan source. Start simple and gradually add improvements and simplifications to reduce redundancy. Using bamboo variables is strongly recommended to simplify plans, making maintenance easier, and essentially parameterizing your plan.

Note that on re-create of a plan, Bamboo will no longer discard previous build logs - see and vote for on Bamboo 6.9 or higher (see BAM-15957).

See the movePlans tip below - this is the most effective way of avoiding both of these limitations! Moving plans preserves the logs and makes the recreate of the plans very fast. With an archiving process and convention defined using movePlans, you can now safely make sure all your plans are updated from the latest source quickly while preserving history.

...

Section


Column

Features

  1. Support for standard build plan creation, replace, or update scenarios
    • createPlan
    • createPlan --replace - recommended approach that for an existing plan, under the covers, does a move, delete, and create scenario to create the plan in minimum time
    • createPlan --replace --options clear - (since CLI 8.2) modifies plan replacement by, under the covers, removing most plan constructs to enable subsequent scripting to create again from scratch useful when plan is referenced in other plans and as a way to preserve the log history.
    • createOrUpdatePlan - only creates a plan if it does not already exist and only modifies plan name and description - removed in CLI 9.0 as the other options now cover use cases better.
  2. Support for deployment projects and environments
  3. Same plan script can be used for update or create 
    • Enablers to ignore "already exists" errors for add constructs and "not found" errors for remove constructs
    • Enablers to easily remove previous constructs so they can be recreated if needed
    • Makes initial creation and debugging easier
  4. Variable replacements so scripts can be easily duplicated and re-used while minimizing text changes
  5. Scripts can be parameterized using find and replace logic
  6. exportPlan and exportDeploymentProject action can be used to create a CLI script - starting point for creating new plans
  7. Support for
    • Plans - including plan level:
      • Artifacts
      • Repositories
      • Triggers
      • Branches
      • Dependencies
      • Notifications
      • Variables
    • Stages
    • Jobs
    • Tasks - including final tasks
    • Deployment projects
    • Environments
  8. Non-plan actions can also be included in your plan creation script
    • addAgentAssignment or similar

  9. Condition portions of the plan depending on creation script parameters


Column


Image from Bamboo Configuring Plans



...

Tip
titleArchiving projects and plans

New for CLI 6.6 is the movePlans action. Easily archive projects or plans before replacing them with the latest plan definitions. The big advantage with this is saving all the plan logs for reference at least for a period of time. Later you can delete them all together with the deleteProject action.

Code Block
titleExample we use for the CLI
--action movePlans --project CLI --toProject XX66CLI


How To's

Other Related Information

...