a Go docker-compose multi-stages deployer.
Use case example here.
To build it, use go get
and gopm
for dependencies :
$ go get -d github.com/valentin2105/deployer
$ go get -u github.com/gpmgo/gopm
$ cd $GOPATH/src/github.com/valentin2105/deployer && $GOPATH/bin/gopm get
$ cd $GOPATH/src/github.com/valentin2105/deployer && $GOPATH/bin/gopm get
$ go build && ./deployer -h
{
“config”:
{
“WpImage”: “wordpress:latest”,
“DBImage”: “mysql:latest”,
“NginxImage”: “nginx:latest”
},
“dev”:
{
“Tag”: “dev”,
“Vhost”: “dev.example.com”,
"DBPassword": "AnyGoodPassword",
"DBName": "mydevsite",
"ExpositionPort": "8001:80"
},
“prod”:
{
“Tag”: “integration”,
“Vhost”: “integration.example.com”,
"DBPassword": "AnyBetterPassword",
"DBName": "myprodsite",
"IPv6Network": "ff00:c210::/64",
"IPv6": "ff00:c210::121"
}
}
version: '2'
services:
wordpress:
image: {{.config_WpImage}}
ports:
- {{.dev_ExpositionPort}}
volumes:
- /var/www/html
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_NAME: {{.dev_DBName}}
WORDPRESS_DB_USER: root
WORDPRESS_DB_PASSWORD: {{.dev_DBPassword}}
depends_on:
- db
links:
- db
db:
image: {{.config_DBImage}}
volumes:
- /var/lib/mysql
environment:
MYSQL_DATABASE: {{.dev_DBName}}
MYSQL_ROOT_PASSWORD: {{.dev_DBPassword}}
deployer add dev
NAME:
deployer
USAGE:
deployer [global options] command [command options] [arguments...]
VERSION:
0.1.5
AUTHOR:
Valentin Ouvrard
COMMANDS:
deploy
delete
list
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--help, -h show help
--version, -v print the version
- Fork (https://github.com/valentin2105/deployer/fork)
- Create a feature branch
- Commit your changes
- Rebase your local changes against the master branch
- Run test suite with the
go test ./...
command and confirm that it passes - Run
gofmt -s
- Create a new Pull Request