docker-farmer

command module
v0.0.0-...-073ac79 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: MIT Imports: 10 Imported by: 0

README

docker-farmer

Custom tool to remove docker containers and databases from services based on domain names.

Config

Example configuration:

{
    "domain": "test.example.com",
    "docker": {
        "host": "unix:///var/run/docker.sock",
        "version": "v1.22"
    },
    "database": {
        "prefix": "ab_",
        "container": "name or id",
        "type": "mysql"
    },
    "listen": ":80",
    "containers": {
        "exclude": ["redis"]
    },
    "title": "Farmer"
}
  • Docker host is not required. Default is unix:///var/run/docker.sock
  • Docker version is not required. Default is empty string.

Supported Services

  • Bitbucket (should be pull request webhook)
  • GitHub (should be a pull request webhook)
  • GitLab (should be a merge request webhook or push events webhook)
  • JIRA (should be a webhook when a issue is updated)

Database

The database name should be a md5 hash of the domain for the container with the database prefix.

md5 <<<"abc-123.test.example.com"
5d4f0978db52bd0e588bef9cef98715f

Gives us

ab_5d4f0978db52bd0e588bef9cef98715f

Run in Docker

docker build -t farmer .
docker run -i -t -d -e VIRTUAL_HOST=test.example.com -v /var/run/docker.sock:/var/run/docker.sock:ro farmer

License

MIT © Isotop

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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