lhotse

0.0.8 • Public • Published

lhotse

A simple single-server management tool that generates shell scripts from JavaScript.

The idea is currently simple: Define what you need on your server using pure JS, then generate a shell script from these definitions that easily can be uploaded and executed on the server so you don't have to manually edit files. Think of it as a really dumb Puppet.

├── files
├── scripts
│   ├── git.sh
│   ├── nginx.sh
│   └── nodejs.sh
├── servername.js
└── templates
    └── nginx
        └── express.conf

Example

var server = module.exports = require('lhotse')();

// Copy files/bashrc to the server
// The second argument can be either a string or a function returning a string.
server.use(file('/home/deployer/.bashrc', server.template('files/bashrc')));

See the example/ folder for a more thorough example.

After you have created a server definition file anything-you-like.js, it can be compiled to shell script by running:

$ lhotse anything-you-like.js

Templates

The file(str, content) function can be passed a function as the second argument. This may for instance be the return value of a call to template(str, opts), which runs the contents of the given string through ejs passing it opts. The str is a file assumed to reside in the templates/ folder.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i lhotse

Weekly Downloads

7

Version

0.0.8

License

MIT

Last publish

Collaborators

  • hkkoren