Bitbucket Pipelines to GitLab CI Converter

Convert bitbucket-pipelines.yml to .gitlab-ci.yml. Translates default/branches/tags/pull-requests/custom pipelines, parallel groups, pipes, and built-in caches.

Migrating from Bitbucket Pipelines to GitLab CI

Bitbucket pipelines' trigger sections become GitLab CI `workflow.rules` entries plus per-job `rules:`. Every step becomes a job, with parallel groups expressed as sibling jobs sharing a stage. Built-in caches (`node`, `pip`, etc.) map to explicit GitLab `cache:` blocks with the canonical paths.

Syntax cheat sheet

ConceptBitbucket PipelinesGitLab CI
Triggerpipelines: branches: main:workflow: rules: - if: '$CI_COMMIT_BRANCH == "main"'
Step- step: script: [npm test]test: script: [npm test]
Imageimage: node:20image: node:20
Cachecaches: [node]cache: paths: [node_modules]
Manualtrigger: manualwhen: manual

Gotchas to watch for

  • warning

    Custom pipelines become rules

    `pipelines.custom.<name>` translates to a job that only runs when the matching variable is set or the pipeline is manually triggered with `CI_PIPELINE_SOURCE == "web"`.

  • warning

    Pipe arguments must be flattened

    `pipe: atlassian/aws-s3-deploy:1.4.0` with `variables:` becomes a shell command in the GitLab output. Review the converted command for arguments your pipe customised.

Worked examples

Bitbucket build → GitLab CI

Default pipeline → single GitLab job.

Bitbucket Pipelines
image: node:20
pipelines:
  default:
    - step:
        name: Test
        caches: [node]
        script:
          - npm ci
          - npm test
GitLab CI
stages:
  - stage-0
default-1:
  stage: stage-0
  image: node:20
  cache:
    key: node-cache
    paths: [node_modules]
  script:
    - npm ci
    - npm test

Frequently asked questions

Does it convert Bitbucket Deployments?expand_more

No. GitLab's `environment:` block is a partial equivalent — the converter emits a TODO comment listing the deployment environments to recreate.

Related Tools