-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development'. Fixed a conflict in README.md
Signed-off-by: Richard Case <[email protected]>
- Loading branch information
Showing
3 changed files
with
93 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# Contributing | ||
|
||
Development is set up for Unix/Linux/Mac systems. Some of the | ||
instructions below may not work properly on Windows. | ||
|
||
### Preparing an environment | ||
|
||
* [Install Go](https://golang.org/). | ||
* Install Godep: `go get github.com/tools/godep`. | ||
* Clone this repo (do **not** use `go get`). | ||
* [Ensure your $GOPATH is set correctly](http://golang.org/cmd/go/#hdr-GOPATH_environment_variable). Working in a clean environment without any other packages on $GOPATH is highly encouraged to avoid conflicts with the dependencies of the tool. Using a [gvm tool](https://github.com/moovweb/gvm) is a good choice for setting up a clean environment. Also, gvm is a convenient tool for installing cross-compilation prerequisites. | ||
* Install dependencies with Godep: enter the repo's root and `godep restore`. | ||
* Install go vet: `go get code.google.com/p/go.tools/cmd/vet`. | ||
|
||
### Developing | ||
|
||
* The TDD approach is recommended - write a failing test first, then fix it. | ||
|
||
* Use a `dev` script to run commands as you change the code: | ||
|
||
``` | ||
./dev <resource> <command> | ||
``` | ||
This way you do not need to rebuild the tool every time you alter something. | ||
* Before making a pull request check that `gofmt -d=true ./..` and `go vet ./...` do not produce any output (except for that coming from `Godeps/_workspace` - ignore it). | ||
* Do not commit until the unit tests have passed (`./run_tests`). | ||
* If you want to make an executable, simply run `./scripts/build`. The binary will appear in the `./out` folder. | ||
* The integration tests can be running `./run_integration_tests`. | ||
* The API file can be regenerated by running `./scripts/generate_api`. | ||
* Pull requests should be made against the development branch. | ||
### Building the releases | ||
Generally, any Linux/Darwin machine should work for building the releases. A Darwin machine is required though if you want to build a `MacOS .pkg`. | ||
* Install [gvm](https://github.com/moovweb/gvm) | ||
* Install the cross-compilation prerequisites: | ||
``` | ||
./scripts/install_platform_commands | ||
``` | ||
* Build the releases: | ||
``` | ||
./scripts/build_releases <version> | ||
``` | ||
At first, the script updates `base/constants.go` with the given version. This is needed for the tool to use the relevant user agent information. After that, the script builds a binary for each of the following OS/arch flavors: | ||
- Linux/amd4 | ||
- Windows/amd64 | ||
- MacOS/amd64 | ||
The binaries are packaged along with utility scripts as described in the [Install](#install-it) section. The folders are then archived - a `.tar.gz` file is made for Linux and Mac; a `.zip` file is made for Windows. | ||
Here is a full list of the created artifacts: | ||
* `clc-$version-linux-amd64/` | ||
* `clc-$version-linux-amd64.tar.gz` | ||
* `clc-$version-darwin-amd64` | ||
* `clc-$version-darwin-amd64.tar.gz` | ||
* `clc-$version-windows-amd64/` | ||
* `clc-$version-windows-amd64.zip` | ||
#### Building a .pkg for MacOS | ||
* Build a regular MacOS release using the command from the previous section | ||
* Execute the following script to build a `.pkg` file: | ||
``` | ||
./scripts/build_darwin_pkg <version> | ||
``` | ||
**Note:** the version has to match the version you specified in the previous section. | ||
You should see 2 artifacts after executing this script: | ||
* `clc-$version-pkg` | ||
* `clc-$version.pkg` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
package network | ||
|
||
type ListIpAddresses struct { | ||
DataCenter string `valid:"required" URIParam:"yes"` | ||
Network string `valid:"required" URIParam:"yes"` | ||
Type string `URIParam:"yes" oneOf:"claimed,free,all"` | ||
Network `argument:"composed" URIParam:"NetworkId,DataCenter" json:"-"` | ||
Type string `URIParam:"yes" oneOf:"claimed,free,all,optional"` | ||
} |