-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
61 lines (48 loc) · 1.22 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
50
51
52
53
54
55
56
57
58
59
60
61
BIN_DIR = binaries
.PHONY=build
build: clean
scripts/write-git-info
pyinstaller --onefile --add-data cogctl/GITSHA:. --add-data cogctl/GITTAG:. bin/cogctl
clean:
rm -Rf build
rm -Rf dist
lint:
flake8 --max-line-length=85 --max-complexity=10
test:
pytest -vv \
--cov-report=term:skip-covered \
--cov-report=html \
--cov=cogctl \
--cov-fail-under=95
# Don't worry about making reports, since we're going to send
# everything to Coveralls.io anyway
travis-test:
pytest -vv \
--cov=cogctl \
--cov-fail-under=95
acceptance:
bin/cucumber
all: clean lint test acceptance build
deps: python-deps ruby-deps
python-deps:
pip install -r requirements.txt
pip install -r requirements.build.txt
ruby-deps:
bundle install --path=vendor --binstubs
PLATFORM ?= alpine
BUILD_HASH := $(shell git rev-parse HEAD)
DOCKER_TAG ?= cogctl-local-build-$(BUILD_HASH)
BINARY_NAME ?= cogctl-$(PLATFORM)-$(BUILD_HASH)
# Make an executable for Linux platform
exe: | $(BIN_DIR)
docker build \
--tag=$(DOCKER_TAG) \
--label="git_commit=$(BUILD_HASH)" \
--file Dockerfile.$(PLATFORM) . && \
docker run \
--volume "$(shell pwd)"/binaries:/binaries \
--rm \
$(DOCKER_TAG) \
cp /usr/bin/cogctl /binaries/$(BINARY_NAME)
$(BIN_DIR):
mkdir -p $@