Bamboo

CI/CDBambooAtlassianEnterpriseBuild AutomationJavaCommercialIntegration

CI/CD Tool

Bamboo

Overview

Bamboo is Atlassian's enterprise-grade CI/CD server. It features tight integration with Atlassian products, robust build management, and enterprise-level security, but Atlassian ended server edition support in February 2024, with migration to Bitbucket Pipelines recommended.

Details

Bamboo has been adopted by many enterprises as Atlassian's enterprise-focused CI/CD (Continuous Integration/Continuous Delivery) server over the years. The latest stable version, Bamboo 8.0, was released in July 2021, focusing on datacenter and enterprise features like build resilience, credential encryption, and Java 11 platform updates. A significant change is that Atlassian announced the end of life for Bamboo Server edition on February 15, 2024. Currently, existing users are recommended to gradually migrate to Bitbucket Pipelines, and while Bamboo Data Center is planned to be offered, details remain unannounced. Deep integration with Jira, Bitbucket, and Confluence enables seamless DevOps workflows within the Atlassian ecosystem. Multi-stage build plans, automatic triggers on commits, and agent assignment to critical builds and deployments are supported, with parallel automated testing providing strong support for Agile development. Enterprise security includes role-based access control (RBAC), LDAP/Active Directory authentication, and integration with AWS CodeDeploy, Amazon S3, and Docker supports a wide range of technology stacks.

Pros and Cons

Pros

  • Atlassian Integration: Deep integration with Jira, Bitbucket, Confluence
  • Enterprise Security: RBAC, LDAP/AD authentication support
  • Build Resilience: High availability and scalability
  • Deployment Automation: Environment-specific permission-controlled deployment
  • Branch Management: Optimization with Git/Mercurial distributed VCS
  • Jenkins Migration: Easy import of build configurations
  • Parallel Processing: Multi-agent parallel builds and tests
  • AWS/Docker Integration: Modern cloud and container environment support

Cons

  • Server Edition End of Life: Support ended February 2024
  • Migration Required: Must migrate to Bitbucket Pipelines or other tools
  • License Costs: High enterprise-grade licensing fees
  • Configuration Complexity: Complex configuration management in large environments
  • Update Frequency: Decreased frequency of new feature additions
  • Cloud Migration Challenges: Overhead of migrating from on-premises to cloud
  • Competitive Disadvantage: Widening feature gap with Jenkins, GitLab, etc.

Key Links

Code Examples

Basic Build Plan Configuration

# bamboo.yml (Bamboo specification)
version: 2

# Build plan definition
build-plan:
  project-key: PROJ
  plan-key: BUILD
  plan-name: "Node.js Application Build"
  
# Stage and job definitions
stages:
  - stage-name: "Build and Test"
    jobs:
      - job-name: "Build Job"
        key: BUILD-JOB
        artifacts:
          - name: "dist"
            pattern: "dist/**"
        tasks:
          - checkout-task
          - script-task:
              description: "Install Dependencies"
              script: |
                npm ci
                npm run build
          - script-task:
              description: "Run Tests"
              script: |
                npm test
                npm run coverage
        final-tasks:
          - test-parser-task:
              type: "junit"
              test-results: "**/test-results.xml"

# Agent requirements
agent-requirements:
  - system.builder.node.version: "18"
  - system.os.name: "Linux"

# Variable settings
variables:
  - NODE_ENV: "test"
  - BUILD_TYPE: "production"

Jira Integration and Release Management

# Bamboo Jira Integration Plan
plan-configuration:
  project: MYPROJ
  plan: RELEASE
  
stages:
  - stage-name: "Build and Package"
    jobs:
      - job-name: "Build Application"
        tasks:
          - checkout-task
          - script-task:
              description: "Build Application"
              script: |
                npm ci
                npm run build
                tar -czf app-${bamboo.buildNumber}.tar.gz dist/
        artifacts:
          - name: "application-package"
            pattern: "app-*.tar.gz"

  - stage-name: "Deploy to Staging"
    jobs:
      - job-name: "Deploy Staging"
        requirements:
          - staging-environment
        tasks:
          - artifact-download-task:
              artifact: "application-package"
          - script-task:
              description: "Deploy to Staging"
              script: |
                tar -xzf app-${bamboo.buildNumber}.tar.gz
                aws s3 sync dist/ s3://staging-bucket/
                
        # Jira integration - Deploy information update
        final-tasks:
          - jira-task:
              action: "transition-issue"
              jql: "project = PROJ AND status = 'In Progress'"
              transition: "Deploy to Staging"
              comment: "Deployed build ${bamboo.buildNumber} to staging environment"

# Deployment project configuration
deployment-project:
  name: "Application Deployment"
  environments:
    - name: "Staging"
      tasks:
        - script-task:
            script: |
              echo "Deploying to staging..."
              kubectl apply -f k8s/staging/
    - name: "Production"
      approval-required: true
      tasks:
        - script-task:
            script: |
              echo "Deploying to production..."
              kubectl apply -f k8s/production/

Docker Integration and Container Builds

# Docker Integration Plan
version: 2

plan:
  project-key: DOCKER
  plan-key: BUILD
  
stages:
  - stage-name: "Docker Build and Push"
    jobs:
      - job-name: "Docker Build"
        docker:
          image: "docker:latest"
        requirements:
          - system.docker.executable
        tasks:
          - checkout-task
          - script-task:
              description: "Build Docker Image"
              script: |
                docker build -t myapp:${bamboo.buildNumber} .
                docker tag myapp:${bamboo.buildNumber} myapp:latest
          - script-task:
              description: "Run Container Tests"
              script: |
                docker run --rm myapp:${bamboo.buildNumber} npm test
          - script-task:
              description: "Push to Registry"
              script: |
                echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
                docker push myapp:${bamboo.buildNumber}
                docker push myapp:latest

variables:
  - DOCKER_USERNAME: "${bamboo.docker.username}"
  - DOCKER_PASSWORD: "${bamboo.docker.password}"

# AWS integration configuration
aws-configuration:
  region: "us-west-2"
  tasks:
    - aws-codedeploy-task:
        application-name: "myapp"
        deployment-group: "production"
        s3-bucket: "deployment-artifacts"
        s3-key: "app-${bamboo.buildNumber}.tar.gz"

Multi-branch and Parallel Builds

# Multi-branch and Parallel Build Configuration
plan-branches:
  # Main branch configuration
  master:
    create-manually: false
    cleanup-manually: false
    
  # Automatic feature branch detection
  feature-branches:
    pattern: "feature/*"
    auto-create: true
    cleanup-after-days: 7
    
  # Release branches
  release-branches:
    pattern: "release/*"
    auto-create: true
    cleanup-manually: true

# Parallel stage configuration
stages:
  - stage-name: "Parallel Tests"
    jobs:
      - job-name: "Unit Tests"
        parallel: true
        tasks:
          - script-task:
              script: |
                npm run test:unit
      - job-name: "Integration Tests"
        parallel: true
        tasks:
          - script-task:
              script: |
                npm run test:integration
      - job-name: "E2E Tests"
        parallel: true
        tasks:
          - script-task:
              script: |
                npm run test:e2e

  - stage-name: "Build and Deploy"
    depends-on: ["Parallel Tests"]
    jobs:
      - job-name: "Build and Deploy"
        tasks:
          - script-task:
              script: |
                npm run build
                npm run deploy

# Agent management
agents:
  local-agents:
    - name: "build-agent-1"
      requirements:
        - system.os.name: "Linux"
        - system.builder.mvn.version: "3.6"
  remote-agents:
    - name: "aws-build-agent"
      type: "elastic"
      instance-type: "m5.large"

CI/CD Pipeline and Bitbucket Integration

# Bitbucket Integration and Advanced Pipeline
bitbucket-integration:
  repository:
    url: "https://bitbucket.org/myteam/myapp"
    branch-detection: "automatic"
    webhook-triggers: true

# Advanced trigger configuration
triggers:
  - type: "repository-polling"
    cron: "0 */5 * * * ?"
  - type: "bitbucket-webhook"
    events: ["push", "pull-request"]
  - type: "scheduled"
    cron: "0 2 * * *"
    description: "Nightly build"

# Notification configuration
notifications:
  - type: "email"
    events: ["build-failed", "build-successful"]
    recipients: ["[email protected]"]
  - type: "hipchat"
    room: "devops"
    events: ["build-failed"]
  - type: "jira"
    update-issues: true
    jql: "project = MYPROJ AND status = 'In Progress'"

# Environment variables and security
security:
  variables:
    - name: "API_KEY"
      value: "${bamboo.vault.api.key}"
      encrypted: true
    - name: "DATABASE_URL"
      value: "${bamboo.vault.db.url}"
      encrypted: true
      
  permissions:
    - user: "admin"
      permissions: ["admin", "build", "clone"]
    - group: "developers"
      permissions: ["build", "view"]

# Quality gates and reporting
quality-gates:
  - type: "test-coverage"
    threshold: 80
    fail-build: true
  - type: "code-quality"
    sonarqube-task:
      server: "sonar.company.com"
      project-key: "myapp"

Migration from Bamboo to Bitbucket Pipelines

# bitbucket-pipelines.yml (Post-migration configuration example)
image: node:18

pipelines:
  default:
    - step:
        name: Build and Test
        caches:
          - node
        script:
          - npm ci
          - npm run build
          - npm test
        artifacts:
          - dist/**
          
  branches:
    main:
      - step:
          name: Build and Test
          caches:
            - node
          script:
            - npm ci
            - npm run build
            - npm test
          artifacts:
            - dist/**
      - step:
          name: Deploy to Production
          deployment: production
          script:
            - aws s3 sync dist/ s3://production-bucket/
            - aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_ID --paths "/*"

  pull-requests:
    '**':
      - step:
          name: Build and Test PR
          script:
            - npm ci
            - npm run build
            - npm test

# Docker container builds
definitions:
  caches:
    sonar: ~/.sonar/cache
  services:
    postgres:
      image: postgres:13
      variables:
        POSTGRES_DB: testdb
        POSTGRES_USER: testuser
        POSTGRES_PASSWORD: testpass