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 |
|
5 | Mecano gather a set of functions usually used during system deployment.
|
6 | Documentation is available on the [project website][mecano].
|
7 |
|
8 | Functions 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
|
13 | action signature with options followed by callback; similar
|
14 | options properties; same callback signature with an
|
15 | error followed the number of affected actions.
|
16 | * Run one or multiple actions depending on option
|
17 | argument 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
|
24 | npm install mecano
|
25 | ```
|
26 |
|
27 | ## Test
|
28 |
|
29 | For 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
|
36 | npm test
|
37 | # or a subset
|
38 | npm run coffee && mocha test/api
|
39 | ```
|
40 |
|
41 | Some of the tests require a specific environment. You are encouraged to
|
42 | customize which tests you wish to run and to use docker container.
|
43 |
|
44 | To filter and configure your tests, you can either create a "test.coffee" at the
|
45 | root of this project or point the "MECANO_TEST" environment variable to such a
|
46 | file. You can use the file "test.coffee.sample" as a starting point.
|
47 |
|
48 | There are tests prepared to run on CentOS and Ubuntu using docker. Goto to one
|
49 | of the docker directory and run docker-compose, here's an example to run tests
|
50 | on CentOS:
|
51 |
|
52 | ```
|
53 | cd docker/centos7 # or centos6
|
54 | # Run all tests
|
55 | docker-compose up --abort-on-container-exit
|
56 | # Enter bash console
|
57 | docker-compose run --rm nodejs
|
58 | # Run a subset of the tests
|
59 | docker-compose run --rm nodejs test/core
|
60 | ```
|
61 |
|
62 | [mecano]: http://www.adaltas.com/projects/node-mecano/
|