1 | apeman-infr
|
2 | ==========
|
3 |
|
4 |
|
5 | This file is generated by ape-tmpl. Do not update manually.
|
6 | --->
|
7 |
|
8 |
|
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 |
|
30 |
|
31 |
|
32 |
|
33 | <a name="description"></a>
|
34 |
|
35 | Infrastructure manager for apeman.
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 | <a name="overview"></a>
|
42 |
|
43 | apeman-infr command enables you to setup infrastructure using [docker](https://www.docker.com/)
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 | <a name="sections"></a>
|
52 |
|
53 |
|
54 |
|
55 | <a name="section-doc-guides-01-installation-md"></a>
|
56 | Installation
|
57 | -----
|
58 |
|
59 | Install 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 |
|
69 |
|
70 |
|
71 |
|
72 | <a name="section-doc-guides-02-usage-md"></a>
|
73 | Usage
|
74 | ---------
|
75 |
|
76 | 1. Prepare an Apemanfile.js at your project root.
|
77 | 2. Run the command via CLI.
|
78 |
|
79 | ***Apemanfile.js***
|
80 | ```javascript
|
81 | /** Example of Apemanfile.js */
|
82 |
|
83 | "use strict";
|
84 |
|
85 | module.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 |
|
100 | Then,
|
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 |
|
138 |
|
139 |
|
140 |
|
141 | <a name="section-doc-guides-03-programmatic-a-p-i-md"></a>
|
142 | Programmatic API
|
143 | ---
|
144 |
|
145 | apeman-infr also provide programmatic API.
|
146 |
|
147 | Firstly, install the module locally.
|
148 |
|
149 | ```bash
|
150 | $ npm install apeman-infr --save-dev
|
151 | ```
|
152 |
|
153 | Then,
|
154 |
|
155 | ```javascript
|
156 | "use strict";
|
157 |
|
158 | const apemanInfr = require('apeman-infr');
|
159 |
|
160 | apemanInfr({
|
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 |
|
181 |
|
182 |
|
183 |
|
184 |
|
185 |
|
186 |
|
187 | <a name="license"></a>
|
188 |
|
189 | License
|
190 | -------
|
191 | This software is released under the [MIT License](https://github.com/apeman-cmd-labo/apeman-infr/blob/master/LICENSE).
|
192 |
|
193 |
|
194 |
|
195 |
|
196 |
|
197 | <a name="links"></a>
|
198 |
|
199 | Links
|
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 |
|