|
| 1 | +include ../includes.mk |
1 | 2 |
|
2 | | -build: setup-venv |
3 | | - venv/bin/pip install --disable-pip-version-check -r requirements.txt git+https://github.com/pyinstaller/pyinstaller@32bbb954b355937ccfe377afbe56979db79a7b30 |
4 | | - venv/bin/pyinstaller deis.spec |
5 | | - chmod +x dist/deis |
| 3 | +# the filepath to this repository, relative to $GOPATH/src |
| 4 | +repo_path = github.com/deis/deis/client |
| 5 | + |
| 6 | +GO_FILES = $(wildcard *.go) |
| 7 | +GO_PACKAGES = parser cmd controller/api controller/client $(wildcard controller/models/*) $(wildcard pkg/*) |
| 8 | +GO_PACKAGES_REPO_PATH = $(addprefix $(repo_path)/,$(GO_PACKAGES)) |
| 9 | + |
| 10 | +COMPONENT = $(notdir $(repo_path)) |
| 11 | +IMAGE = $(IMAGE_PREFIX)/$(COMPONENT):$(BUILD_TAG) |
| 12 | + |
| 13 | +build: |
| 14 | + CGO_ENABLED=0 godep go build -a -installsuffix cgo -ldflags '-s' -o deis . |
| 15 | + @$(call check-static-binary,deis) |
6 | 16 |
|
7 | | -# Install deis client locally through pip. |
8 | 17 | install: |
9 | | - pip install . |
10 | | - |
11 | | -# Remove the installed copy of the deis client through pip. |
12 | | -uninstall: |
13 | | - pip uninstall -y deis |
14 | | - |
15 | | -# Clean up after setup.py droppings. |
16 | | -clean: |
17 | | - rm -rf build/ dist/ *.egg-info |
18 | | - |
19 | | -installer: build |
20 | | - @if [ ! -d makeself ]; then git clone -b single-binary https://github.com/deis/makeself.git; fi |
21 | | - PATH=./makeself:$$PATH BINARY=deis makeself.sh --bzip2 --current --nox11 dist \ |
22 | | - dist/deis-cli-`grep '__version__\ =\ ' deis.py | cut -d' ' -f3 | tr -d \'`-`go env GOOS`-`go env GOARCH`.run \ |
23 | | - "Deis CLI" "echo \ |
24 | | - && echo 'deis is in the current directory. Please' \ |
25 | | - && echo 'move deis to a directory in your search PATH.' \ |
26 | | - && echo \ |
27 | | - && echo 'See http://docs.deis.io/ for documentation.' \ |
28 | | - && echo" |
29 | | - |
30 | | -setup-venv: |
31 | | - @if [ ! -d venv ]; then virtualenv venv; fi |
32 | | - |
33 | | -test-style: setup-venv |
34 | | - venv/bin/pip install --disable-pip-version-check -q flake8==2.4.1 |
35 | | - venv/bin/flake8 |
| 18 | + godep go install -v . |
| 19 | + |
| 20 | +setup-root-gotools: |
| 21 | + sudo GOPATH=/tmp/tmpGOPATH go get -u -v golang.org/x/tools/cmd/cover |
| 22 | + sudo GOPATH=/tmp/tmpGOPATH go get -u -v golang.org/x/tools/cmd/vet |
| 23 | + sudo rm -rf /tmp/tmpGOPATH |
| 24 | + |
| 25 | +setup-gotools: |
| 26 | + go get -u github.com/golang/lint/golint |
| 27 | + go get -u golang.org/x/tools/cmd/cover |
| 28 | + go get -u golang.org/x/tools/cmd/vet |
| 29 | + |
| 30 | +test: test-style test-unit |
| 31 | + |
| 32 | +test-style: |
| 33 | +# display output, then check |
| 34 | + $(GOFMT) $(GO_PACKAGES) $(GO_FILES) |
| 35 | + @$(GOFMT) $(GO_PACKAGES) $(GO_FILES) | read; if [ $$? == 0 ]; then echo "gofmt check failed."; exit 1; fi |
| 36 | + $(GOVET) $(repo_path) $(GO_PACKAGES_REPO_PATH) |
| 37 | + $(GOLINT) ./... |
36 | 38 |
|
37 | 39 | test-unit: |
38 | | - @echo no unit tests |
| 40 | + $(GOTEST) ./... |
0 commit comments