Skip to content

steps to add/update dependencies in netplugin using godep #264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 3, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions docs/GoDep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Dependency management in netplugin
This document explains the steps for vendoring update packages in netplugin

## Table of Contents
- [Audience](#audience)
- [Restoring dependencies](#restoring-dependencies)
- [Adding new dependencies](#adding-new-dependencies)
- [Updating existing dependencies](#updating-existing-dependencies)

## Audience
This document is targeted towards the developers looking into or working on
adding/updating vendored packages in netplugin/Godeps.

## Restoring dependencies
- netplugin/Godeps/Godeps.json has information about the vendored packages.
- `godep restore` can be used to copy these packages to $GOPATH/src
- It restores the packages in $GOPATH to a state expected by netplugin
- note: changes(if any) in $GOPATH/src will be over-written
```
cd netplugin
godep restore
```

## Adding new dependencies

- Add the new package to your $GOPATH/src
```
go get pkg_url
```

- From within the netplugin directory run `godep save`, which will copy relevant
packages from `$GOPATH/src` to `netplugin/Godeps/_workspace`. It will also update
`netplugin/Godeps/Godeps.json`

```
cd netplugin
godep save ./...
```

- Verify the changes by running `git status` in netplugin directory.
Verify that package is added to `Godeps/_workspace/src` and that
`Godeps/Godeps.json` also reflects it

```
git status
```

## Updating existing dependencies
- Go to the `$GOPATH/directory` which hosts the package and update the package
```
cd $GOPATH/src/github.com/samalba/dockerclient

# update the package to the master
git checkout master
```

- From within the netplugin directory execute a `godep update pkg` to update the
Godeps
```
godep udpate github.com/samalba/dockerclient
```

- Verify the changes by running `git status` in netplugin directory.
Verify that package is added to `Godeps/_workspace/src` and that
`Godeps/Godeps.json` also reflects the version change

```
git status
```