aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMax Resnick <max@ofmax.li>2019-12-23 07:33:40 -0800
committerMax Resnick <max@ofmax.li>2019-12-23 07:34:07 -0800
commit2aef72309b4a915f75afe6c4c350b593e4c1772b (patch)
treed060df9b2df7d953bf6cea266a95ba387ebd8bcd /Makefile
parent3ec61949c43463f7771301b9c4f4265eb15a0487 (diff)
downloadgrumpy-containers-2aef72309b4a915f75afe6c4c350b593e4c1772b.tar.gz
Initial commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile35
1 files changed, 35 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..5bdfd61
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,35 @@
+#!/usr/bin/env make
+override CONTAINERS = $(patsubst src/%,%,$(wildcard src/*))
+override REGISTRY_URL = registry.gitlab.com/grumps/grumpy-containers
+
+TAG = $(shell cat src/$(@F)/VERSION)
+
+.PHONY: all clean
+
+all: $(CONTAINERS)
+ echo "$(CONTAINERS) "
+ @echo "completed"
+
+clean:
+ rm -rf build tag release
+
+build/%:
+ docker build -t $(@F):$(TAG) -f src/$(@F)/Dockerfile src/$(@F)
+ mkdir -p build
+ echo $(TAG) >> build/$(@F)
+ @echo "$(@F) has been built"
+
+tag/%:
+ docker tag $(@F):$(TAG) $(REGISTRY_URL)/$(@F):$(TAG)
+ mkdir -p tag
+ echo $(TAG) >> tag/$(@F)
+ @echo "$(@F) has been tagged"
+
+release/%:
+ docker push $(REGISTRY_URL)/$(@F):$(TAG)
+ mkdir -p release
+ echo $(TAG) >> release/$(@F)
+ @echo "$(@F) has been pushed"
+
+%: build/% tag/% release/%
+ @echo "$(@F) has been completed"