forked from LaconicNetwork/kompose
Merge pull request #341 from surajssd/build_instructions_update
updated dev docs with latest instructions
This commit is contained in:
commit
6e260bab0b
@ -23,4 +23,4 @@ Contact one of the [OWNERS](OWNERS) on Slack to access the appropriate CLA and i
|
|||||||
|
|
||||||
### Adding dependencies
|
### Adding dependencies
|
||||||
|
|
||||||
If your patch depends on new packages, add that package with [`godep`](https://github.com/tools/godep). Follow the [instructions to add a dependency](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md#godep-and-dependency-management).
|
If your patch depends on new packages, add that package with [`glide`](https://github.com/Masterminds/glide). Follow the [instructions to add a dependency](https://github.com/kubernetes-incubator/kompose/blob/master/docs/development.md#glide-glide-vc-and-dependency-management).
|
||||||
|
|||||||
@ -1,31 +1,8 @@
|
|||||||
# Development Guide
|
# Development Guide
|
||||||
|
|
||||||
## Building Kompose
|
## Building Kompose
|
||||||
### Build with `go`
|
|
||||||
|
|
||||||
- you need `go v1.5` or later
|
Read about building kompose [here](https://github.com/kubernetes-incubator/kompose#building).
|
||||||
- You need to set export `GO15VENDOREXPERIMENT=1` environment variable
|
|
||||||
- If your working copy is not in your `GOPATH`, you need to set it accordingly.
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ go build -tags experimental -o kompose ./cli/main
|
|
||||||
```
|
|
||||||
|
|
||||||
You need `-tags experimental` because the current bundlefile package of docker/libcompose is still experimental.
|
|
||||||
|
|
||||||
### Building binaries with make
|
|
||||||
|
|
||||||
- You need `make`
|
|
||||||
|
|
||||||
#### Build multi-platforms:
|
|
||||||
```console
|
|
||||||
$ make binary-cross
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Build current platform only:
|
|
||||||
```console
|
|
||||||
$ make binary
|
|
||||||
```
|
|
||||||
|
|
||||||
## Workflow
|
## Workflow
|
||||||
### Fork the main repository
|
### Fork the main repository
|
||||||
@ -38,10 +15,8 @@ $ make binary
|
|||||||
The commands below require that you have $GOPATH. We highly recommended you put Kompose' code into your $GOPATH.
|
The commands below require that you have $GOPATH. We highly recommended you put Kompose' code into your $GOPATH.
|
||||||
|
|
||||||
```console
|
```console
|
||||||
mkdir -p $GOPATH/src/github.com/kubernetes-incubator
|
git clone https://github.com/$YOUR_GITHUB_USERNAME/kompose.git $GOPATH/src/github.com/kubernetes-incubator/kompose
|
||||||
cd $GOPATH/src/github.com/kubernetes-incubator
|
cd $GOPATH/src/github.com/kubernetes-incubator/kompose
|
||||||
git clone https://github.com/$YOUR_GITHUB_USERNAME/kompose.git
|
|
||||||
cd kompose
|
|
||||||
git remote add upstream 'https://github.com/kubernetes-incubator/kompose'
|
git remote add upstream 'https://github.com/kubernetes-incubator/kompose'
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -78,40 +53,28 @@ git push -f origin myfeature
|
|||||||
2. Click the "Compare and pull request" button next to your "myfeature" branch.
|
2. Click the "Compare and pull request" button next to your "myfeature" branch.
|
||||||
3. Check out the pull request process for more details
|
3. Check out the pull request process for more details
|
||||||
|
|
||||||
## Glide, glide-vc and dependency management
|
## `glide`, `glide-vc` and dependency management
|
||||||
|
|
||||||
Kompose uses `glide` to manage dependencies and `glide-vc` to clean vendor directory.
|
Kompose uses `glide` to manage dependencies and `glide-vc` to clean vendor directory.
|
||||||
They are not strictly required for building Kompose but they are required when managing dependencies under the vendor/ tree.
|
They are not strictly required for building Kompose but they are required when managing dependencies under the `vendor/` directory.
|
||||||
If you want to make changes to dependencies please make sure that `glide` and `glide-vc` are installed and in your `$PATH`.
|
If you want to make changes to dependencies please make sure that `glide` and `glide-vc` are installed and are in your `$PATH`.
|
||||||
|
|
||||||
### Installing glide
|
### Installing glide
|
||||||
|
|
||||||
There are many ways to build and host Go binaries. Here is an easy way to get utilities like `glide` and `glide-vc` installed:
|
There are many ways to build and host golang binaries. Here is an easy way to get utilities like `glide` and `glide-vc` installed:
|
||||||
|
|
||||||
1. Ensure that Mercurial and Git are installed on your system. (some of the dependencies use the mercurial source control system).
|
Ensure that Mercurial and Git are installed on your system. (some of the dependencies use the mercurial source control system).
|
||||||
Use `apt-get install mercurial git` or `yum install mercurial git` on Linux, or brew.sh on OS X, or download directly them directly.
|
Use `apt-get install mercurial git` or `yum install mercurial git` on Linux, or `brew.sh` on OS X, or download them directly.
|
||||||
|
|
||||||
2. Create a new GOPATH for your tools and install `godep`:
|
|
||||||
|
|
||||||
```console
|
```console
|
||||||
export GOPATH=$HOME/go-tools
|
|
||||||
mkdir -p $GOPATH
|
|
||||||
go get -u github.com/Masterminds/glide
|
go get -u github.com/Masterminds/glide
|
||||||
go get github.com/sgotti/glide-vc
|
go get github.com/sgotti/glide-vc
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Add this $GOPATH/bin to your path. Typically you'd add this to your ~/.profile:
|
|
||||||
|
|
||||||
```console
|
|
||||||
export GOPATH=$HOME/go-tools
|
|
||||||
export PATH=$PATH:$GOPATH/bin
|
|
||||||
```
|
|
||||||
|
|
||||||
Check that `glide` and `glide-vc` commands are working.
|
Check that `glide` and `glide-vc` commands are working.
|
||||||
|
|
||||||
```console
|
```console
|
||||||
glide --version
|
glide --version
|
||||||
|
|
||||||
glide-vc -h
|
glide-vc -h
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -119,6 +82,7 @@ glide-vc -h
|
|||||||
|
|
||||||
#### Adding new dependency
|
#### Adding new dependency
|
||||||
1. Update `glide.yml` file.
|
1. Update `glide.yml` file.
|
||||||
|
|
||||||
Add new packages or subpackages to `glide.yml` depending if you added whole new package as dependency or
|
Add new packages or subpackages to `glide.yml` depending if you added whole new package as dependency or
|
||||||
just new subpackage.
|
just new subpackage.
|
||||||
|
|
||||||
@ -141,3 +105,4 @@ Kubernetes version depends on what version is OpenShift using.
|
|||||||
OpenShift is using forked Kubernetes to carry some patches.
|
OpenShift is using forked Kubernetes to carry some patches.
|
||||||
Currently it is not possible to use different Kubernetes version from version that OpenShift uses.
|
Currently it is not possible to use different Kubernetes version from version that OpenShift uses.
|
||||||
(for more see comments in `glide.yml`)
|
(for more see comments in `glide.yml`)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user