Although the following installation instructions are for Mac OS X, similar alternate commands can be found for any Linux distribution.
Installing Golang environment
Install the latest version of Golang (at least v1.12 is required). For Mac OS, you may use Homebrew:
brew install golangFor other OSes, please check Go installation documentation.
Make sure to set your $GOPATH environment variable properly (conventionally, it points to $HOME/go).
For your convenience, you can add the bin directory of the $GOPATH to your $PATH: PATH=$PATH:$GOPATH/bin, but it is not mandatory.
In order to perform linting on the Go source code, please install Golint:
go get -u golang.org/x/lint/golintIn order to perform tests on the Go source code, please install Ginkgo and Gomega. Please make yourself familiar with both frameworks and read their introductions after installation:
go get -u github.com/onsi/ginkgo/ginkgo
go get -u github.com/onsi/gomegaWe use git as VCS which you would need to install.
On Mac OS run
brew install gitIn case you have to create a new release or a new hotfix, you have to push the resulting Docker image into a Docker registry. Currently, we use the Google Container Registry (this could change in the future). Please follow the official installation instructions from Google.
Currently there are no binary builds available, but it is fairly simple to build it by following the steps mentioned below.
-
First, you need to create a target folder structure before cloning and building
etcdbrctl.git clone https://github.com/gardener/etcd-backup-restore.git cd etcd-backup-restore -
To build the binary in local machine environment, use
maketargetbuild-local. It will build the binaryetcdbrctlunderbindirectory.make build-local
-
Next you can make it available to use as shell command by moving the executable to
/usr/local/bin, or by optionally including thebindirectory in your$PATHenvironment variable. You can verify the installation by running following command:$ etcdbrctl -v INFO[0000] etcd-backup-restore Version: v0.7.0-dev INFO[0000] Git SHA: 38979f0 INFO[0000] Go Version: go1.12 INFO[0000] Go OS/Arch: darwin/amd64