GithubHelp home page GithubHelp logo

mfferreira / node-deb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from heartsucker/node-deb

1.0 3.0 0.0 52 KB

Debian packaging for Node.js projects

License: Other

Shell 99.72% JavaScript 0.28%

node-deb's Introduction

node-deb

Debian packaging for Node.js projects written 100% in bash.

Simple.

Installation

npm install node-deb

Compatibility

This exists mostly as an internal tool for my company, so until there is an 0.2.0 release, there will not be any sort of assurances of compatibility between releases. This includes command line flags, binaries, and init scripts.

Usage

node-deb [opts] -- file1 file2 ...

For the full list of options, run node-deb -h.

Configuration

You need to add the following to your package.json:

{
  "name": "some-app",
  ...
  "node_deb": {
    "start_command": "/usr/bin/node app.js arg1 arg2"
  }
}

Overrides

Command line options always override values found in the node_deb object in package.json, and values found in the node_deb object always override the values found in the rest of package.json.

Examples can be found by looking at test.sh and the corresponding projects in the test directory.

Examples

Ex. 1

package.json:

{
  "name": "some-app",
  "version": "1.2.3",
  "node_deb": {
    "start_command": "/usr/bin/node app.js arg1 arg2 arg3"
  }
}

cmd: node-deb -- app.js lib/

You will get:

  • A Debian package named some-app_1.2.3_all.deb
    • Containing the file app.js and the directory lib
    • Installed via
      • apt-get install some-app
      • apt-get install some-app=1.2.3

On install, you will get.

  • An executable named some-app
    • That starts the app with the command /usr/bin/node app.js arg1 arg2 arg3
  • An upstart init script installed to /etc/init/some-app.conf
  • A systemd unit file installed to /etc/systemd/system/some-app.service
  • A Unix user some-app
  • A Unix group some-app

Ex. 2

package.json:

{
  "name": "some-other-app",
  "version": "5.0.2",
  "node_deb": {
    "start_command": "/usr/bin/node --harmony index.js"
  }
}

cmd: node-deb -u foo -g bar -v 20150826 -- index.js lib/ node_modules/

You will get:

  • A Debian package named some-other-app_20150826_all.deb
    • Containing the file index.js and the directories lib and node_modules
    • Installed via
      • apt-get install some-other-app
      • apt-get install some-other-app=20150826

On install, you will get.

  • An executable named some-other-app
    • That starts the app with the command /usr/bin/node --harmony index.js
  • An upstart init script installed to /etc/init/some-other-app.conf
  • A systemd unit file installed to /etc/systemd/system/some-other-app.service
  • A Unix user foo
  • A Unix group bar

&c.

This project itself can be built by node-deb. Just run ./node-deb -- node-deb templates/.

More complete examples can be found by looking at test.sh and the corresponding projects in the test directory.

Requirements

  • dpkg
  • jq

These are both available through apt and brew.

Contributing

Please make all pull requests to the develop branch.

TODO

  • Untested with symlinks
  • Install via brew

node-deb's People

Contributors

heartsucker avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.