[jenkins-ci PATCH 4/5] make: add a simple build target that generates all dockerfiles

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is useful for local testing of docker changes, and can also be
called to rebuild the content needed for the libvirt-dockerfiles
repository.

Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
 Makefile | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/Makefile b/Makefile
index 1ba6b21..d2c89e9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,23 @@
 
+LCITOOL = guests/lcitool
+
+HOST_VARS = $(wildcard guests/host_vars/*/*.yml)
+PROJECT_VARS = $(wildcard guests/vars/projects/*.yml)
+
+all: dockerfiles
 
 syntax-check:
 	flake8 guests/lcitool
+
+.PHONY: dockerfiles
+
+DOCKERHOSTS=$(shell $(LCITOOL) hosts -d)
+
+build/dockerfiles/%.docker: Makefile $(LCITOOL) $(HOST_VARS) $(PROJECT_VARS)
+	mkdir -p build/dockerfiles
+	$(LCITOOL) dockerfile $* libvirt > $@
+
+dockerfiles: $(DOCKERHOSTS:%=build/dockerfiles/%.docker)
+
+clean:
+	rm -rf build/
-- 
2.20.1


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux