This document explains how to setup your dev environment.
We use dep to manage dependency. Install dependency if you haven't:
./hack/update_vendor.sh
Requirement:
- Go 1.10+
Build in project root dir:
./hack/build/operator/build
./hack/build/backup-operator/build
./hack/build/restore-operator/build
For convenience and easy of building, a Dockerfile has been provided to create an etcd-operator-builder image. This image contains a fully configured go envrionment used for fetching dependencies and building the different etcd-operator binaries.
To build the etcd-operator-builder image, you first need to have docker installed.
Once installed, set the IMAGE environment variable to the desired name:
export IMAGE=etcd-operator-builder
Now, run the build script to generate the etcd-operator-builder:
./hack/build/e2e/builder/build
Once completed, the etcd-operator-builder:latest image should be available for use.
Updating dependencies using this image can be performed by running the ci get_dep script:
./hack/ci/get_dep
Then build the project using the image:
./hack/build/build
Finally, build the etcd-operator image:
export IMAGE=etcd-operator
docker build --tag "${IMAGE}" -f hack/build/Dockerfile . 1>/dev/null