UNPKG

4.91 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 Setup infra.
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 -r, --rebuild Delete and build infra again.
123 -d, --delete Remove image.
124 -c, --configuration <configuration> Pathname of Apemanfile
125 -l, --list List available watches
126
127 Examples:
128
129 $ apeman-infr # Build all infra defined in $infrs prop.
130 $ apeman-infr -l # List available infra.
131 $ apeman-infr "node*" # Build infra which match pattern.
132 $ apeman-infr -d # Remove all infra defined in $infrs prop.
133
134
135```
136
137
138<!-- Section from "doc/guides/02.Usage.md.hbs" End -->
139
140<!-- Section from "doc/guides/03.Programmatic API.md.hbs" Start -->
141
142<a name="section-doc-guides-03-programmatic-a-p-i-md"></a>
143Programmatic API
144---
145
146apeman-infr also provide programmatic API.
147
148Firstly, install the module locally.
149
150```bash
151$ npm install apeman-infr --save-dev
152```
153
154Then,
155
156```javascript
157"use strict";
158
159const apemanInfr = require('apeman-infr');
160
161apemanInfr({
162 pattern: 'my-node-01',
163 force: false
164}, (err) => {
165 /*...*/
166});
167```
168
169
170##### Programmatic Options
171
172| Key | Description | Default |
173| --- | ----------- | ------- |
174| verbose | Show verbose logs | |
175| force | Force to remove image. | |
176| rebuild | Delete and build infra again. | |
177| delete | Remove image. | |
178| configuration | Pathname of Apemanfile | |
179| list | List available watches | |
180
181
182<!-- Section from "doc/guides/03.Programmatic API.md.hbs" End -->
183
184
185<!-- Sections Start -->
186
187
188<!-- LICENSE Start -->
189<a name="license"></a>
190
191License
192-------
193This software is released under the [MIT License](https://github.com/apeman-cmd-labo/apeman-infr/blob/master/LICENSE).
194
195<!-- LICENSE End -->
196
197
198<!-- Links Start -->
199<a name="links"></a>
200
201Links
202------
203
204+ [apeman](http://github.com/apeman-labo/apeman)
205+ [apeman-cmd-labo](http://github.com/apeman-cmd-labo)
206+ [docker](https://www.docker.com/)
207
208<!-- Links End -->