UNPKG

4.82 kBMarkdownView Raw
1apeman-infr
2==========
3
4<!---
5This file is generated by ape-tmpl. Do not update manually.
6--->
7
8<!-- Badge Start -->
9<a name="badges"></a>
10
11[![Build Status][bd_travis_shield_url]][bd_travis_url]
12[![Code Climate][bd_codeclimate_shield_url]][bd_codeclimate_url]
13[![Code Coverage][bd_codeclimate_coverage_shield_url]][bd_codeclimate_url]
14[![npm Version][bd_npm_shield_url]][bd_npm_url]
15
16[bd_repo_url]: https://github.com/apeman-cmd-labo/apeman-infr
17[bd_travis_url]: http://travis-ci.org/apeman-cmd-labo/apeman-infr
18[bd_travis_shield_url]: http://img.shields.io/travis/apeman-cmd-labo/apeman-infr.svg?style=flat
19[bd_license_url]: https://github.com/apeman-cmd-labo/apeman-infr/blob/master/LICENSE
20[bd_codeclimate_url]: http://codeclimate.com/github/apeman-cmd-labo/apeman-infr
21[bd_codeclimate_shield_url]: http://img.shields.io/codeclimate/github/apeman-cmd-labo/apeman-infr.svg?style=flat
22[bd_codeclimate_coverage_shield_url]: http://img.shields.io/codeclimate/coverage/github/apeman-cmd-labo/apeman-infr.svg?style=flat
23[bd_gemnasium_url]: https://gemnasium.com/apeman-cmd-labo/apeman-infr
24[bd_gemnasium_shield_url]: https://gemnasium.com/apeman-cmd-labo/apeman-infr.svg
25[bd_npm_url]: http://www.npmjs.org/package/apeman-infr
26[bd_npm_shield_url]: http://img.shields.io/npm/v/apeman-infr.svg?style=flat
27[bd_bower_badge_url]: https://img.shields.io/bower/v/apeman-infr.svg?style=flat
28
29<!-- Badge End -->
30
31
32<!-- Description Start -->
33<a name="description"></a>
34
35Infrastructure manager for apeman.
36
37<!-- Description End -->
38
39
40<!-- Overview Start -->
41<a name="overview"></a>
42
43apeman-infr command enables you to setup infrastructure using [docker](https://www.docker.com/)
44
45
46
47<!-- Overview End -->
48
49
50<!-- Sections Start -->
51<a name="sections"></a>
52
53<!-- Section from "doc/guides/01.Installation.md.hbs" Start -->
54
55<a name="section-doc-guides-01-installation-md"></a>
56Installation
57-----
58
59Install apeman-infr module via [npm][npm_url].
60```bash
61$ npm install apeman-infr -g
62```
63
64
65[npm_url]: https://www.npmjs.com/
66
67
68<!-- Section from "doc/guides/01.Installation.md.hbs" End -->
69
70<!-- Section from "doc/guides/02.Usage.md.hbs" Start -->
71
72<a name="section-doc-guides-02-usage-md"></a>
73Usage
74---------
75
761. Prepare an Apemanfile.js at your project root.
772. Run the command via CLI.
78
79***Apemanfile.js***
80```javascript
81/** Example of Apemanfile.js */
82
83"use strict";
84
85module.exports = {
86 $cwd: __dirname,
87 $pkg: {/*...*/},
88 $proto: [/*...*/],
89 $tmpls: {/*...*/},
90 $tasks: {/*...*/},
91 $apps: {/*...*/},
92 $wtchs: {/*...*/},
93 $infrs: {
94 'my-node-01': './infra/node/Dockerfile' // Path infra docker path.
95 }
96};
97
98```
99
100Then,
101
102```bash
103$ apeman-infr
104```
105
106
107##### CLI Options
108
109```bash
110$ apeman-infr -h
111
112 Usage: apeman-infr [options] [name...]
113
114 Infrastructure manager for apeman.
115
116 Options:
117
118 -h, --help output usage information
119 -V, --version output the version number
120 -v, --verbose Show verbose logs
121 -f, --force Force to remove image.
122 -d, --delete Remove image.
123 -c, --configuration <configuration> Pathname of Apemanfile
124 -l, --list List available watches
125
126 Examples:
127
128 $ apeman-infr # Build all infra defined in $infrs prop.
129 $ apeman-infr -l # List available infra.
130 $ apeman-infr "node*" # Build infra which match pattern.
131 $ apeman-infr -d # Remove all infra defined in $infrs prop.
132
133
134```
135
136
137<!-- Section from "doc/guides/02.Usage.md.hbs" End -->
138
139<!-- Section from "doc/guides/03.Programmatic API.md.hbs" Start -->
140
141<a name="section-doc-guides-03-programmatic-a-p-i-md"></a>
142Programmatic API
143---
144
145apeman-infr also provide programmatic API.
146
147Firstly, install the module locally.
148
149```bash
150$ npm install apeman-infr --save-dev
151```
152
153Then,
154
155```javascript
156"use strict";
157
158const apemanInfr = require('apeman-infr');
159
160apemanInfr({
161 pattern: 'my-node-01',
162 force: false
163}, (err) => {
164 /*...*/
165});
166```
167
168
169##### Programmatic Options
170
171| Key | Description | Default |
172| --- | ----------- | ------- |
173| verbose | Show verbose logs | |
174| force | Force to remove image. | |
175| delete | Remove image. | |
176| configuration | Pathname of Apemanfile | |
177| list | List available watches | |
178
179
180<!-- Section from "doc/guides/03.Programmatic API.md.hbs" End -->
181
182
183<!-- Sections Start -->
184
185
186<!-- LICENSE Start -->
187<a name="license"></a>
188
189License
190-------
191This software is released under the [MIT License](https://github.com/apeman-cmd-labo/apeman-infr/blob/master/LICENSE).
192
193<!-- LICENSE End -->
194
195
196<!-- Links Start -->
197<a name="links"></a>
198
199Links
200------
201
202+ [apeman](http://github.com/apeman-labo/apeman)
203+ [apeman-cmd-labo](http://github.com/apeman-cmd-labo)
204+ [docker](https://www.docker.com/)
205
206<!-- Links End -->