Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
docker-xs-dev-dash/Makefile
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
49 lines (39 sloc)
1.41 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IMG_NAME=ring3-dash | |
DATA_CON=$(IMG_NAME)-data | |
DASH_CON=$(IMG_NAME) | |
PORTS+=-p 80:80 | |
VOLUMES+=--volumes-from $(DATA_CON) -v /etc/localtime:/etc/localtime:ro | |
DEV_VOL=-v $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))):/host | |
build: . scripts/.gh-token scripts/.jira-pw | |
docker build -t $(IMG_NAME) . | |
clean: | |
docker rmi $(IMG_NAME) 2>/dev/null || true | |
[ ! -s .gh-token ] && rm -f .gh-token | |
stop: | |
docker rm -f $(DASH_CON) 2>/dev/null || true | |
run: build data stop | |
docker run --name=$(DASH_CON) -d -ti $(VOLUMES) $(PORTS) $(IMG_NAME) | |
shell: run | |
docker exec -it `docker ps -q -f name=$(DASH_CON)` /bin/bash | |
data: build | |
docker run --name=$(DATA_CON) -ti $(IMG_NAME) true 2>/dev/null || true | |
purge: stop | |
@read -n1 -r -p "This will remove all persistent data. Are you sure? " ;\ | |
echo ;\ | |
if [ "$$REPLY" == "y" ]; then \ | |
docker rm -f $(DATA_CON) 2>/dev/null || true; \ | |
fi | |
check: build | |
docker run --rm -it $(DEV_VOL) $(IMG_NAME) bash -c "cd /host; pep8 --show-source --show-pep8 /host/scripts/*.py" | |
docker run --rm -it $(DEV_VOL) $(IMG_NAME) bash -c "cd /host; pylint scripts/*.py" | |
docker run --rm -it $(DEV_VOL) $(IMG_NAME) jsonlint /host/grafana/dash.json | |
scripts/.gh-token scripts/.jira-pw: | |
@if [ ! -s $@ ]; then \ | |
read -n1 -r -p "$@ does not exist, create dummy token? "; echo; \ | |
if [ "$$REPLY" != "y" ]; then \ | |
echo "Aborting"; \ | |
exit 2; \ | |
fi \ | |
fi | |
@touch $@ | |
.PHONY: build clean stop run shell data purge check |