Skip to content

Commit

Permalink
Add README for templates
Browse files Browse the repository at this point in the history
  • Loading branch information
justenwalker committed Dec 15, 2015
1 parent 09eb701 commit d623aa3
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The format of the JSON file configuration is as follows:
```json
{
"consul": "consul:8500",
"onStart": "/opt/containerbuddy/onStart-script.sh",
"onStart": "/opt/containerbuddy/onStart-script.sh {{.ENV_VAR_NAME}}",
"stopTimeout": 5,
"preStop": "/opt/containerbuddy/preStop-script.sh",
"postStop": "/opt/containerbuddy/postStop-script.sh",
Expand Down Expand Up @@ -126,6 +126,22 @@ All executable fields, such as `onStart` and `onChange`, accept both a string or
]
```

### Template Configuration

Containerbuddy configuration has template support, such as substituting environment variables in the config file. This makes it possible to use the same configuration and alter the behavior per environment. Full documentation about the template language used can be found in the [Go text/template Docs](https://golang.org/pkg/text/template/).

**Example**

```json
{
"consul": "consul:8500",
"onStart": "/opt/containerbuddy/onStart-script.sh {{.URL_TO_SERVICE}} {{.API_KEY}}",

...

}
```

### Operating Containerbuddy

Containerbuddy accepts POSIX signals to change its runtime behavior. Currently, Containerbuddy accepts the following signals:
Expand Down

0 comments on commit d623aa3

Please sign in to comment.