Composer is CLI software for managing processes in development environment.
- Golang 1.6.x/1.7.x
- Download it from releases page.
- Install Go 1.6 or 1.7
- Install Glide dependency manager
GO15VENDOREXPERIMENT=1 go get -u github.com/Masterminds/glide
- Clone this project
git clone https://github.com/mdouchement/composer
- Fetch dependencies
glide install
- Build the binary
go build -o composer *.go
- Install the compiled binary
mv composer /usr/bin/composer
$ composer start -c ~/server-stack.yml
- Basic
services:
risuto:
pwd: $GOPATH/src/github.com/mdouchement/risuto
command: go run risuto.go -p 5000 -b localhost
environment:
RISUTO_DATABASE: /tmp/data/tiedot_db
breizhtrip:
pwd: $GOPATH/src/github.com/mdouchement/breizhtrip-go
command: go run breizhtrip.go -p 5005 -b localhost
machinery:
pwd: $GOPATH/src/github.com/mdouchement/machnery-app
command: go run app.go worker -c 5
- Full options
settings:
logger:
buffer_size: 142 # Queue size of entries to be logged.
entry_max_size: 865536 # Max length of an entry message. Default 65536 bytes.
services:
ggpull:
pwd: /home/$USER/myapp
command: git pull
app:
hooks:
wait:
- ggpull
pwd: /home/$USER/myapp
command: bundle exec rails s
log_trim_pattern: '\[.*\] \w+ (?P<message>.*)'
environment:
RAILS_ENV: production
worker:
hooks:
wait: # wait for other processes before start
- ggpull
kill: # kill other processes on exit
- app
pwd: /home/$USER/myapp
command: bundle exec sidekiq -c config/sidekiq.yml
Outputed logs can be trimed to remove useless data like timestamp. This option is based on the Golang's regexp package and you can test your regexp with the following website Regex Tester - Golang.
The captured group must be named message
like the following example:
log_trim_pattern: '\[.*\] \w+ (?P<message>.*)'
The result is the following:
# Without trim:
[Feb 13 10:38:09] INFO my_app: [2017-02-13 10:38:09] INFO WEBrick 1.3.1
# With trim:
[Feb 13 10:38:09] INFO my_app: WEBrick 1.3.1
# When the trim regexp does not match, the message is prefixed with `[!]`
[Feb 13 10:38:09] INFO my_app: [!] => Booting WEBrick
MIT
- Fork it
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request