Permalink
Browse files

package: add .deb packaging

  • Loading branch information...
sirupsen committed Dec 31, 2014
1 parent bec6fe8 commit 7dc04b065e72bb358e8758634418e10a0d86f068
Showing with 40 additions and 23 deletions.
  1. +2 −0 .gitignore
  2. +36 −0 Makefile
  3. +1 −0 VERSION
  4. +1 −1 circle.yml
  5. +0 −6 script/build
  6. +0 −4 script/compile
  7. +0 −5 script/env
  8. +0 −7 script/test
View
@@ -5,3 +5,5 @@ testing.test
cpu.out
cover*.out
coverage.html
+*.deb
+tmp/
View
@@ -0,0 +1,36 @@
+NAME=toxiproxy
+VERSION=$(shell cat VERSION)
+DEB=pkg/$(NAME)_$(VERSION)_amd64.deb
+GODEP_PATH=$(shell pwd)/Godeps/_workspace
+GOPATH=$(GODEP_PATH):$$GOPATH
+
+.PHONY: packages deb test
+
+packages: deb
+deb: $(DEB)
+
+build:
+ GOPATH=$(GOPATH) go build -o toxiproxy
+
+test:
+ GOPATH=$(GOPATH) go test
+
+tmp/build/linux-amd64:
+ GOOS=linux GOARCH=amd64 GOPATH=$(GOPATH) go build -o $(@)
+
+tmp/build/darwin-amd64:
+ GOOS=darwin GOARCH=amd64 GOPATH=$(GOPATH) go build -o $(@)
+
+$(DEB): tmp/build/linux-amd64
+ fpm -t deb \
+ -s dir \
+ --name "toxiproxy" \
+ --version $(VERSION) \
+ --license MIT \
+ --no-depends \
+ --no-auto-depends \
+ --architecture amd64 \
+ --maintainer "Simon Eskildsen <simon.eskildsen@shopify.com>" \
+ --description "TCP proxy to simulate network and system conditions" \
+ --url "https://github.com/Shopify/toxiproxy" \
+ $<=/usr/bin/toxiproxy
View
@@ -0,0 +1 @@
+0.0.1
View
@@ -5,4 +5,4 @@ dependencies:
test:
override:
- - script/test
+ - make test
View
@@ -1,6 +0,0 @@
-#!/bin/bash
-
-GOOS=linux GOARCH=amd64 script/compile
-md5sum toxiproxy | \
- awk '{print $1}' | \
- xargs -I% mv toxiproxy toxiproxy-%
View
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-script/env
-godep go build -o toxiproxy
View
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-# Add godep for dependency sandboxing
-go get github.com/tools/godep
-export PATH="$GOPATH/bin:$PATH"
View
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-script/env
-
-# Run the tests in the sandbox
-godep go test
-godep go test -race

0 comments on commit 7dc04b0

Please sign in to comment.