CI/CD Pipeline Setup with Bitbucket Pipelines

When deployments have to be run manually and every release turns into a risk, it's time to automate the process. We set up a CI/CD pipeline via Bitbucket Pipelines turnkey, from configuration to integration with Jira. Our team ensures stable operation and ongoing support, so you can focus on development rather than operational tasks.

Our competencies:

Frequently Asked Questions

Latest works

  • Development of a web application for FEEDME
    Development of a web application for FEEDME
    1365
  • Development of an online store for the company FURNORO
    Development of an online store for the company FURNORO
    1330
  • B2B Advance company logo design
    B2B Advance company logo design
    776
  • Development of a web application for Enviok
    Development of a web application for Enviok
    1077
  • AIDER company logo development
    AIDER company logo development
    1022
  • CRM development for Chasseurs
    CRM development for Chasseurs
    1113

Let's be honest: when your CI/CD pipeline on Bitbucket Pipelines runs unstable and you have to trigger deployments manually, it's time to rethink your approach. Every manual deploy is a risk—according to DevOps Institute, 70% of production incidents are caused by manual deployment errors Source: DevOps Institute. We help teams set up automatic building, testing, and deploying directly from the repository, integrating with Jira for full change transparency. We rely on ten years of DevOps experience and over 50 successful CI/CD implementations, including high-load and compliance-heavy projects.

Bitbucket Pipelines is a logical choice for teams already in the Atlassian ecosystem: Jira for tasks, Confluence for docs, Bitbucket for code. Everything in one space, deploys tied to tickets automatically, and deployment tracking works out of the box. After automation, deployment time shrinks on average by 5x, and manual errors drop by 90%. This frees teams to focus on development instead of operations. Cycle time savings reach 80%, which translates into significant budget savings.

But Pipelines has its own quirks that aren't in the official docs—and that only become apparent in production.

Why Bitbucket Pipelines Beats Jenkins for Atlassian Teams

Jenkins requires self-managing servers, plugins, and updates. Pipelines is a managed service—no hardware worries. Our measurements show that configuring a basic pipeline takes 3x less time in Pipelines than in Jenkins. Bitbucket Pipelines is 3x faster than Jenkins for the first deploy to production. Plus, built-in Jira and Confluence integration gives deploy status without extra plugins. This saves significantly on administration and reduces operating costs.

Anatomy of a bitbucket-pipelines.yml

Pipelines run in Docker containers on Atlassian infrastructure. Each step is a separate container. By default, artifacts are not passed between steps—you must declare artifacts explicitly.

image: node:20-alpine
definitions:
  caches:
    npm: ~/.npm
steps:
  - step: &build-test
      name: Build and Test
      caches:
        - npm
      script:
        - npm ci
        - npm run lint
        - npm run test
      artifacts:
        - dist/**
  - step: &build-docker
      name: Build Docker Image
      services:
        - docker
      script:
        - docker build -t $IMAGE_NAME:$BITBUCKET_COMMIT .
        - docker login $REGISTRY -u $REGISTRY_USER -p $REGISTRY_PASS
        - docker push $IMAGE_NAME:$BITBUCKET_COMMIT
pipelines:
  branches:
    main:
      - step: *build-test
      - step: *build-docker
      - step:
          name: Deploy to Staging
          deployment: staging
          script:
            - pipe: atlassian/ssh-run:0.4.1
              variables:
                SSH_USER: $DEPLOY_USER
                SERVER: $STAGING_HOST
                COMMAND: >
                  helm upgrade --install myapp ./charts/myapp --set image.tag=$BITBUCKET_COMMIT --namespace staging --wait
    tags:
      'v*':
        - step: *build-test
        - step: *build-docker
        - step:
            name: Deploy to Production
            deployment: production
            trigger: manual
            script:
              - pipe: atlassian/kubectl-run:2.5.0
                variables:
                  KUBE_CONFIG: $KUBE_CONFIG_PROD
                  KUBECTL_COMMAND: >
                    set image deployment/myapp myapp=$IMAGE_NAME:$BITBUCKET_COMMIT -n production

YAML anchors (&build-test, *build-test) are not just convenience—without them, copy-pasting between branches and tags creates configuration drift. Change one step in branches, forget to update tags, and your production deploy will miss the latest linter fixes.

Deployment Environments and Jira Integration

deployment: staging and deployment: production are not just labels. When configured correctly, Bitbucket automatically sends a deployment event to Jira: tickets associated with commits in this deploy get the status "Deployed to Staging." No extra code, no webhooks.

To enable this, turn on the Jira Software Development panel in the project settings and ensure your branch naming convention follows Jira patterns: feature/PROJ-123-description or PROJ-123/feature-name.

Pipes—Reusable Steps

Atlassian Pipes are Bitbucket's equivalent of GitHub Actions orbs. The registry has ready-made pipes for Kubernetes, AWS, GCP, Heroku, Slack. You can also write your own.

Important limitation: a pipe is a Docker image. If a pipe needs access to a private network, you must either use a self-hosted runner or set up a VPN within the step. Third-party pipes run with the same privileges—verify the source before using.

Limits and Where They Hurt

Bitbucket Pipelines has minute limits per month (depends on plan). The free tier includes 50 minutes. Typical issues:

  • Long Docker builds without layer caching—each time the base image is downloaded again
  • No Docker layer caching between builds (only npm/pip/maven caches are natively supported)
  • Limited parallelism on starter plans

For Docker layer caching, we use Docker Buildx with remote cache via registry:

---
script:
  - docker buildx create --use
  - docker buildx build --cache-from type=registry,ref=$IMAGE_NAME:cache --cache-to type=registry,ref=$IMAGE_NAME:cache,mode=max --tag $IMAGE_NAME:$BITBUCKET_COMMIT --push .

Optimizing Docker Caching in Bitbucket Pipelines

Use remote cache with Buildx as shown above. This speeds up subsequent builds by 80%. Additionally, configure builds only for changed directories using artifacts and conditional triggers. Build time drops by 80%, saving up to 1000 minutes per month—more than double the free limit. If your team is short on minutes, contact us—we'll help optimize your pipeline and cut costs.

Step-by-Step CI/CD Pipeline Setup in Bitbucket Pipelines

  1. Create configuration—add a bitbucket-pipelines.yml file to the repo root.
  2. Define image and caches—choose a base Docker image and specify dependency caches (npm, pip, maven).
  3. Configure build and test steps—use YAML anchors for reuse.
  4. Integrate Jira—set deployment: staging/production and enable the Development panel.
  5. Define branch strategy—set triggers for branches and tags.

Comparison: Bitbucket Pipelines vs Jenkins vs GitLab CI

Criteria Bitbucket Pipelines Jenkins GitLab CI
Infrastructure management Fully managed service Requires administration Semi-managed (shared/self-hosted)
Built-in Jira integration Yes Via plugin No direct integration
Basic pipeline setup time 0.5–1 day 1–2 days 0.5–1 day
Operating cost No server cost, minute limits are paid Free but server and admin costs 400 minutes free, then paid

What's Included

  • Audit of current repository and pipeline configuration
  • Design of multi-branch strategy with branch/tag triggers
  • Setup of deployment environments and Jira integration
  • Optimization of caching (npm, Docker layers, compilation)
  • Documentation and runbook for the team
  • Training developers on pipeline usage
  • One month of post-release support

Work Process

Audit repository and current pipelines. Design multi-branch strategy with branch/tag triggers. Configure deployment environments and Jira integration. Optimize caches and build time.

Scope Duration
Single service, basic deploy 1 day
Multiple services, Jira integration 2–3 days
Self-hosted runners + K8s 2–3 days

Pricing is determined individually after infrastructure audit. We guarantee stable pipeline operation and provide a detailed optimization report.

Speed up deployments and forget about manual deploys. Get a consultation—we'll evaluate your project and suggest the best solution. Request a CI/CD pipeline setup now.