-
Notifications
You must be signed in to change notification settings - Fork 20
/
Makefile
31 lines (23 loc) · 848 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
26
27
28
29
30
31
.PHONY: build push build-test test clean
IMAGE_NAME := quay.io/app-sre/qontract-validator
IMAGE_TAG := $(shell git rev-parse --short=7 HEAD)
IMAGE_TEST := validator-test
ifneq (,$(wildcard $(CURDIR)/.docker))
DOCKER_CONF := $(CURDIR)/.docker
else
DOCKER_CONF := $(HOME)/.docker
endif
build: clean
@docker build -t $(IMAGE_NAME):latest -f dockerfiles/Dockerfile .
@docker tag $(IMAGE_NAME):latest $(IMAGE_NAME):$(IMAGE_TAG)
push:
@docker --config=$(DOCKER_CONF) push $(IMAGE_NAME):latest
@docker --config=$(DOCKER_CONF) push $(IMAGE_NAME):$(IMAGE_TAG)
build-test: clean
@docker build -t $(IMAGE_TEST) -f dockerfiles/Dockerfile.test .
test: build-test
@docker run --rm $(IMAGE_TEST)
clean:
@rm -rf .tox .eggs *.egg-info buid .pytest_cache
@find . -name "__pycache__" -type d -print0 | xargs -0 rm -rf
@find . -name "*.pyc" -delete