Glusterd2 is written in Go and if you are new to the language, it is highly encouraged to:
- Take the A Tour of Go course.
- Set up Go development environment on your machine.
- Read Effective Go for best practices.
- Download Go (>=1.8) and install it on your system.
- Setup the GOPATH environment.
- Run
$ go get -d github.com/gluster/glusterd2
This will just download the source and not build it. The downloaded source will be at$GOPATH/src/github.com/gluster/glusterd2
- Fork the glusterd2 repo on Github.
- Add your fork as a git remote:
$ git remote add fork https://github.com/<your-github-username>/glusterd2
- Run
$ ./scripts/install-reqs.sh
Editors: Our favorite editor is vim with the vim-go plugin, but there are many others like vscode.
To build Glusterd2 run:
$ make
The built binary will be present under build/
directory.
or to install run:
$ make install
The built binary will be installed under $GOPATH/bin/
directory.
Glusterd2 repository currently follows GitHub's Fork & Pull workflow for code contributions.
Please read the coding guidelines document before submitting a PR.
Here is a short guide on how to work on a new patch. In this example, we will work on a patch called hellopatch:
$ git checkout master
$ git pull
$ git checkout -b hellopatch
Do your work here and commit. You will need to provide unit tests and functional tests for your changes wherever applicable. Ensure that the tests pass with your changes:
# make test
Once you are ready to push, you will type the following:
$ git push fork hellopatch
Creating A Pull Request:
When you are satisfied with your changes, you will then need to go to your repo in GitHub.com and create a pull request for your branch. Automated tests will be run against the pull request. Your pull request will be reviewed and merged.