Example Bitbucket Pipeline jobs for common Bit and Git CI/CD workflows.
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
- Initialize Configuration File: Create
bitbucket-pipelines.yml
in your Bitbucket repository's root with the code shown below. - 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
. - Script Initialization: Begin with
bitbucket.bit.init
, as subsequent scripts will depend on it. - 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 needBIT_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.
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 |
Task | Example |
---|---|
Dependency Update | dependency-update/bitbucket-pipelines.yml |
Task | Example |
---|---|
Branch Lane | branch-lane/bitbucket-pipelines.yml |
Lane Branch | lane-branch/bitbucket-pipelines.yml |
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.
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