mirror of
https://git.decapod.one/brethil/dotfiles
synced 2024-11-23 20:11:31 +01:00
dev: improve makefile log readability
This commit is contained in:
parent
74dcf328aa
commit
6485af4411
32
dev/Makefile
32
dev/Makefile
|
@ -1,5 +1,18 @@
|
||||||
SHELL=/bin/bash
|
SHELL=/bin/bash
|
||||||
|
|
||||||
|
ifndef VERBOSE
|
||||||
|
.SILENT:
|
||||||
|
endif
|
||||||
|
|
||||||
|
CLEAR="\033[0m"
|
||||||
|
BOLD="\033[1m"
|
||||||
|
GREEN="\033[32m"
|
||||||
|
RED="\033[31m"
|
||||||
|
BLUE="\033[34m"
|
||||||
|
WHITE="\033[37m"
|
||||||
|
|
||||||
|
.PHONY: test_colors clean list_targets build arch archlinux run
|
||||||
|
|
||||||
all: list_targets
|
all: list_targets
|
||||||
|
|
||||||
list_targets:
|
list_targets:
|
||||||
|
@ -9,17 +22,22 @@ list_targets:
|
||||||
debian: clean build-debian run
|
debian: clean build-debian run
|
||||||
arch archlinux: clean build-arch run
|
arch archlinux: clean build-arch run
|
||||||
|
|
||||||
build-debian:
|
build: build-arch
|
||||||
|
|
||||||
|
build-debian: Dockerfile.debian
|
||||||
docker build -t brethil/dotfiles:dev -f Dockerfile.debian .
|
docker build -t brethil/dotfiles:dev -f Dockerfile.debian .
|
||||||
|
|
||||||
build-arch:
|
build-arch: Dockerfile.archlinux
|
||||||
docker build -t brethil/dotfiles:dev -f Dockerfile.archlinux .
|
docker build -t brethil/dotfiles:dev -f Dockerfile.archlinux .
|
||||||
|
|
||||||
run:
|
run: build clean
|
||||||
docker run -d --name=dotfiles-dev brethil/dotfiles:dev
|
docker run -d --name=dotfiles-dev -v ${PWD}/..:/root/.dotfiles brethil/dotfiles:dev
|
||||||
echo "*** Started container, listening on ${BOLD}${WHITE}`docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dotfiles-dev`:22${CLEAR}"
|
echo -en ${GREEN} "***" ${CLEAR} Started container, listening on ${BOLD}${WHITE}
|
||||||
|
echo -e ${msg} `docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dotfiles-dev`:22 ${CLEAR}
|
||||||
|
echo -e ${GREEN} "***" ${CLEAR} Watching logs from the container. Hit Ctrl+C to stop watching. Run \`make clean\` to stop and remove the container
|
||||||
docker logs -f dotfiles-dev
|
docker logs -f dotfiles-dev
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
docker stop dotfiles-dev || echo "no containers to stop"
|
echo -e ${GREEN} "***" ${CLEAR} Stopping and removing \"dockerfiles-dev\" container...
|
||||||
docker rm dotfiles-dev || echo "no containers to remove"
|
docker kill dotfiles-dev &>/dev/null &>/dev/null && echo -e ${GREEN} "***" ${CLEAR} Killed container: dotfiles-dev || echo -e ${BLUE} "***" ${CLEAR} no containers to stop
|
||||||
|
docker rm dotfiles-dev &>/dev/null && echo -e ${GREEN} "***" ${CLEAR} Removed container: dotfiles-dev || echo -e ${BLUE} "***" ${CLEAR} no containers to remove
|
||||||
|
|
Loading…
Reference in New Issue
Block a user