Bitbucket Pipelines: CI/CD Built Into Your Repository

Build, test, and deploy on every push

Bitbucket Pipelines runs CI/CD directly from your repository with a single YAML file. For teams already using Jira, the tight integration is a big advantage.

A Basic Pipeline

image: node:22

definitions:
  caches:
    npm: ~/.npm

pipelines:
  default:
    - step:
        name: Test
        caches: [npm]
        script:
          - npm ci
          - npm test
  branches:
    main:
      - step:
          name: Build
          caches: [npm]
          script:
            - npm ci
            - npm run build
          artifacts:
            - build/**
      - step:
          name: Deploy to production
          deployment: production
          trigger: manual
          script:
            - ./scripts/deploy.sh

Key Concepts

  • Steps run in Docker containers
  • Caches speed up dependency installs
  • Artifacts pass files between steps
  • Deployments track which version is in which environment
  • Parallel steps run tests faster

Jira Integration

Include the Jira issue key in branch names and commit messages (SUP-142-fix-login). Jira then shows builds and deployments on the issue, and you can see what was released where.

Secrets

Use repository or deployment variables marked as secured. Never commit credentials. Prefer OIDC for cloud deployments where possible.

Tips

  • Run fast checks (lint, unit tests) first
  • Use trigger: manual for production
  • Cache wisely and keep images small
  • Use self-hosted runners for special hardware or network access

CI/CD should make releasing boring. Pipelines plus Jira gives you that — with a full audit trail.

Arivanandhan Chitheshwaran