#90 build app.js outside of main Docker image
This commit is contained in:
34
Makefile
Normal file
34
Makefile
Normal file
@@ -0,0 +1,34 @@
|
||||
.PHONY: clean
|
||||
|
||||
IMAGE ?= hjacobs/kube-ops-view
|
||||
TAG ?= latest
|
||||
GITHEAD = $(shell git rev-parse --short HEAD)
|
||||
GITURL = $(shell git config --get remote.origin.url)
|
||||
GITSTATUS = $(shell git status --porcelain || echo "no changes")
|
||||
|
||||
default: docker
|
||||
|
||||
build: appjs docker
|
||||
|
||||
clean:
|
||||
rm -fr kube_ops_view/static/build
|
||||
|
||||
test:
|
||||
tox
|
||||
|
||||
appjs:
|
||||
docker run -it -u $$(id -u) -v $$(pwd):/workdir -w /workdir/app node:7.4-alpine npm install
|
||||
docker run -it -u $$(id -u) -v $$(pwd):/workdir -w /workdir/app node:7.4-alpine npm run build
|
||||
|
||||
docker: appjs scm-source.json
|
||||
docker build -t "$(IMAGE):$(TAG)" .
|
||||
|
||||
push: docker
|
||||
docker push "$(IMAGE):$(TAG)"
|
||||
|
||||
mock:
|
||||
docker run -it -p 8080:8080 -e MOCK=true "$(IMAGE):$(TAG)"
|
||||
|
||||
scm-source.json: .git
|
||||
@echo '{"url": "$(GITURL)", "revision": "$(GITHEAD)", "author": "$(USER)", "status": "$(GITSTATUS)"}' > scm-source.json
|
||||
|
||||
Reference in New Issue
Block a user