oast
v0.3.0
Published
Build containers, for fuge
Downloads
12
Readme
oast
Build a container-based system for production, a companion for fuge. Based on Docker.
If you're using this module, and need help, you can:
- Post a github issue,
- Ask on the Gitter.
Install
npm i oast -g
Usage
From oast --help
:
usage: oast [opts] compose.yml
available options:
-o [FILE], --output [FILE] write the system to the given file
-r [REPO], --repo [REPO] base URL for the registry repository to
push images to
-h, --help this message
Example
(from the root of this repository)
oast -o out.sys fixture/fuge/compose-dev.yml --repo localhost:5000/fixture
It writes the system definition into out.sys
, and pushes those images
to a local registry.
Labels
It adds an image label to each built image, in the form of:
LABEL oast.commit=48ed274cc32020b3837c8e59c10033480376208c
LABEL oast.id=service1
API
oast can be used as a module as well.
oast(yml, stream[, opts], cb(err, sys))
Build the given yml
file, and prints all output to stream
.
If stream
is a TTY (e.g. stdout or stderr), docker's progress bars
will be showed.
Available options (in opts
):
repo
: the Docker repository we will push images to
Example sys
passed to cb
:
{
"name": "xeno",
"id": "123456",
"containerDefinitions": [
{
"specific": {
"type": "process",
"proxyPort": [
"auto"
],
"servicePort": [
"auto"
],
"buildScript": "cd api && npm install; ",
"execute": {
"exec": "node api/index.js",
"environment": [],
"process": "node api/index.js"
},
"commit": "48ed274cc32020b3837c8e59c10033480376208c",
"imageId": "2d76b9cf495552ce86251182df05db83305f07f084a146bb47981f9154e84a78"
},
"type": "docker",
"id": "frontend",
"name": "frontend"
},
{
"specific": {
"type": "process",
"proxyPort": [
"auto"
],
"servicePort": [
"auto"
],
"buildScript": "npm install; ",
"execute": {
"exec": "node service.js",
"environment": [],
"process": "node service.js"
},
"commit": "48ed274cc32020b3837c8e59c10033480376208c",
"imageId": "0e3c13c2c2d9beb540dc09aa9abe5ebffa781d7f94e91d97723a08d188ed6cd4"
},
"type": "docker",
"id": "service1",
"name": "service1"
},
{
"specific": {
"type": "process",
"proxyPort": [
"auto"
],
"servicePort": [
"auto"
],
"buildScript": "npm install; ",
"execute": {
"exec": "node service.js",
"environment": [],
"process": "node service.js"
},
"commit": "48ed274cc32020b3837c8e59c10033480376208c",
"imageId": "0b081fe361bd98a583ac0e76e954a4662b77340ac1aed17708c19f731b77ec3d"
},
"type": "docker",
"id": "service2",
"name": "service2"
}
]
}
Contributing
The apparatus team encourage open participation. If you feel you can help in any way, be it with documentation, examples, extra testing, or new features please get in touch.
License
Copyright the apparatus team 2016, Licensed under MIT.