Skip to content

bit-tasks/bitbucket-pipeline-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Bit Tasks for Bitbucket CI/CD Pipelines

Example Bitbucket Pipeline jobs for common Bit and Git CI/CD workflows.

Bitbucket Support with Bit Docker Image

Leverage seamless integration of Bitbucket support through the Bit Docker image. Select from these available images:

  • Latest Stable:

    bitsrc/stable:latest
    
  • Nightly:

    bitsrc/nightly:latest

Setup Guide

  1. Initialize Configuration File: Create bitbucket-pipelines.yml in your Bitbucket repository's root with the code shown below.
  2. Workspace Navigation: Move to the appropriate directory if your workspace isn't at the root of your Git repository. For instance, use cd ws-dir.
  3. Script Initialization: Begin with bitbucket.bit.init, as subsequent scripts will depend on it.
  4. CI/CD Variables Setup: Define new CI/CD variables like:
    • BITBUCKET_ACCESS_TOKEN: Your Bitbucket Repository Access Token with appropriate permissions.
    • BIT_CLOUD_ACCESS_TOKEN: You need BIT_CLOUD_ACCESS_TOKEN (docs).
    • GIT_USER_NAME
    • GIT_USER_EMAIL

Ensure these variables are correctly configured within your Bitbucket Pipelines.

Note: If you set the variables in Bitbucket repository settings under Repository variables, there's no need to explicitly define them inside your bitbucket-pipelines.yml file.

Automating Component Release

Task Example
Initialize Bit bit-init/bitbucket-pipelines.yml
Bit Verify Components verify/bitbucket-pipelines.yml
Bit Tag and Export tag-export/bitbucket-pipelines.yml
Bit Pull Request Build pull-request/bitbucket-pipelines.yml
Bit Lane Cleanup lane-cleanup/bitbucket-pipelines.yml
Commit Bitmap commit-bitmap/bitbucket-pipelines.yml

⬇️ Download Files

Update Workspace Components, External Dependencies and Envs

Task Example
Dependency Update dependency-update/bitbucket-pipelines.yml

⬇️ Download Files

Sync Git Branches with Bit Lanes

Task Example
Branch Lane branch-lane/bitbucket-pipelines.yml
Lane Branch lane-branch/bitbucket-pipelines.yml

⬇️ Download Files

Setup PNPM Caching

You can speed up the CI builds by caching pnpm store.

image: bitsrc/stable:latest

definitions:
  caches:
    pnpm: test-ws/.pnpm-store 
    
pipelines:
  branches:
    main:
      - step:
          name: Bit Verify
          script:
            - cd test-ws
            - bitbucket.bit.init
            - bitbucket.bit.verify
          caches:
            - pnpm

Note: Replace the directory test-ws with your workspace directory.

Contributor Guide

To contribute, make updates to scripts starting with bitbucket.bit. in the Bit Docker Image Repository.

To create zip files use the below commands.

chmod +x zip-files.sh
bash zip-files.sh

About

Bit BitBucket Pipeline Examples for Git CI/CD Pipelines

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages