kabook
Examples and recipes for kaboot.
Examples
Require kaboot and kaboots
var k = ; k;
Define a function to install node.js on a local or remote machine.
var { return 'Install node.js' host: host key: key path: '/tmp' 'Download nodejs setup script' krun 'wget https://deb.nodesource.com/setup' 'Execute nodejs setup script' krun '/bin/bash setup' 'Remove setup script' krun 'rm setup' 'Install node.js package' kdebianinstall 'nodejs' 'Install forever' krun 'npm install forever -g' ; }
Define a function to deploy a node.js app to a remote repo.
var { return 'Deploy app' 'tar the repo' kunixtar compress: '.' to: '/tmp/app.tar.gz' 'scp the repo' kunixscp from: '/tmp/app.tar.gz' to: host: host key: key path: '/tmp' host: host key: key path: '/root/app' 'Remove files from folder' krun 'rm /root/app/* -r' 'Untar the repo' kunixtar extract: '/tmp/app.tar.gz' to: '/root/app' 'Stop application' krun 'forever stopall' 'Install packages' krun 'npm install' 'run the app' krun 'forever start server.js' 'Remove tar' krun 'rm /tmp/app.tar.gz' 'remove local tar' krun 'rm /tmp/app.tar.gz' ; }
Place the trigger, so that the script can be used like this:
node example install HOST_IP KEY
node example deploy HOST_IP KEY
(In both cases, the KEY
is optional).
k;
Installation
npm install kabook
Besides core kaboot, this library also depends on kaboot's standard library.
Intrigued? Here's your hard hat!
Kaboot is undergoing a radical rewrite. While its main concepts and structures are firmly in place, large sections of core functionality are still being worked out.
If you are at all interested by what you've seen so far, I would love to hear your suggestions and requests: my email is fpereiro@gmail.com
License
Kaboot is written by Federico Pereiro (fpereiro@gmail.com) and released into the public domain.