mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
updated developers guide
This commit is contained in:
parent
0a42a82df5
commit
0464e2f8cc
@ -1,92 +1,50 @@
|
|||||||
### Build Dependencies
|
### Build Dependencies
|
||||||
|
This installation document assumes Ubuntu 12.04 or later on x86-64.
|
||||||
|
|
||||||
Minio build depends on ``yasm`` and Go 1.3+
|
##### Install YASM
|
||||||
|
|
||||||
##### Install yasm
|
|
||||||
|
|
||||||
Yasm is a Modular Assembler used for compiling [Intel Storage Acceleration Library](https://01.org/intel%C2%AE-storage-acceleration-library-open-source-version)
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ sudo apt-get install yasm
|
$ sudo apt-get install yasm
|
||||||
```
|
```
|
||||||
##### Install Go 1.3+ (Ubuntu)
|
|
||||||
|
|
||||||
[Download the archive](https://golang.org/dl/) and extract it into ``${HOME}/local``, creating a Go tree in ``${HOME}/local/go``. For example:
|
##### Install Go 1.3+
|
||||||
|
Download Go 1.3+ from [https://golang.org/dl/](https://golang.org/dl/) and extract it into ``${HOME}/local`` and setup ``${HOME}/mygo`` as your project workspace folder.
|
||||||
|
For example:
|
||||||
```sh
|
```sh
|
||||||
|
$ wget https://storage.googleapis.com/golang/go1.3.3.linux-amd64.tar.gz
|
||||||
$ mkdir -p ${HOME}/local
|
$ mkdir -p ${HOME}/local
|
||||||
$ tar -C ${HOME}/local -xzf go$VERSION.$OS-$ARCH.tar.gz
|
$ tar -C ${HOME}/local -xzf go1.3.3.linux-amd64.tar.gz
|
||||||
```
|
|
||||||
|
|
||||||
Choose the archive file appropriate for your installation. For instance, if you are installing Go version 1.2.1 for 64-bit x86 on Linux, the archive you want is called ``go1.2.1.linux-amd64.tar.gz``
|
|
||||||
|
|
||||||
(Typically these commands must be run as root or through sudo.)
|
|
||||||
|
|
||||||
Add ``${HOME}/local/go/bin`` to the ``PATH`` environment variable. You can do this by adding this line to your ``$HOME/.profile``:
|
|
||||||
```sh
|
|
||||||
$ export PATH=$PATH:${HOME}/local/go/bin
|
$ export PATH=$PATH:${HOME}/local/go/bin
|
||||||
```
|
|
||||||
|
|
||||||
##### Setting up ``GOPATH`` environment variable
|
|
||||||
|
|
||||||
The ``GOPATH`` environment variable specifies the location of your workspace. It is likely the only environment variable you'll need to set when developing Go code.
|
|
||||||
|
|
||||||
To get started, create a workspace directory and set GOPATH accordingly. Your workspace can be located wherever you like, but we'll use ``$HOME/mygo`` in this document. Note that this must not be the same path as your Go installation.
|
|
||||||
```sh
|
|
||||||
$ mkdir -p $HOME/mygo
|
$ mkdir -p $HOME/mygo
|
||||||
$ export GOPATH=$HOME/mygo
|
$ export GOPATH=$HOME/mygo
|
||||||
```
|
|
||||||
|
|
||||||
For convenience, add the workspace's bin subdirectory to your ``PATH``:
|
|
||||||
```sh
|
|
||||||
$ export PATH=$PATH:$GOPATH/bin
|
$ export PATH=$PATH:$GOPATH/bin
|
||||||
```
|
```
|
||||||
|
|
||||||
For more detailed documentation refer [GOPATH](http://golang.org/doc/code.html#GOPATH)
|
### Setup your Minio Github Repository <iframe src="http://ghbtns.com/github-btn.html?user=Minio-io&repo=minio&type=fork&count=true&size=large" height="30" width="170" frameborder="0" scrolling="0" style="width:170px; height: 30px;" allowTransparency="true"></iframe>
|
||||||
|
Fork [Minio upstream](https://github.com/Minio-io/minio) source repository to your own personal repository. Copy the URL and pass it to ``go get`` command. Go uses git to clone a copy into your project workspace folder.
|
||||||
### Installing Minio (Source)
|
|
||||||
|
|
||||||
#### Get directly from GitHub:
|
|
||||||
|
|
||||||
Once we are finished the prerequisites in the previous step we now build minio
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ go get -u github.com/minio-io/minio
|
$ go get -u github.com/$USER_ID/minio
|
||||||
$ cd $GOPATH/src/github.com/minio-io/minio
|
$ cd $GOPATH/src/github.com/$USER_ID/minio/
|
||||||
|
$ git remote add upstream https://github.com/Minio-io/minio.git
|
||||||
|
```
|
||||||
|
|
||||||
|
### Compiling Minio from source
|
||||||
|
Minio use plain Makefile to wrap around some of the limitations of ``go build``. To compile Minio source, simply change to your workspace folder and type ``make``.
|
||||||
|
```sh
|
||||||
|
$ cd $GOPATH/src/github.com/$USER_ID/minio/
|
||||||
$ make
|
$ make
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Clone locally (for contributors):
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ git clone https://github.com/minio-io/minio
|
|
||||||
$ cd minio
|
|
||||||
$ make
|
|
||||||
```
|
|
||||||
|
|
||||||
Because Go expects all of your libraries to be found in either $GOROOT or $GOPATH, it's necessary to symlink the project to the following path:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ ln -s /path/to/your/minio $GOPATH/src/github.com/minio-io/minio
|
|
||||||
```
|
|
||||||
|
|
||||||
### Contribution Guidelines
|
### Contribution Guidelines
|
||||||
|
|
||||||
We welcome your contributions. To make the process as seamless as possible, we ask for the following:
|
We welcome your contributions. To make the process as seamless as possible, we ask for the following:
|
||||||
|
|
||||||
* Go ahead and fork the project and make your changes. We encourage pull requests to discuss code changes.
|
* Go ahead and fork the project and make your changes. We encourage pull requests to discuss code changes.
|
||||||
- Fork it
|
- Fork it
|
||||||
- Create your feature branch (git checkout -b my-new-feature)
|
- Create your feature branch (git checkout -b my-new-feature)
|
||||||
- Commit your changes (git commit -am 'Add some feature')
|
- Commit your changes (git commit -am 'Add some feature')
|
||||||
- Push to the branch (git push origin my-new-feature)
|
- Push to the branch (git push origin my-new-feature)
|
||||||
- Create new Pull Request
|
- Create new Pull Request
|
||||||
|
|
||||||
* When you're ready to create a pull request, be sure to:
|
* When you're ready to create a pull request, be sure to:
|
||||||
- Have test cases for the new code. If you have questions about how to do it, please ask in your pull request.
|
- Have test cases for the new code. If you have questions about how to do it, please ask in your pull request.
|
||||||
- Run go fmt
|
- Run go fmt
|
||||||
- Squash your commits into a single commit. git rebase -i. It's okay to force update your pull request.
|
- Squash your commits into a single commit. git rebase -i. It's okay to force update your pull request.
|
||||||
- Make sure go test ./... passes, and go build completes.
|
- Make sure go test ./... passes, and go build completes.
|
||||||
|
|
||||||
##### NOTE
|
|
||||||
|
|
||||||
This document assumes that minio user is using Ubuntu 12.04 or 14.04 LTS release
|
|
||||||
|
Loading…
Reference in New Issue
Block a user