Deprecated. Now with Docker-Compose, there is little reason for gobox.

# gobox: Golang Process Boxer

gobox manages your microservices for testing and production scenarios.

## Motivation

**You**...
- ...are building a large application with a service-oriented design.
- ...have a variety of services that need to be running in order to execute integration tests.
- ...really like docker, but due to frequent updates to your service layer, don't like the idea of having to constantly rebuild images.

With gobox, you can define a set of processes *and* specify run commands that are to be used in `test` and `production` scenarios. Further, you can define the environment for each scenario at both the process- and global-level.

## Installation

Use the Go tool:

```
go get github.com/tristanwietsma/gobox
```

## Usage

```bash
$ gobox -h
Usage of gobox:
  -config=".gobox.toml": path to gobox config file
  -prod=false: run in production mode
```

### Define a configuration file

By default, gobox will look for a `.gobox.toml` file in the current working directory. Alternatively, you can specify the file location.

### Define global environment settings

You can specify environment settings for both production and testing using the `prodenviron` and `testenviron` parameters.

```
prodenviron = ["VAR1=VAL1", "VAR2=VAL2"]
testenviron = ["VAR1=X", "VAR2=Z"]
```

### Define each processes

For each process, define a `proc` block in the toml file. A `proc` definition looks like this:

```
[[proc]]
name = "name of the process"
priority = 1
prodcommand = "shell command for production use"
prodenviron = ["NAME=prod1"]
testcommand = "shell command for test use"
testenviron = ["NAME=test1"]
```

#### Name

`name` is purely for logging purposes.

#### Priority

`priority` is an integer the defines the order in which the process should be started relative to other processes in the configuration. Lower numbers have higher priority.

### Running Test Mode

Test mode is the default. Assuming the config file is `.gobox.toml` in the current directory,

```bash
$ gobox
```

### Running Production Mode

```bash
$ gobox -prod=true
```

### Stopping

gobox listens for kill signals and shuts down processes before exiting.
