Skip to content

Commit ce663c9

Browse files
author
Hsing-Hui Hsu
committed
Update instructions for updating dependencies
Also adds instructions for regenerating mocks
1 parent 7a00e49 commit ce663c9

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

CONTRIBUTING.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,19 @@ From `$GOPATH/src/github.com/aws/amazon-ecs-cli/ecs-cli`:
1818
* 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).
1919

2020
## Updating an existing dependency
21-
* `godep update <dependency> ./...` will update your dependency as well as recursively update any packages it depends on.
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+
2226
* Inspect the changes with `git diff` (should show up in `vendor/` directory)
27+
* Example: https://github.com/aws/amazon-ecs-cli/pull/315
2328
* **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.
2429

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.
32+
33+
2534
## Cross-compiling
2635
The `make docker-build` target builds standalone amd64 executables for
2736
Darwin and Linux. The output will be in `bin/darwin-amd64` and `bin/linux-amd64`,

0 commit comments

Comments
 (0)