Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
49 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/node_modules | ||
.* | ||
!.gitignore | ||
!.gitignore |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,29 @@ | ||
{ "name": "masson" | ||
, "version": "0.0.4" | ||
, "description": "Build system and targeted workflow" | ||
, "author": "David Worms <david@adaltas.com>" | ||
, "main": "./lib/masson" | ||
, "engines": { "node": ">= 0.1.90" } | ||
{ | ||
"name": "masson", | ||
"version": "0.0.5", | ||
"description": "Module execution engine for cluster deployments.", | ||
"homepage": "https://github.com/wdavidw/node-masson", | ||
"bugs": "https://github.com/wdavidw/node-masson/issues", | ||
"author": "David Worms <david@adaltas.com>", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/wdavidw/node-masson.git" | ||
}, | ||
"dependencies": { | ||
"each": "latest", | ||
"mecano": "latest", | ||
"pad": "latest", | ||
"parameters": "latest", | ||
"superexec": "latest", | ||
"ssh2": "latest" | ||
}, | ||
"devDependencies": { | ||
"coffee-script": "latest", | ||
"mocha": "latest", | ||
"should": "latest" | ||
}, | ||
"bin" : { | ||
"masson" : "./bin/masson" | ||
}, | ||
"main": "./lib" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,132 +1,32 @@ | ||
|
||
<pre> | ||
_ __ ___ __ _ ___ ___ ___ _ __ | ||
| '_ ` _ \ / _` / __/ __|/ _ \| '_ \ | ||
| | | | | | (_| \__ \__ \ (_) | | | | | ||
|_| |_| |_|\__,_|___/___/\___/|_| |_| New BSD License | ||
_ __ ___ __ _ ___ ___ ___ _ __ | ||
| '_ ` _ \ / _` / __/ __|/ _ \| '_ \ | ||
| | | | | | (_| \__ \__ \ (_) | | | | | ||
|_| |_| |_|\__,_|___/___/\___/|_| |_| New BSD License | ||
</pre> | ||
|
||
Masson is similar to tools like Make, Ant or Rake. It provides a simple workflow system where a target may be called along with others target it depends on. | ||
Masson is a configuration management and orchestration tools. It is here to | ||
simplify your life installing complex setup and maintaining dozens, hundreds, | ||
or even thousands of servers. | ||
|
||
Masson provide the following functionnalities: | ||
At [Adaltas], we use it to deploy full featured Hadoop Clusters. | ||
|
||
* fully asynch, call the out method when you done with a rule | ||
* evented by extending the Node EventEmitter | ||
* flexible by providing alternative configuration to feet your style | ||
* tested (using Expresso) | ||
* arguments transmission between targets | ||
|
||
Masson by example | ||
---------------- | ||
|
||
Choose your style.. | ||
|
||
#!/usr/bin/env node | ||
var masson = require('masson'); | ||
|
||
masson() | ||
.task( 'build', [ 'prepare', 'clean' ], function(){ | ||
this.out(); | ||
}) | ||
.task( 'prepare', function(){ | ||
this.out(); | ||
}) | ||
.task( 'clean', function(){ | ||
var self = this; | ||
setTimeout(function(){ | ||
/* do some cleaning */ | ||
self.out(); | ||
},1000); | ||
}) | ||
.run('build'); | ||
|
||
..could be rewritten (and mixed) as | ||
|
||
#!/usr/bin/env node | ||
var masson = require('masson'); | ||
|
||
masson([{ | ||
target: 'build', | ||
depends: [ 'prepare', 'clean' ], | ||
callback: function(){ | ||
this.out(); | ||
} | ||
},{ | ||
target: 'prepare', | ||
callback: function(){ | ||
/* do some setup */ | ||
this.out(); | ||
} | ||
},{ | ||
target: 'clean', | ||
callback: function(){ | ||
var self = this; | ||
setTimeout(function(){ | ||
/* do some cleaning */ | ||
self.out(); | ||
},1000); | ||
} | ||
}],'build'); | ||
|
||
..could be rewritten (and mixed) as | ||
|
||
#!/usr/bin/env node | ||
var masson = require('masson'); | ||
|
||
masson({ | ||
build : function(){ | ||
this.in([ 'prepare', 'clean' ],function(){ | ||
/* do something */ | ||
}); | ||
}, | ||
prepare : function(){ | ||
/* do some setup */ | ||
this.out(); | ||
}, | ||
clean : function(){ | ||
/* do some cleaning */ | ||
this.out(); } | ||
}).run('build'); | ||
|
||
Using Masson | ||
Installation | ||
------------ | ||
|
||
When you require Masson as `var masson = require('masson');`, you receive a function. Simply call it with the following arguments: | ||
|
||
* array or object configuration (see the two styles above) | ||
* optional target to execute (save the pain of calling `my_masson.run('my target')` | ||
* optional argument to pass to the executed target | ||
Run `npm install` to download the project dependencies. | ||
|
||
Listening to events | ||
------------------- | ||
Usage | ||
----- | ||
|
||
Masson extends Node EventEmitter class and emits 3 events: "before", "after" and "error". Not rocket science but if you want to look at its behavior, almost all the tests use it. | ||
The script `./bin/masson` is used to pilot the various command. Run it without | ||
any arguments to print the help page or as `./bin/big help {command}` to obtain | ||
help for a particular command. | ||
|
||
Passing arguments | ||
----------------- | ||
|
||
Arguments may be transfered from parent to dependencies and from dependencies to parent callbacks. | ||
|
||
The `in` method may receive an array of paramenters as a second argument, after the target(s). The same array will be available to all targets. The `out` method may also receive an array of parameter as its first argument and the parent will get as first parameter and error and for the following one as many parameter as there were child targets to call. I'm aware for not being clear but you can take a look at the test in `test/testArguments.js`. | ||
|
||
Running the tests | ||
----------------- | ||
|
||
Tests are executed with expresso. To install it, simple use `npm install expresso`. | ||
|
||
To run the tests | ||
expresso -I lib test/* | ||
|
||
To develop with the tests watching at your changes | ||
expresso -w -I lib test/* | ||
|
||
To instrument the tests | ||
expresso -I lib --cov test/* | ||
|
||
Related projects | ||
---------------- | ||
Contributors | ||
------------ | ||
|
||
* Matthew Eernisse "Node Jake": <http://github.com/mde/node-jake> | ||
* James Coglan's "Jake": <http://github.com/jcoglan/jake> | ||
* 280 North's Jake: <http://github.com/280north/jake> | ||
* David Worms: <https://github.com/wdavidw> | ||
|
||
[Adaltas]: http://www.adaltas.com |