Registry / devops / ci-build-tools

ci-build-tools

JSON →
library1.0.13jsnpmunverified

This library provides helper functions designed for Continuous Integration (CI) environments, specifically Travis-CI and JenkinsCI with Stash integration. Its primary features include automatically determining project versions based on branch names, publishing Git tags to the repository, and managing downstream branch merges (e.g., from `release` to `master`). The current stable version is 1.0.13, released several years ago, indicating an inactive development pace. Key differentiators include its tight integration with Travis-CI through specific `.travis.yml` encryption methods and its ability to infer versioning and automate Git operations within CI pipelines, aiming to reduce manual configuration and script complexity between build tasks and the CI platform. Due to its age, compatibility with modern Node.js versions or current CI platform features may be limited.

npm install ci-build-tools
INSTALL
IMPORT
SIG · CI-BUILD-TOOLS
C
ci-build-tools
devopsjavascriptv1.0.13
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

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

ci-build-tools module (initializer)
✓ const ci = require('ci-build-tools')(process.env.GIT_TAG_PUSHER ?? '');
✗ import ci from 'ci-build-tools'; const ci = require('ci-build-tools');
The module exports a function that must be immediately invoked with a `GIT_TAG_PUSHER` value (typically from `process.env`) to return the CI tools object. This package does not support ESM `import` syntax.
GetVersion
✓ ci.GetVersion();
✗ import { GetVersion } from 'ci-build-tools';
`GetVersion` is a method on the object returned by the module's initialization function, not a direct module export.
PublishGitTag
✓ ci.PublishGitTag();
✗ import { PublishGitTag } from 'ci-build-tools';
`PublishGitTag` is a method on the initialized CI tools object, requiring the `ci` object to be correctly set up first.
MergeDownstream
✓ ci.MergeDownstream('release/', 'master');
✗ import { MergeDownstream } from 'ci-build-tools';
`MergeDownstream` is a method on the initialized CI tools object, designed for specific branch merging strategies.

This code demonstrates how to initialize the `ci-build-tools` library, retrieve the current project version, publish a Git tag, and perform downstream branch merges within a CI environment, highlighting the necessary environment variable `GIT_TAG_PUSHER`.

// Example .travis.yml setup for GIT_TAG_PUSHER: // env: // global: // - GIT_TAG_PUSHER="your_encrypted_github_token" // Encrypted using `travis encrypt GIT_TAG_PUSHER=your_token --add env.global` // In your CI script (e.g., .travis.yml 'script' section): // export GIT_TAG_PUSHER="YOUR_GITHUB_TOKEN_HERE" // For local testing or non-Travis CIs, replace with your actual token or environment variable. // Initialize CI build tools with the Git tag pusher environment variable. // This key needs 'repo_deployment' and 'public_repo' access on GitHub. const ci = require('ci-build-tools')(process.env.GIT_TAG_PUSHER ?? ''); // Check if the CI object was initialized successfully (i.e., GIT_TAG_PUSHER was provided) if (!ci) { console.error('CI Build Tools could not be initialized. Ensure GIT_TAG_PUSHER is set.'); process.exit(1); } // Get the current version based on the branch name. // Assumes a branching strategy like 'release/v1.2.3' or 'master'. const version = ci.GetVersion(); console.log(`Current version determined: ${version}`); // Automatically publish a tag with the current version to the git repository. // This typically happens on successful builds of release branches or master. console.log(`Attempting to publish Git tag for version: ${version}`); try { ci.PublishGitTag(); console.log(`Successfully published Git tag: ${version}`); } catch (error) { console.error(`Failed to publish Git tag: ${error.message}`); // Optionally publish a custom tag // ci.PublishGitTag(`custom-tag-${version}-${Date.now()}`); } // Automatically merge downstream branches. // Example: if the current branch is `release/v1.0.0`, it attempts to merge into `master`. // This operation requires appropriate Git credentials and permissions. console.log('Attempting to merge downstream branches...'); try { ci.MergeDownstream('release/', 'master'); console.log('Successfully initiated downstream merge.'); } catch (error) { console.error(`Failed to merge downstream: ${error.message}`); }
Debug
Known issues
breakingThe `ci-build-tools` package is effectively abandoned, with no updates in over 7 years. Its internal dependencies, API integrations (e.g., with Travis-CI), and compatibility with modern Node.js versions or CI/CD platforms are highly likely to be outdated or broken.
fix
Consider using actively maintained alternatives for CI/CD automation or fork and update the library to support current environments. Evaluate the security implications of using an unmaintained package.
affects: >=1.0.0
gotchaThe main module export is a function that requires immediate invocation with `process.env.GIT_TAG_PUSHER`. Attempting to `require` or `import` the module without this invocation will result in a TypeError because methods like `GetVersion` will not exist on the uninitialized object.
fix
Always initialize the module with `const ci = require('ci-build-tools')(process.env.GIT_TAG_PUSHER ?? '');` ensuring `GIT_TAG_PUSHER` is properly set in your CI environment.
affects: >=1.0.0
gotchaThe setup instructions for Travis-CI rely on specific `travis encrypt` commands and GitHub API key scopes (`repo_deployment`, `public_repo`) that may be deprecated or have changed in modern Travis-CI environments or GitHub's API policy.
fix
Consult the latest Travis-CI documentation and GitHub API guidelines for secure credential management and API key scope requirements. Verify the suggested scopes are still appropriate and necessary to avoid security vulnerabilities or access issues.
affects: >=1.0.0
gotchaThe `MergeDownstream` functionality explicitly targets `release/*` and `master` branches by default. Custom branch naming conventions or more complex merging strategies will not be supported without modifying the library's source.
fix
Ensure your branching strategy aligns with `release/*` and `master` for automated merges, or be prepared to fork and modify the library's source code to accommodate custom workflows.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: ci.GetVersion is not a function
The `ci-build-tools` module was `require`d but not immediately invoked with the `GIT_TAG_PUSHER` argument, leaving `ci` as a function instead of the initialized object.
fix
Ensure the module is invoked: `const ci = require('ci-build-tools')(process.env.GIT_TAG_PUSHER);`
Error: Command failed: git push origin --tags (or similar Git command failure)
The `GIT_TAG_PUSHER` environment variable is either missing, incorrect, or the associated GitHub token lacks the necessary `repo_deployment` and `public_repo` permissions to perform Git operations.
fix
Verify that `GIT_TAG_PUSHER` is correctly set and encrypted in your CI environment, and that the GitHub Personal Access Token has the required scopes as outlined in the README.
Error: 'travis' command not found
The `travis` Ruby gem, used for encrypting environment variables for Travis-CI, is not installed or not in the system's PATH.
fix
Run `gem install travis` (after `apt-get install ruby-dev` on Debian-based systems) to install the Travis CI client.
Upgrade
Version history
1.0.13latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources