This repository has been archived by the owner on Jan 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
46 lines (34 loc) · 1.17 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
MAKEFLAGS += --warn-undefined-variables
.DEFAULT_GOAL := build
PHONY: all build test push push-latest clean
NAME := quay.io/ahelal/bender
VERSION := $(shell cat VERSION)
M = $(shell printf "\033[34;1m▶\033[0m")
all: test squash build
build:
$(info $(M) Building ${NAME}:${VERSION} and ${NAME}:dev …)
@docker build -t ${NAME}:${VERSION} -t ${NAME}:dev -f Dockerfile .
squash:
# requires docker-squash https://github.com/goldmann/docker-squash
$(info $(M) Squashing ${NAME}:${VERSION} …)
@docker-squash -t ${NAME}:${VERSION} ${NAME}:${VERSION}
tests:
$(info $(M) Running tests for )
@PYTHONPATH="src/lib" nosetests -w "src/tests"
detailed-tests:
$(info $(M) Running tests for $(VERSION))
@PYTHONPATH="src/lib" nosetests --detailed-errors -w "src/tests" -vv --nocapture
coverage:
@coverage report -m src/lib/*.py
lint:
@pylint src/lib/*.py
push:
$(info $(M) Pushing $(NAME):$(VERSION) )
@docker tag $(NAME):dev $(NAME):$(VERSION)
@docker push "${NAME}:${VERSION}"
push-latest:
$(info $(M) Linking latest to $(NAME):$(VERSION) and pushing tag latest )
docker tag $(NAME):$(VERSION) $(NAME):latest
docker push "${NAME}:latest"
# clean:
# $(info $(M) Cleaning)