A simple extensible NPM build bot.
Given a small script for building a specific module:
var tmp = require('tmp');
var assert = require('assert');
var ModuleSmith = require('module-smith');
var buildbot = ModuleSmith.createModuleSmith();
//
// Grab a temporary directory to build in
//
tmp.dir(function (err, tmpdir) {
assert.ifError(err);
//
// Start our build
//
buildbot.build({
repository: {
type: 'git',
url: '[email protected]:bmeck/bcrypt-example.git'
},
directories: {
rootdir: tmpdir
}
}, function (err, stream) {
assert.ifError(err);
//
// Pipe out the data to stdio
//
stream.pipe(process.stdout);
});
});
We can dump it to a file via:
node build.js > built.tgz
List of the versions supported with absolute version numbers like ie. '0.8.12'
The defaults for a build run using this ModuleSmith.
Runs a build
A build description enumerates a number of values
Optional environmental variables to spawn npm
with.
Some interesting fields are:
- npm_config_registry - registry to download from
- npm_config_nodedir - location of node-gyp's include directory
Optional user to spawn npm
as.
Optional group to spawn npm
under.
Optional package.json overrides.
Can be extended easily from the repository during npm.configure
.
Some interesting fields are:
- engines.node - version to spawn as
A checkout
npm module repository to download wbefore building.
The place to use for creating the build.
Extensibility for complex actions can be done via Understudy based actions, only before
actions are supported.
Notifications of actions that have been completed are available via the EventEmitter APIs.