Skip to content

Commit 402889b

Browse files
committed
Update Contributing doc
1 parent 35cf69d commit 402889b

File tree

1 file changed

+15
-21
lines changed

1 file changed

+15
-21
lines changed

CONTRIBUTING.md

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,21 @@ From `$GOPATH/src/github.com/aws/amazon-ecs-cli`:
88
* Run `make` (This creates a standalone executable in the `bin/local` directory).
99

1010
From `$GOPATH/src/github.com/aws/amazon-ecs-cli/ecs-cli`:
11-
* Run `godep restore` (This will download and install dependencies specified in the `Godeps/Godeps.json` into your `$GOPATH`).
12-
* **NOTE:** `godep restore` puts the dependencies in a detached HEAD state (see: [Updating an existing dependency](https://github.com/aws/amazon-ecs-cli/blob/master/README.md#updating-an-existing-dependency)).
13-
14-
### Adding new dependencies
15-
* Make sure you have the latest [godep](https://github.com/tools/godep) (`go get -u github.com/tools/godep`) (version 79)
16-
* `go get` the new dependency.
17-
* Edit your application's source code to import the new dependency.
18-
* From `$GOPATH/src/github.com/aws/amazon-ecs-cli/ecs-cli`, run `godep save ./...` (This will update `Godeps/Godeps.json` and copy the dependencies source to the `vendor/` directory).
19-
20-
### Updating an existing dependency
21-
* While godep recommends using `godep update`, this command unfortunately has several known issues (See: https://github.com/tools/godep/issues/498). We recommend following their [suggestion](https://github.com/tools/godep/issues/498#issuecomment-238946586):
22-
1. Delete any reference to the package in `Godeps/Godeps.json` (you can also delete the entire `Godeps` dir).
23-
1. Delete the package from the `/vendor` dir: `rm -rf $GOPATH/src/github.com/aws/amazon-ecs-cli/ecs-cli/vendor/<package>`. (You can also delete the entire vendor dir)
24-
1. Re-vendor the dependency by running `godep save ./...` from `$GOPATH/src/github.com/aws/amazon-ecs-cli/ecs-cli`.
25-
26-
* Inspect the changes with `git diff` (should show up in `vendor/` directory)
27-
* Example: https://github.com/aws/amazon-ecs-cli/pull/315
28-
* **NOTE:** Unfortunately, using `godep restore` means that `go get` will not work with dependencies. Until we move off `godep`, when we want to update a dependency we will have to go to the dependency in the `$GOPATH` and manually use `git pull` an update to that package.
29-
30-
### Generating mocks
31-
* From `$GOPATH/src/github.com/aws/amazon-ecs-cli/`, run `make generate`. This will look for all files named `generate_mock.go` in the `ecs-cli/modules` directory and call the `mockgen.sh` script, which is a wrapper for the [mockgen](https://github.com/golang/mock#running-mockgen) command.
11+
* run `dep ensure && dep prune`. This will download dependencies specified in the `Gopkg.lock` by default in `$GOPATH/pkg/dep/sources`.
12+
* **NOTE:** `dep ensure` puts the dependencies in a detached HEAD state.
13+
* **NOTE:** `dep prune` deletes any unused vendor files.
14+
15+
### Adding/updating new dependencies
16+
* We use [dep](https://github.com/golang/dep) to manage dependencies. Make sure you have version 0.3.2 of [dep](https://github.com/golang/dep/releases/tag/v0.3.2) (installation instructions [here](https://golang.github.io/dep/docs/installation.html)).
17+
* To [add a dependency](https://golang.github.io/dep/docs/daily-dep.html#adding-a-new-dependency), run `dep ensure -add <your_package>`.
18+
* To [update a dependency](https://golang.github.io/dep/docs/daily-dep.html#updating-dependencies), run `dep ensure -update<your_package>`.
19+
20+
### Generating mocks/licenses
21+
* From `$GOPATH/src/github.com/aws/amazon-ecs-cli/`, run `make generate`. This
22+
will look for all files named `generate_mock.go` in the `ecs-cli/modules`
23+
directory and call the `scripts/mockgen.sh` script, which is a wrapper for the
24+
[mockgen](https://github.com/golang/mock#running-mockgen) command.
25+
* **NOTE:** `make generate` will also regenerate the license via `scripts/license.sh`.
3226

3327
### Cross-compiling
3428
The `make docker-build` target builds standalone amd64 executables for

0 commit comments

Comments
 (0)