UNPKG

2.24 kBMarkdownView Raw
1[![Build Status](https://secure.travis-ci.org/wdavidw/node-mecano.png)](http://travis-ci.org/wdavidw/node-mecano)
2
3# Node.js Mecano
4
5Mecano gather a set of functions usually used during system deployment.
6Documentation is available on the [project website][mecano].
7
8Functions include "chmod", "chown", "copy", "download", "execute", "extract", "git", "ini", "krb5_ktadd", "krb5_addprinc", "krb5_delprinc", "ldap_acl", "ldap_index", "ldap_schema", "link", "mkdir", "move", "remove", "render", "service", "touch", "upload" and "file". They all share common usages and philosophies:
9
10* Run seamlessly both locally and remotely over SSH.
11* Each action report if it had an effect.
12* Common behavior and API between actions: same
13action signature with options followed by callback; similar
14options properties; same callback signature with an
15error followed the number of affected actions.
16* Run one or multiple actions depending on option
17argument being an object or an array of objects.
18* Optmized for ease of use and checking over performance.
19* Full test coverage.
20
21## Installation
22
23```bash
24npm install mecano
25```
26
27## Test
28
29For the tests to execute successfully, you must:
30
31* be online (attempt to fetch an ftp file)
32* be able to ssh yourself (eg `ssh $(whoami)@localhost`) without a password
33
34```bash
35# run all tests
36npm test
37# or a subset
38npm run coffee && mocha test/api
39```
40
41Some of the tests require a specific environment. You are encouraged to
42customize which tests you wish to run and to use docker container.
43
44To filter and configure your tests, you can either create a "test.coffee" at the
45root of this project or point the "MECANO_TEST" environment variable to such a
46file. You can use the file "test.coffee.sample" as a starting point.
47
48There are tests prepared to run on CentOS and Ubuntu using docker. Goto to one
49of the docker directory and run docker-compose, here's an example to run tests
50on CentOS:
51
52```
53cd docker/centos7 # or centos6
54# Run all tests
55docker-compose up --abort-on-container-exit
56# Enter bash console
57docker-compose run --rm nodejs
58# Run a subset of the tests
59docker-compose run --rm nodejs test/core
60```
61
62[mecano]: http://www.adaltas.com/projects/node-mecano/