dynaconf

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2015 License: MIT Imports: 11 Imported by: 0

README

# dynaconf

dynaconf reads environment variables and generates configuration files from templates. Templates are expressed in the Go template format. See http://golang.org/pkg/text/template/ for more information.

## Installation

go get github.com/otm/dynaconf

## Build/Install

go install github.com/otm/dynaconf

## Usage

dynaconf [options] -template template:outfile\[:actions]

### Actions

Actions can be one of the following:

*	validate=json - validates output as JSON
*	exec=command - run command after the configuration is created

### Options

All options are optionally except for **template**

*	dry-run=false: Output result to stdout instead of files
*	log-files=false: Log files written to disk
*	param=[]: Parameters to use when generating configuration
*	template=[]: The template definition to use
*	version=false: Show version and exit

## Examples

### Render a template

```
dynaconf -template ./examples/cfg.template:/tmp/cfg.json -param name=john
```

### Render a template with additional environment variables

```
varsion="1.2.3" dynaconf -template ./examples/cfg.template:/tmp/cfg.json -param name=john
```

### Render a template and validate output

```
dynaconf -template ./examples/cfg.template:/tmp/cfg.json:validate=json -param name=john
```

### Render a template and run a command after

```
dynaconf -template ./examples/cfg.template:/tmp/cfg.json:exec="cat /tmp/cfg.json" -param name=john
```

### Render multiple templates at the same time

```
dynaconf -template ./examples/cfg.template:/tmp/cfg.json \
-template ./examples/cfg2.template:/tmp/cfg2.json \
-param name=john -param year=2015
```

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL