Bamboo Concepts: Difference between revisions
(20 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=Internal= | =Internal= | ||
* [[Bamboo#Subjects|Bamboo]] | |||
* [[Continuous_Integration#Tools|Continuous Integration]] | |||
=Overview= | |||
=Project= | =Project= | ||
Line 12: | Line 14: | ||
{{Internal|Bamboo Operations#Plan_Operations|Plan Operations}} | {{Internal|Bamboo Operations#Plan_Operations|Plan Operations}} | ||
=Build= | |||
==Build Isolation== | |||
Builds are normally run in the agent's native operating system ("Agent environment" choice). The build could be run in an isolated and controlled environment with Docker ("Docker container" option). The build isolation can be changed after a plan is defined with Plan -> Actions: Configure Plan -> Select Job -> "Docker" tab. | |||
=Stage= | =Stage= | ||
Line 56: | Line 64: | ||
Clover XML Location: target/site/clover/clover.xml | Clover XML Location: target/site/clover/clover.xml | ||
=Executable= | =Executable= | ||
Line 90: | Line 92: | ||
==Build-specific Variables== | ==Build-specific Variables== | ||
==Deployment | |||
====buildNumber==== | |||
${bamboo.buildNumber} | |||
Example: 689 | |||
====Plan Repository Branch==== | |||
${bamboo.planRepository.branch} | |||
====buildResultKey==== | |||
Example: TST-TS-689 | |||
====planKey==== | |||
Example: TST-TS | |||
====planName==== | |||
Example: "" | |||
====shortPlanKey==== | |||
Example: TS | |||
====shortPlanName==== | |||
Example: Service | |||
====Deployment Environment Release Name==== | |||
[[#Release_Name|${bamboo.deploy.release}]] | |||
====Other==== | |||
${bamboo.repository.git.branch} | |||
${bamboo.repository.revision.number} | |||
==System Variables== | ==System Variables== | ||
==<span id='Global_Variable'></span>Global Variables== | ==<span id='Global_Variable'></span>Global Variables== | ||
Line 117: | Line 157: | ||
Values for task-specific environment variables can be defined [[Bamboo Operations#Task_Environment_Variable_Support|when the task is created]]. The variable defined in the plan is injected without any name modifications (unlike [[#Global_Variable|global variables]]) in the environment of the task's executable. | Values for task-specific environment variables can be defined [[Bamboo Operations#Task_Environment_Variable_Support|when the task is created]]. The variable defined in the plan is injected without any name modifications (unlike [[#Global_Variable|global variables]]) in the environment of the task's executable. | ||
==Deployment Variables== | |||
See below: {{Internal|#Deployment_Variable|Deployment Variable}} | |||
=<span id='Deployment'></span>Deployments= | =<span id='Deployment'></span>Deployments= | ||
Line 126: | Line 170: | ||
A deployment project defines the [[#Build_Plan|build plan]] that produces the [[#Artifact|artifacts]] to be deployed, typically releases that have been built and tested and the [[#Deployment_Environment|environments]] the artifacts should be deployed into. | A deployment project defines the [[#Build_Plan|build plan]] that produces the [[#Artifact|artifacts]] to be deployed, typically releases that have been built and tested and the [[#Deployment_Environment|environments]] the artifacts should be deployed into. | ||
:[[Image:Deployment_Project.png]] | |||
==Deployment Environment== | ==Deployment Environment== | ||
Line 133: | Line 177: | ||
An environment can only host a single active [[#Release|release]] at any one time. | An environment can only host a single active [[#Release|release]] at any one time. | ||
===Deployment Environment Workflow=== | |||
{{External|[https://confluence.atlassian.com/bamboo0606/using-bamboo/deployment-projects/deployment-projects-workflow Deployment Environment Workflow]}} | |||
===Deployment Task=== | |||
Typical tasks are "Clean working directory" task and the deployment Script. | |||
===Deployment Trigger=== | |||
===Deployment Permissions=== | |||
===Deployment Agent=== | |||
===Deployment Notification=== | |||
===Deployment Variable=== | |||
==<span id='Deployment_Release'></span>Release== | ==<span id='Deployment_Release'></span>Release== | ||
Line 142: | Line 204: | ||
Release notes can be generated from a release's metadata. | Release notes can be generated from a release's metadata. | ||
Bamboo gives a unique release name to the software being deployed. | ===Release Name=== | ||
{{External|[https://confluence.atlassian.com/bamboo0606/using-bamboo/deployment-projects/creating-and-configuring-a-deployment-project/naming-versions-for-deployment-releases Release Names]}} | |||
Bamboo gives a unique release name to the software being deployed: | |||
${bamboo.deploy.release} | |||
Example: | |||
develop-699 | |||
==Deployment Operations== | |||
{{Internal|Bamboo_Operations#Deployment_Operations|Deployment Operations}} |
Latest revision as of 22:34, 2 January 2022
Internal
Overview
Project
Projects allow you to easily group and identify plans which are logically related to each other.
Build Plan
A build plan. It defines everything Bamboo needs to know to about the build process. Each plan has a Default job when it is created. More advanced configuration options, including those for plugins, and the ability to add more jobs will be available after creating this plan. A plan belongs to a project.
Build
Build Isolation
Builds are normally run in the agent's native operating system ("Agent environment" choice). The build could be run in an isolated and controlled environment with Docker ("Docker container" option). The build isolation can be changed after a plan is defined with Plan -> Actions: Configure Plan -> Select Job -> "Docker" tab.
Stage
Each stage within a plan represents a step within your build process. A stage may contain one or more jobs which Bamboo can execute in parallel.
Job
Each plan has a default job when it is created. A job has multiple tasks. More than one job can be added to a plan.
Default Job
Task
A task is an operation that is run on a Bamboo working directory using an executable, such as a script, shell command, ant task or Maven goal.
This is how you create a typical task for the Default job:
Artifact
Artifacts are the result of build plans: the continuous integration process is triggered by a developer committing code; the continuous integration servers takes over, it compiles the code, runs tests and then assembles the code into binaries. These assembled binaries are known as "artifacts". Artifacts can be further "continuously deployed" as part of deployment releases.
Create artifact:
Name: Clover Report (System) Location: target/site/clover Copy pattern: **/*.* Not shared, not required.
Create artifact:
Name: libs Location: build/libs Copy pattern: **/*.jar Shared, required.
Miscellaneous
Use Clover to collect Code Coverage for this build.
Clover is already integrated into this build and a clover.xml file will be produced.
Clover XML Location: target/site/clover/clover.xml
Executable
Repository
One or more repositories can be added to a plan. The repositories will then be available to every job in the plan. The first repository in the list is the plan’s default repository. The repositories to which a trigger applies can be selected in respective trigger's configuration.
Repository Types
Git
In general, use Git repositories, which allow SSH authentication.
GitHub
GitHub won't allow SSH authentication.
Variables
Situate this: Setting and Environment Variable on a Task.
Build-specific Variables
buildNumber
${bamboo.buildNumber}
Example: 689
Plan Repository Branch
${bamboo.planRepository.branch}
buildResultKey
Example: TST-TS-689
planKey
Example: TST-TS
planName
Example: ""
shortPlanKey
Example: TS
shortPlanName
Example: Service
Deployment Environment Release Name
${bamboo.deploy.release}
Other
${bamboo.repository.git.branch} ${bamboo.repository.revision.number}
System Variables
Global Variables
Global variables are defined across the entire Bamboo instance, and have the same static value for every plan that is built by Bamboo. They can be accessed using ${bamboo.globalvarname}.
For task configuration fields, use the syntax ${bamboo.myvariablename}. Bamboo also supports nested variables. For instance, if you set variableName = world, and variable.value = Hello ${bamboo.variableName}, Bamboo will resolve it as Hello world.
For inline scripts, a variable that has been defined as MY_VARIABLE_NAME is exposed as a shell environment variable that can be accessed using the syntax $bamboo_MY_VARIABLE_NAME (Linux/Mac OS X) or %BAMBOO_MY_VARIABLE_NAME% (Windows).
This is how to define a global variable:
Plan Variables
A plan variable is defined for one specific plan, and has the same value every time that plan is built. To define a variable across all plans rather than a single plan, define a global variable.
A plan variable has precedence over a global variable with the same name.
This is how to define a plan variable:
Task Environment Variables
Values for task-specific environment variables can be defined when the task is created. The variable defined in the plan is injected without any name modifications (unlike global variables) in the environment of the task's executable.
Deployment Variables
See below:
Deployments
Deployment Project
A deployment project defines the build plan that produces the artifacts to be deployed, typically releases that have been built and tested and the environments the artifacts should be deployed into.
Deployment Environment
A deployment environment represents the servers or groups of servers where the artifacts are deployed to, and the deployment tasks. Environments have permissions that allow fine grained control of who can deploy, edit or view an environment and record the full history of releases deployed to it.
An environment can only host a single active release at any one time.
Deployment Environment Workflow
Deployment Task
Typical tasks are "Clean working directory" task and the deployment Script.
Deployment Trigger
Deployment Permissions
Deployment Agent
Deployment Notification
Deployment Variable
Release
A release (deployment release) is a snapshot of any number of artifacts that will de used in the deployment process, and its associated metadata such as commits, JIRA issues, code changes and the builds that were used to test it. As a release contains the information of the difference between itself and the release beforehand, it exposes changes between releases or between the software deployed on two different environments. Releases also track what environments they have been deployed to.
A release is created from the result of a single build.
Release notes can be generated from a release's metadata.
Release Name
Bamboo gives a unique release name to the software being deployed:
${bamboo.deploy.release}
Example:
develop-699