2.0.1 • Published 7 years ago

pkg-ci v2.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

pkg-ci

circle-status

js-standard-style  npm.io 

zeit/pkg gives you the awesome ability to package your node app in a single executable binary. But if you have tests, you need to run them before you package your binary. This is fine for local development, but what if you want to run tests within a CI/CD environment against a previously packaged binary (avoid npm install perhaps)? pkg-ci allows you to do this.

TL;DR

Got a binary generated with zeit/pkg and you want to run your tests instead of running your app?

CI_MODE=true ./app

Run the app as usual

CI_MODE=false

Install

npm install pkg-ci

Usage

Create an entry file for your app entry.js (or whatever you want to call it). Require pkg-ci and point it to your app's package.json file

const path = require('path')
require('pkg-ci')(path.join(__dirname, './package.json'))

When you run your pkg build step, point it to entry.js

pkg entry.js --output ./out

Ensure your package.json has the appropriate npm start script defined

After you have compiled your binary, whenever your binary is run with CI_MODE=true your app will not run, instead, your npm test script will run. Anything else will run your app as usual.

Credits

License

MIT

2.1.1

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.0

7 years ago