From 5ff99bdd6d38cadbfed727884ae32f06f2257730 Mon Sep 17 00:00:00 2001 From: Lucas Hrabovsky Date: Fri, 17 Apr 2015 11:30:54 -0400 Subject: [PATCH] node-pre-gyp support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- .travis.yml | 14 ++++++++++ README.md | 28 +++++++++++++++++-- appveyor.yml | 34 ++++++++++++---------- package.json | 79 +++++++++++++++++++++++++++++++++++----------------- 4 files changed, 112 insertions(+), 43 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..c03bb05 --- /dev/null +++ b/.travis.yml @@ -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 diff --git a/README.md b/README.md index f9917c2..c44d0a7 100644 --- a/README.md +++ b/README.md @@ -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. \ No newline at end of file +[![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 diff --git a/appveyor.yml b/appveyor.yml index 448a8cc..dcec48e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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 \ No newline at end of file +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 diff --git a/package.json b/package.json index 9e03237..b17b55a 100644 --- a/package.json +++ b/package.json @@ -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 " -, "contributors" : [] - -, "repository" : { "type" : "git" - , "url" : "git://github.com/christkv/bson-ext.git" } -, "bugs" : { "mail" : "node-mongodb-native@googlegroups.com" - , "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 ", + "contributors": [], + "repository": { + "type": "git", + "url": "git://github.com/christkv/bson-ext.git" + }, + "bugs": { + "mail": "node-mongodb-native@googlegroups.com", + "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" } ] }