Commit 8395b85c authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt
Browse files

prettify logging output and only show docker status messages on error

parent a32306f8
......@@ -4,6 +4,8 @@ DOCKER_REGISTRY = git-registry.hack-hro.de:443/kmohrf/docker-recipes
DOCKER_BUILD_ARGS ?=
RECIPE_FILTER ?= *
FORMAT_HIGHLIGHT = $(shell tput setaf 2 && tput bold)
FORMAT_RESET = $(shell tput sgr0)
default-target: docker-build
......@@ -14,18 +16,17 @@ list-recipes:
sort | \
grep -E '$(RECIPE_FILTER)'
set -eu && $(MAKE) -s list_recipes | while read -r recipe_path recipe_name; do \
echo "building container '$$recipe_name' from '$$recipe_path'"; \
.PHONY: docker-build
docker-build:
@set -eu && $(MAKE) -s list-recipes | while read -r recipe_path recipe_name; do \
echo "$(FORMAT_HIGHLIGHT)>>>$(FORMAT_RESET) Building container $$recipe_name from $$recipe_path..."; \
mkdir -p "$(DIR_BUILD)/$$recipe_name"; \
docker build $(DOCKER_BUILD_ARGS) \
chronic docker build $(DOCKER_BUILD_ARGS) \
--tag "$(DOCKER_REGISTRY)/$$recipe_name" \
--tag "docker-recipes/$$recipe_name" \
--file "$$recipe_path" \
$$(grep -oP '^# BUILD_FLAGS: \K(.+)$$' "$$recipe_path") \
"$(DIR_BUILD)/$$recipe_name"; \
printf "\n"; \
done
# Login into the registry in order to upload new docker images
......@@ -35,12 +36,11 @@ docker-login:
docker login $(DOCKER_REGISTRY)
set -eu && $(MAKE) -s list_recipes | while read -r recipe_path recipe_name; do \
echo "pushing container '$(DOCKER_REGISTRY)/$$recipe_name'"; \
.PHONY: docker-push
docker-push:
@set -eu && $(MAKE) -s list-recipes | while read -r recipe_path recipe_name; do \
echo "$(FORMAT_HIGHLIGHT)>>>$(FORMAT_RESET) Pushing container $(DOCKER_REGISTRY)/$$recipe_name..."; \
docker push "$(DOCKER_REGISTRY)/$$recipe_name"; \
printf "\n"; \
done
clean:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment