Registry / devops / bitbucket-build-status

bitbucket-build-status

JSON →
library1.2.0jsnpmunverified

The `bitbucket-build-status` package provides a command-line interface (CLI) tool, `bbuild`, for programmatically posting build statuses to Bitbucket Cloud and Bitbucket Server. Its primary function is to update the build status for a specific commit in a Bitbucket repository, indicating states like INPROGRESS, SUCCESSFUL, or FAILED. The current stable version is 1.2.0, last published in February 2020, indicating a stalled release cadence with no recent updates. Key differentiators include its simplicity as a standalone CLI tool and explicit support for both Bitbucket.org and self-hosted Bitbucket Server instances via a base URL option. It facilitates integration into CI/CD pipelines where direct API interaction for build status updates is needed without relying on a full-featured Bitbucket API client library.

npm install bitbucket-build-status
INSTALL
IMPORT
SIG · BITBUCKET-BUILD-ST
B
bitbucket-build-status
devopsjavascriptv1.2.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CLI Usage
Access directly via the `bbuild` command in your terminal after global npm installation.
import { bbuild } from 'bitbucket-build-status';
This package is strictly a command-line interface (CLI) tool. It does not export any functions, classes, or objects for programmatic import and use within JavaScript/TypeScript applications.
Programmatic API
This package is not designed for programmatic API calls.
const BitbucketBuildStatus = require('bitbucket-build-status');
Attempts to `require` or `import` this package as a module will result in errors, as its functionality is only exposed through the `bbuild` executable on the command line.
TypeScript Types
No programmatic types are available as there is no exportable API.
import type { BuildStatusOptions } from 'bitbucket-build-status';
As a CLI-only utility, `bitbucket-build-status` does not provide TypeScript type definitions for programmatic consumption by other modules.

Demonstrates how to use the `bbuild` command to post build statuses for both Bitbucket Server and Bitbucket Cloud.

#!/bin/bash # NOTE: Replace placeholders with your actual values BITBUCKET_SERVER_URL="https://bitbucket.your-company.com" REPO_OWNER="your_owner_or_team" REPO_SLUG="your-repository" COMMIT_HASH="a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0" BUILD_KEY="MY-CI-BUILD" BUILD_NAME="My Project Build" BUILD_URL="https://ci.your-company.com/build/123" BUILD_DESCRIPTION="Latest build from CI/CD pipeline" BITBUCKET_USERNAME="ci_user" BITBUCKET_APP_PASSWORD="your_bitbucket_app_password" # Example 1: Set status to INPROGRESS for Bitbucket Server # Use process.env.BITBUCKET_APP_PASSWORD for actual secrets bbuild \ --server "${BITBUCKET_SERVER_URL}" \ --owner "${REPO_OWNER}" \ --repo "${REPO_SLUG}" \ --commit "${COMMIT_HASH}" \ --state "INPROGRESS" \ --key "${BUILD_KEY}" \ --name "${BUILD_NAME}" \ --url "${BUILD_URL}" \ --description "${BUILD_DESCRIPTION}" \ --username "${BITBUCKET_USERNAME}" \ --password "${BITBUCKET_APP_PASSWORD}" # Example 2: Update status to SUCCESSFUL for Bitbucket Cloud (omit --server) bbuild \ --owner "${REPO_OWNER}" \ --repo "${REPO_SLUG}" \ --commit "${COMMIT_HASH}" \ --state "SUCCESSFUL" \ --key "${BUILD_KEY}" \ --name "${BUILD_NAME} - Final" \ --url "${BUILD_URL}/report" \ --description "Build passed all tests!" \ --username "${BITBUCKET_USERNAME}" \ --password "${BITBUCKET_APP_PASSWORD}"
bbuild --version
Debug
Known issues
breakingThis tool was last updated in February 2020 (v1.2.0). Bitbucket Server (and potentially Cloud) APIs have evolved, with some build status endpoints deprecated in Bitbucket Server 7.14 and newer versions. This CLI might be using outdated API endpoints, leading to `404 Not Found` or `400 Bad Request` errors for newer Bitbucket installations.
fix
For Bitbucket Server >= 7.14, verify if the tool's API calls are compatible with the current API (e.g., using projectKey and repositorySlug in the URL). Consider migrating to a more actively maintained Bitbucket API client library if issues persist.
affects: >=1.0.0
gotchaAuthentication with a Bitbucket Cloud account often requires an App Password instead of your regular account password, especially if 2FA is enabled or direct password authentication for APIs is restricted. Using a regular password may result in `401 Unauthorized` errors.
fix
Generate a Bitbucket App Password (via Personal settings -> App passwords) with sufficient 'Account: Write' and 'Repositories: Write' permissions, and use this as the `--password` value.
affects: >=1.0.0
gotchaThe `--server <url>` option is crucial for targeting a Bitbucket Server instance; omitting it defaults to Bitbucket Cloud (api.bitbucket.org). Misconfiguring this can lead to build statuses being sent to the wrong platform or `404 Not Found` errors.
fix
Always explicitly set `--server` with the base URL of your Bitbucket Server instance for self-hosted deployments. For Bitbucket Cloud, ensure it is omitted or set correctly if your project is not on bitbucket.org.
affects: >=1.0.0
gotchaThe supported states for a build status are strictly `INPROGRESS`, `SUCCESSFUL`, or `FAILED`. Using any other string will result in an API error. Field lengths are also restricted (e.g., `url` to 450 chars, `key`, `name`, `description` to 255 chars).
fix
Ensure the `--state` argument uses one of the exact specified values. Truncate `url`, `key`, `name`, and `description` values if they exceed their respective character limits.
affects: >=1.0.0
Errors
Common errors & fixes
Error: 401 Unauthorized
Invalid authentication credentials (username or password). For Bitbucket Cloud, this often means a regular password was used instead of an App Password, or the App Password lacks necessary permissions.
fix
Verify username and ensure an App Password (with 'Account: Write' and 'Repositories: Write' permissions) is used for Bitbucket Cloud. For Bitbucket Server, ensure the user account has `LICENSED` permission or higher.
Error: 404 Not Found
The specified commit, repository, or owner could not be found, or the Bitbucket API endpoint used by the tool is no longer valid for the target Bitbucket instance (especially Bitbucket Server versions >= 7.14).
fix
Double-check the `--commit`, `--repo`, and `--owner` values. If targeting Bitbucket Server, confirm API compatibility and consider the API changes in newer Bitbucket Server versions as a potential cause.
Error: Missing required argument: --commit
Essential arguments like `--commit`, `--repo`, `--state`, `--key`, or `--url` were not provided in the command line or the `--file` JSON.
fix
Consult `bbuild --help` and ensure all mandatory options are present. These typically include `--commit`, `--repo`, `--state`, `--key`, `--name`, `--url`, `--username`, and `--password`.
Upgrade
Version history
1.2.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
46 hits · last 30 days
node
40
Amazon
1
OpenAI (training)
1
Resources
bitbucket-build-status — npm install bitbucket-build-status · libregistry