-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
25 lines (17 loc) · 826 Bytes
/
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
PYVERSION=3.5
NAME=05_emotion_wassa_nuig
REPO=mixedemotions
VERSION=latest
PLUGINS= $(filter %/, $(wildcard */))
all: build run
build: clean Dockerfile
docker build -t '$(REPO)/$(NAME):$(VERSION)' -f Dockerfile .;
test-%:
docker run -v $$PWD/$*:/senpy-plugins/ --rm --entrypoint=/usr/local/bin/py.test -ti '$(REPO)/$(NAME):$(VERSION)' test.py
test: $(addprefix test-,$(PLUGINS))
clean:
@docker ps -a | awk '/$(REPO)\/$(NAME)/{ split($$2, vers, "-"); if(vers[1] != "${VERSION}"){ print $$1;}}' | xargs docker rm 2>/dev/null|| true
@docker images | awk '/$(REPO)\/$(NAME)/{ split($$2, vers, "-"); if(vers[1] != "${VERSION}"){ print $$1":"$$2;}}' | xargs docker rmi 2>/dev/null|| true
run: build
docker run --rm -p 5000:5000 -ti '$(REPO)/$(NAME):$(VERSION)'
.PHONY: test test-% build-% build test test_pip run clean