ci-build

Continuous integration build tool for node apps.

npm install ci-build
3 downloads in the last month

ci-build

Continuous Integration build tool for node apps.

Usage

Command Line Interface

cibuild -cwd:/path/to/node/package -deploy

Configuration

ci-build.json (per project)

{
    "rpmbuild": {
        "name": "dpscluster",
        "files": { "/var/local/dps-cluster/": "dist/**", "/etc/init/": "scripts/upstart/**", "/usr/bin": "bin/**" },
        "release": 1,
        "publish": {
            "channels": [ "dps-v6-64bit-dev-web" ]
        }
    },
    "deployment":{
        "include": [ "lib/**", "bin/**" ]
    }
}

rpmbuild - If omitted, RPM will not be built.

  • name - Name of RPM
  • files - json { "/my/install/path": "my/source/path/relative/to/cwd" }
  • release - Release number of RPM.
  • publish - If omitted, publish to spacewalk will be skipped.
    • channels - json ["my-spacewalk-channel"]

deployment

  • include - json [ "my/path1", "my/path2" ]

config.json

headerText - Can include the following placeholders:

  • {{year}} - Current year.
  • {{gitHash}} - Current GIT hash.
  • {{buildVersion}} - Current version from package.json.
  • {{gitBranch}} - Current GIT branch.
  • {{buildNumber}} - Build number passed from Jenkins.
  • {{now}} - Current time.

CI Steps

  • Clean - Clean temp directories.
  • Version - Get GIT version information.
  • Test - Run mocha tests, linting, code coverage.
  • Build - Prepare dist directory.
  • Deploy - Publish to NPM, create RPM, push RPM to spacewalk.

Clean

  • Removes any temp directories left over by last build.

Version

  • Get GIT hash and branch information. Uses git cli.

Test

  • Mocha Tests - Make a call to shell npm test.
  • Linting - Perform linting using jshint. Uses .jshintrc file for global options.
  • Code Coverage - Perform code coverage using istanbul. This currently does not fail if code coverage is not met. Requires baseline_cover.js in test directory.

Build

  • Copy all deployment files to a dist directory.

Deploy

  • Publish package to NPM repo. Uses package.json publishConfig.
  • Package files into an RPM file.
  • Publish RPM to spacewalk using rhnpush cli.
npm loves you