Bamboo Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 25: Line 25:
=Task=
=Task=


{{External|https://confluence.atlassian.com/bamboo0606/using-bamboo/jobs-and-tasks/configuring-tasks/configuring-a-builder-task}}
{{External|[https://confluence.atlassian.com/bamboo0606/using-bamboo/jobs-and-tasks Bamboo Documentation - Jobs and Tasks]}}


A task is an operation that is run on a Bamboo working directory using an [[#Executable|executable]], such as a script, shell command, ant task or Maven goal.
A task is an operation that is run on a Bamboo working directory using an [[#Executable|executable]], such as a script, shell command, ant task or Maven goal.

Revision as of 18:04, 7 December 2018

Internal

Project

Projects allow you to easily group and identify plans which are logically related to each other.

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.

Plan Operations

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

Bamboo Documentation - Jobs and Tasks

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.

Typical Tasks for the Default Job

  • Source Code Checkout: Tasks -> Add task -> Source Control -> Source Code Checkout. Task description: "GitHub checkout", Repository: pick from pre-configured, see repository.
  • Command: Tasks -> Add task -> Command. Task description: "Gradle build and publish command", Executable: Gradle4, argument:
clean build publish
  • JUnit Parser: Tasks -> Add task -> JUnit Parser. Task description: "Parses JUnit test results", Specify custom result directories:
**/test-results/test/*.xml
  • Command: Tasks -> Add task -> Command. Task description: "Clover file converter", Executable: CloverConverter, argument:
clean build publish
  • Command: Tasks -> Add task -> Command. Task description: "SonarQube", Executable: Gradle4, argument:
sonarqube  -Dsonar.branch.name=${bamboo.repository.git.branch} -Dsonar.projectKey=up.plat-svc.cryptm  -Dsonar.organization=test-inc   -Dsonar.host.url=https://sonarcloud.io  -Dsonar.login=...

Artifacts

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

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.

Executable

https://confluence.atlassian.com/bamboo0606/bamboo-faq/glossary/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 Operations

Repository Types

Git

In general, use Git repositories, which allow SSH authentication.

GitHub

GitHub won't allow SSH authentication.

Variables

Bamboo Variables

Build-specific Variables

Deployment Variables

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.

Plan Variables