Skip to content

Latest commit

 

History

History
76 lines (49 loc) · 2.73 KB

local_setup.md

File metadata and controls

76 lines (49 loc) · 2.73 KB

Prerequisites

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 golang

For 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/golint

In 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/gomega

Installing git

We use git as VCS which you would need to install.

On Mac OS run

brew install git

Installing gcloud SDK (Optional)

In 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.

Build

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 make target build-local. It will build the binary etcdbrctl under bin directory.

    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 the bin directory in your $PATH environment 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