forked from hjacobs/kube-ops-view
-
Notifications
You must be signed in to change notification settings - Fork 39
/
Makefile
30 lines (22 loc) · 925 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
.PHONY: clean test appjs docker push mock
IMAGE ?= hjacobs/kube-ops-view
VERSION ?= $(shell git describe --tags --always --dirty)
TAG ?= $(VERSION)
TTYFLAGS = $(shell test -t 0 && echo "-it")
default: docker
clean:
rm -fr kube_ops_view/static/build
test:
pipenv run flake8
pipenv run coverage run --source=kube_ops_view -m py.test
pipenv run coverage report
appjs:
docker run $(TTYFLAGS) -u $$(id -u) -v $$(pwd):/workdir -w /workdir/app -e NPM_CONFIG_CACHE=/tmp node:11.4-alpine npm install
docker run $(TTYFLAGS) -u $$(id -u) -v $$(pwd):/workdir -w /workdir/app -e NPM_CONFIG_CACHE=/tmp node:11.4-alpine npm run build
docker: appjs
docker build --build-arg "VERSION=$(VERSION)" -t "$(IMAGE):$(TAG)" .
@echo 'Docker image $(IMAGE):$(TAG) can now be used.'
push: docker
docker push "$(IMAGE):$(TAG)"
mock:
docker run $(TTYFLAGS) -p 8080:8080 "$(IMAGE):$(TAG)" --mock