surok/docs/App-config-file.md

31 lines
1011 B
Markdown
Raw Permalink Normal View History

2017-01-12 13:11:01 +03:00
# Surok app config file
2017-01-12 12:43:30 +03:00
conf.d/myapp.json
```
{
"services": [
{
"name": "myapp",
"group": "backend.production",
"ports": ["proxy", "api"]
},
{
"name": "nginx",
"group": "frontend.production"
}
],
"conf_name": "myapp_backend_production",
"template": "/etc/surok/templates/myapp.jj2",
"dest": "/etc/myapp/myapp.cfg",
"reload_cmd": "killall -9 myapp; /usr/local/bin/myapp -config /etc/myapp/myapp.cfg"
}
```
* **services**. List of hashes with required services for app.
1. _name_ - string. App name in Marathon.
2. _group_ - string. App group in Marathon. Optional. Discovery policy: 1) config 2) SUROK_DISCOVERY_GROUP environment variable 3) Marathon API
3. _ports_ - list. Name of opened port. In marathon of course. Optional.
* **conf_name**. Unique app config name.
* **template**. Jinja2 template location.
* **dest**. Destination config path.
2017-01-12 13:11:01 +03:00
* **reload_cmd**. Command to execute if generated config is changed.