-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (40 loc) · 1.59 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
include ../includes.mk
COMPONENT = deisctl
IMAGE = $(IMAGE_PREFIX)/$(COMPONENT):$(BUILD_TAG)
PACKAGE = $(COMPONENT)-$(BUILD_TAG).tar.gz
build:
CGO_ENABLED=0 godep go build -a -ldflags '-s' .
installer:
rm -rf dist && mkdir -p dist
CGO_ENABLED=0 godep go build -a -ldflags '-s' -o dist/deisctl .
@if [ ! -d makeself ]; then git clone -b single-binary https://github.com/deis/makeself.git; fi
PATH=./makeself:$$PATH BINARY=deisctl makeself.sh --bzip2 --current --nox11 dist \
dist/deisctl-`cat deis-version`-`go env GOOS`-`go env GOARCH`.run "Deis Control Utility" \
"./deisctl refresh-units \
&& echo \
&& echo '\033[0;36mdeisctl\033[0m is in the current directory and unit files are' \
&& echo 'in \$$HOME/.deis/units. Please move \033[0;36mdeisctl\033[0m to a' \
&& echo 'directory in your search PATH.' \
&& echo \
&& echo 'See http://docs.deis.io/ for documentation.' \
&& echo"
install:
godep go install -v .
setup-root-gotools:
sudo GOPATH=/tmp/tmpGOPATH go get -u -v code.google.com/p/go.tools/cmd/cover
sudo GOPATH=/tmp/tmpGOPATH go get -u -v code.google.com/p/go.tools/cmd/vet
sudo rm -rf /tmp/tmpGOPATH
setup-gotools:
go get -v github.com/golang/lint/golint
test-style:
go vet ./...
-golint *.go client/*.go cmd/*.go config/*.go constant/*.go lock/*.go update/*.go utils/*.go
test: test-style
godep go test -v -cover ./...
release: check-docker
rm -rf dist
docker build -t $(IMAGE) .
mkdir -p dist
-docker cp `docker run -d $(IMAGE)`:/tmp/deisctl.tar.gz dist/
mv dist/deisctl.tar.gz dist/$(PACKAGE)
aws s3 cp dist/$(PACKAGE) s3://$(S3_BUCKET)/$(PACKAGE) --acl public-read