apeman-infr
Infrastructure manager for apeman.
apeman-infr command enables you to setup infrastructure using docker
Installation
Install apeman-infr module via npm.
$ npm install apeman-infr -g
Usage
- Prepare an Apemanfile.js at your project root.
- Run the command via CLI.
Apemanfile.js
/** Example of Apemanfile.js */
'use strict'
module.exports = {
$cwd: __dirname,
$pkg: { /* ... */ },
$proto: [ /* ... */ ],
$tmpls: { /* ... */ },
$tasks: { /* ... */ },
$apps: { /* ... */ },
$wtchs: { /* ... */ },
$infrs: {
'my-node-01': './infra/node/Dockerfile' // Path infra docker path.
}
}
Then,
$ apeman-infr
CLI Options
$ apeman-infr -h
Usage: apeman-infr [options] [name...]
Setup infra.
Options:
-h, --help output usage information
-V, --version output the version number
-v, --verbose Show verbose logs
-f, --force Force to remove image.
-r, --rebuild Delete and build infra again.
-d, --delete Remove image.
-c, --configuration <configuration> Pathname of Apemanfile
-l, --list List available watches
Examples:
$ apeman-infr # Build all infra defined in $infrs prop.
$ apeman-infr -l # List available infra.
$ apeman-infr "node*" # Build infra which match pattern.
$ apeman-infr -d # Remove all infra defined in $infrs prop.
Programmatic API
apeman-infr also provide programmatic API.
Firstly, install the module locally.
$ npm install apeman-infr --save-dev
Then,
'use strict'
const apemanInfr = require('apeman-infr')
apemanInfr({
pattern: 'my-node-01',
force: false
}).then(() => {
/* ... */
})
Programmatic Options
Key | Description | Default |
---|---|---|
verbose | Show verbose logs | |
force | Force to remove image. | |
rebuild | Delete and build infra again. | |
delete | Remove image. | |
configuration | Pathname of Apemanfile | |
list | List available watches |
License
This software is released under the MIT License.