Combine the two documentation sections on how to use godeps.

This commit is contained in:
Alex Robinson 2015-02-18 22:04:56 +00:00
parent afefa85b26
commit e752271e83

View File

@ -49,7 +49,7 @@ export PATH=$PATH:$GOPATH/bin
``` ```
### Using godep ### Using godep
Here is a quick summary of `godep`. `godep` helps manage third party dependencies by copying known versions into Godeps/_workspace. Here is the recommended way to set up your system. There are other ways that may work, but this is the easiest one I know of. Here's a quick walkthrough of one way to use godeps to add or update a Kubernetes dependency into Godeps/_workspace. For more details, please see the instructions in [godep's documentation](https://github.com/tools/godep).
1) Devote a directory to this endeavor: 1) Devote a directory to this endeavor:
``` ```
@ -69,7 +69,7 @@ export GOPATH=$KPATH
# Option B is recommended if you're going to mess with the dependencies. # Option B is recommended if you're going to mess with the dependencies.
``` ```
3) Populate your new $GOPATH. 3) Populate your new GOPATH.
``` ```
cd $KPATH/src/github.com/GoogleCloudPlatform/kubernetes cd $KPATH/src/github.com/GoogleCloudPlatform/kubernetes
godep restore godep restore
@ -77,20 +77,22 @@ godep restore
4) Next, you can either add a new dependency or update an existing one. 4) Next, you can either add a new dependency or update an existing one.
``` ```
# To add a new dependency, run: # To add a new dependency, do:
cd $KPATH/src/github.com/GoogleCloudPlatform/kubernetes cd $KPATH/src/github.com/GoogleCloudPlatform/kubernetes
go get path/to/dependency go get path/to/dependency
# Change code in Kubernetes to use the dependency.
godep save ./... godep save ./...
# To update an existing dependency, do # To update an existing dependency, do:
cd $KPATH/src/github.com/GoogleCloudPlatform/kubernetes cd $KPATH/src/github.com/GoogleCloudPlatform/kubernetes
go get -u path/to/dependency go get -u path/to/dependency
# Change code in Kubernetes accordingly if necessary.
godep update path/to/dependency godep update path/to/dependency
``` ```
5) Before sending your PR, it's a good idea to sanity check that your Godeps.json file is ok by re-restoring: ```godep restore``` 5) Before sending your PR, it's a good idea to sanity check that your Godeps.json file is ok by re-restoring: ```godep restore```
I (lavalamp) have sometimes found it expedient to manually fix the /Godeps/godeps.json file to minimize the changes. It is sometimes expedient to manually fix the /Godeps/godeps.json file to minimize the changes.
Please send dependency updates in separate commits within your PR, for easier reviewing. Please send dependency updates in separate commits within your PR, for easier reviewing.
@ -208,26 +210,6 @@ go run e2e.go -ctl='delete pod foobar'
## Testing out flaky tests ## Testing out flaky tests
[Instructions here](flaky-tests.md) [Instructions here](flaky-tests.md)
## Add/Update dependencies
Kubernetes uses [godep](https://github.com/tools/godep) to manage dependencies. To add or update a package, please follow the instructions on [godep's document](https://github.com/tools/godep).
To add a new package ``foo/bar``:
- Make sure the kubernetes' root directory is in $GOPATH/github.com/GoogleCloudPlatform/kubernetes
- Run ``godep restore`` to make sure you have all dependancies pulled.
- Download foo/bar into the first directory in GOPATH: ``go get foo/bar``.
- Change code in kubernetes to use ``foo/bar``.
- Run ``godep save ./...`` under kubernetes' root directory.
To update a package ``foo/bar``:
- Make sure the kubernetes' root directory is in $GOPATH/github.com/GoogleCloudPlatform/kubernetes
- Run ``godep restore`` to make sure you have all dependancies pulled.
- Update the package with ``go get -u foo/bar``.
- Change code in kubernetes accordingly if necessary.
- Run ``godep update foo/bar`` under kubernetes' root directory.
## Keeping your development fork in sync ## Keeping your development fork in sync
One time after cloning your forked repo: One time after cloning your forked repo: