Skip to content

Commit

Permalink
node-pre-gyp support
Browse files Browse the repository at this point in the history
- binaries will be built on demand for linux and windows
- just bump the version number in package.json (e.g. `npm version
patch`), commit+push, and appveyor and travis will test and deploy new
prebuilt binaries as needed
- binaries are “maybe built” via a posttest hook for minimal
duplication in CI configs
- binaries live on S3 behind https://bin.mongodb.org/ (all in the
devops production environment, fully managed and maintained by them)
which is fronted by CloudFront (CDN)
- using mongodb-js fork of node-pre-gyp for easier tooling integration
  • Loading branch information
imlucas committed Apr 17, 2015
1 parent 065d572 commit 5ff99bd
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 43 deletions.
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
os: linux
language: node_js
node_js:
- node
- '0.10'
- iojs
sudo: false
env:
global:
- secure: ER5LYPXeYbQz8IH7IFlEOdiUFhQZ/he6MBiKgAQlUEaY+aF48Ypd9FaXue0R6OPxqBoTVA6rFixdiAZk7U0wB9wTzyABWWUBEmFO7WMbDWfFp4cOTbtHGQREBotYv0vaC8L+qgRDqtM0ASGm8/i8duRM1ICQ7n3N01ezAlMTu8I=
- secure: hlJfOM3VG9xYFQ+TrGWgIc5H2zowRGJBtIm710Mg5JQ4F6tpz7wzIZ+MpynGOklD8ltuLhUUSmf+doejVzCiRRADqF2ubjTRWafyqfz8p5nESz0ovw4g+rQuOOt3S4FbmKiHCZtoYEqn1N47GIaN06ucakK+rvS2DANgpSwOLPI=
cache:
directories:
- node_modules
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
Javascript + C++ BSON parser
============================
# bson-ext

This module contains the C++ BSON parser only and is not meant to be used in isolation from the `bson` NPM module. It lives in it's own module so it can be an optional dependency for the `bson` module.
[![linux build status](https://secure.travis-ci.org/imlucas/bson-ext.png)](http://travis-ci.org/imlucas/bson-ext)
[![windows build status](https://ci.appveyor.com/api/projects/status/github/imlucas/bson-ext)](https://ci.appveyor.com/project/imlucas/bson-ext)

This module contains the C++ BSON parser only and is not meant to be used in
isolation from the [bson](http://npm.im/bson) NPM module. It lives in
it's own module so it can be an optional dependency for the
[bson](http://npm.im/bson) module.


## Testing

```
npm test
```

## Prebuilt Binaries

bson-ext uses [node-pre-gyp](http://npm.im/node-pre-gyp) to publish and install
prebuilt binaries. This means you don't need the full toolchain installed
and configured correctly to use this module.

## License

Apache 2
34 changes: 19 additions & 15 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
# Test against this version of Node.js
# node.js support: Latest stable version, `0.10.x`
# iojs support: Latest stable version
environment:
node_pre_gyp_accessKeyId:
secure: Q/MT3KqteKjl23ePjDY9V93G8Ey91LJAOcvJPdEh0i4=
node_pre_gyp_secretAccessKey:
secure: pF+hGI1d/+HVKL0EWCGY6YxvRZrfQrLoxfG5AqQTLJ9hJZaiRRQTwU8cwL+4IEuW
matrix:
# node.js
- nodejs_version: "0.10"
- nodejs_version: "0.12"
# io.js
- nodejs_version: "1.6"
- nodejs_version: 0.10
- nodejs_version: 0.12
- nodejs_version: 1.x

platform:
- x86
- x64

# Install scripts. (runs after repo cloning)
install:
# Get the latest stable version of Node.js or io.js
- ps: Install-Product node $env:nodejs_version
# install modules
- npm install
- npm install --build-from-source

# Post-install test scripts.
test_script:
# Output useful info for debugging.
- node --version
- npm --version
# run tests
- npm test

# Don't actually build.
build: off
matrix:
fast_finish: true

cache:
- C:\Users\appveyor\AppData\Roaming\npm\node_modules -> package.json # global npm modules
- C:\Users\appveyor\AppData\Roaming\npm-cache -> package.json # npm cache
- node_modules -> package.json # local npm modules

build: OFF
79 changes: 54 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,56 @@
{ "name" : "bson-ext"
, "description" : "The C++ bson parser for the node.js mongodb driver."
, "keywords" : ["mongodb", "bson", "parser"]
, "version" : "0.1.0"
, "author" : "Christian Amor Kvalheim <[email protected]>"
, "contributors" : []

, "repository" : { "type" : "git"
, "url" : "git://github.com/christkv/bson-ext.git" }
, "bugs" : { "mail" : "[email protected]"
, "url" : "https://github.com/christkv/bson-ext/issues" }
, "dependencies": {
"nan": "1.7.0"
{
"name": "bson-ext",
"description": "The C++ bson parser for the node.js mongodb driver.",
"keywords": [
"mongodb",
"bson",
"parser"
],
"version": "0.1.0",
"author": "Christian Amor Kvalheim <[email protected]>",
"contributors": [],
"repository": {
"type": "git",
"url": "git://github.com/christkv/bson-ext.git"
},
"bugs": {
"mail": "[email protected]",
"url": "https://github.com/christkv/bson-ext/issues"
},
"dependencies": {
"nan": "~1.7.0",
"node-pre-gyp": "mongodb-js/node-pre-gyp"
},
"devDependencies": {
"aws-sdk": "~2.1.20",
"nodeunit": "~0.9.0"
},
"bundledDependencies": [
"node-pre-gyp"
],
"main": "./index",
"directories": {
"lib": "./lib/bson"
},
"engines": {
"node": ">=0.8.19"
},
"scripts": {
"install": "node-pre-gyp install --fallback-to-build",
"test": "nodeunit ./test/node",
"posttest": "node-pre-gyp publish-maybe"
},
"licenses": [
{
"type": "Apache License, Version 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0"
}
],
"binary": {
"module_name": "bson",
"module_path": "build/Release",
"host": "https://bin.mongodb.org",
"remote_path": "/js/bson-ext/v{version}",
"bucket": "mongodb-dx-public"
}
, "devDependencies": {
"nodeunit": "0.9.0"
}
, "main": "./index"
, "directories" : { "lib" : "./lib/bson" }
, "engines" : { "node" : ">=0.8.19" }
, "scripts": {
"install" : "(node-gyp rebuild 2> builderror.log) || (exit 0)",
"test" : "nodeunit ./test/node"
}
, "licenses" : [ { "type" : "Apache License, Version 2.0"
, "url" : "http://www.apache.org/licenses/LICENSE-2.0" } ]
}

0 comments on commit 5ff99bd

Please sign in to comment.