Skip to content

Commit

Permalink
Tweak the makefile and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
xthexder committed Nov 2, 2015
1 parent 86ead0d commit a78f863
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ COMBINED_GOPATH=$(GODEP_PATH):$(ORIGINAL_PATH)
.PHONY: packages deb test linux darwin windows

build:
GOPATH=$(COMBINED_GOPATH) go build -ldflags="-X github.com/Shopify/toxiproxy.Version git-$(git rev-parse --short HEAD)" -o toxiproxy ./cmd
GOPATH=$(COMBINED_GOPATH) go build -ldflags="-X github.com/Shopify/toxiproxy.Version=git-$(shell git rev-parse --short HEAD)" -o toxiproxy ./cmd

all: deb linux darwin windows
deb: $(DEB)
Expand All @@ -25,13 +25,13 @@ test:
GOMAXPROCS=4 GOPATH=$(COMBINED_GOPATH) go test -v -race ./...

tmp/build/toxiproxy-linux-amd64:
GOOS=linux GOARCH=amd64 GOPATH=$(COMBINED_GOPATH) go build -ldflags="-X github.com/Shopify/toxiproxy.Version $(VERSION)" -o $(@) ./cmd
GOOS=linux GOARCH=amd64 GOPATH=$(COMBINED_GOPATH) go build -ldflags="-X github.com/Shopify/toxiproxy.Version=$(VERSION)" -o $(@) ./cmd

tmp/build/toxiproxy-darwin-amd64:
GOOS=darwin GOARCH=amd64 GOPATH=$(COMBINED_GOPATH) go build -ldflags="-X github.com/Shopify/toxiproxy.Version $(VERSION)" -o $(@) ./cmd
GOOS=darwin GOARCH=amd64 GOPATH=$(COMBINED_GOPATH) go build -ldflags="-X github.com/Shopify/toxiproxy.Version=$(VERSION)" -o $(@) ./cmd

tmp/build/toxiproxy-windows-amd64.exe:
GOOS=windows GOARCH=amd64 GOPATH=$(COMBINED_GOPATH) go build -ldflags="-X github.com/Shopify/toxiproxy.Version $(VERSION)" -o $(@) ./cmd
GOOS=windows GOARCH=amd64 GOPATH=$(COMBINED_GOPATH) go build -ldflags="-X github.com/Shopify/toxiproxy.Version=$(VERSION)" -o $(@) ./cmd

docker:
docker build --tag="shopify/toxiproxy:$(VERSION)" .
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ Content-Length: 108
```

```bash
$ curl -i -d '{"type":"latency", "latency":1000}' localhost:8474/proxies/redis/toxics
$ curl -i -d '{"type":"latency", "latency":1000}' localhost:8474/proxies/redis/toxics
HTTP/1.1 200 OK
Content-Type: application/json
Date: Fri, 21 Aug 2015 19:05:19 GMT
Expand Down Expand Up @@ -529,13 +529,15 @@ For example, `shopify_test_redis_master` or `shopify_development_mysql_1`.

### Development

* `make`. Build a toxiproxy development binary for the current platform.
* `make all`. Build Toxiproxy binaries and packages for all platforms. Requires
to have Go compiled with cross compilation enabled on Linux and Darwin (amd64)
as well as [`fpm`](https://github.com/jordansissel/fpm) in your `$PATH` to
build the Debian package.
* `make test`. Run the Toxiproxy tests.
* `make darwin`. Build binary for Darwin.
* `make linux`. Build binary for Linux.
* `make windows`. Build binary for Windows.

### Release

Expand All @@ -544,7 +546,7 @@ For example, `shopify_test_redis_master` or `shopify_development_mysql_1`.
3. Change versions in `README.md`
4. Commit
5. Tag
6. `make` to create binaries, packages and push new Docker image
6. `make release` to create binaries, packages and push new Docker image
7. Create [Github draft release](https://github.com/Shopify/toxiproxy/releases/new) against new tag and upload binaries and Debian package
8. [Bump version for Homebrew](https://github.com/Shopify/homebrew-shopify/blob/master/toxiproxy.rb#L9)

Expand Down

0 comments on commit a78f863

Please sign in to comment.