Skip to content

BSick7/envoy

Repository files navigation

envoy

Inspired by https://github.com/kailunshi/consul-backup.

This utility helps manage consul.

Install

Using go get

If you have golang installed, you can use issue the following:

$ go get github.com/BSick7/envoy

Download

Alternatively, download the binary for your OS/Architecture from releases.

Build from source

$ mkdir -p $GOPATH/src/github.com/BSick7
$ cd $GOPATH/src/github.com/BSick7
$ git clone [email protected]:BSick7/envoy.git
$ cd envoy
$ make deps
$ make install

Docker

This utility can be built as a statically linked library that can be embedded in a FROM scratch docker image.

$ make docker-build
$ cp dist/envoy_docker destination

Alternatively, download the binary from releases.

Usage

$ go run main.go
usage: envoy [--version] [--help] <command> [<args>]

Available commands are:
    backup     Backup consul k/v store
    restore    Restores consul k/v store

Backup

$ envoy backup -http-address=127.0.0.1:8500 output.tar.gz
$ CONSUL_HTTP_ADDR=127.0.0.1:8500
$ envoy backup > output.tar.gz

Restore

$ envoy restore -http-address=127.0.0.1:8500 output.tar.gz
$ CONSUL_HTTP_ADDR=127.0.0.1:8500
$ cat output.tar.gz | envoy restore

Deploying to GitHub Releases

GITHUB_TOKEN environment variable must exist in CircleCI with public_repo and repo scope. Travis automates this, but we are using CircleCI.