From 43f678d96786414bfb98d17144ef684a4e08755e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Wed, 2 Dec 2020 09:51:59 +0100 Subject: [PATCH] build: refactor Makefile Use a single one with dynamically generated rules instead of individual makefiles which are 99% boilerplate. --- Makefile | 9 ++++++--- base-java/Makefile | 4 ---- base/Makefile | 4 ---- jibri/Makefile | 4 ---- jicofo/Makefile | 4 ---- jigasi/Makefile | 4 ---- jvb/Makefile | 4 ---- prosody/Makefile | 4 ---- web/Makefile | 4 ---- 9 files changed, 6 insertions(+), 35 deletions(-) delete mode 100644 base-java/Makefile delete mode 100644 base/Makefile delete mode 100644 jibri/Makefile delete mode 100644 jicofo/Makefile delete mode 100644 jigasi/Makefile delete mode 100644 jvb/Makefile delete mode 100644 prosody/Makefile delete mode 100644 web/Makefile diff --git a/Makefile b/Makefile index 8b3de05..08ec3a9 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ JITSI_BUILD ?= latest JITSI_REPO ?= jitsi JITSI_SERVICES ?= base base-java web prosody jicofo jvb jigasi jibri -BUILD_ARGS := --build-arg JITSI_REPO=$(JITSI_REPO) +BUILD_ARGS := --build-arg JITSI_REPO=$(JITSI_REPO) --build-arg JITSI_RELEASE=$(JITSI_RELEASE) ifeq ($(FORCE_REBUILD), 1) BUILD_ARGS := $(BUILD_ARGS) --no-cache endif @@ -15,7 +15,10 @@ all: build-all release: tag-all push-all build: - $(MAKE) BUILD_ARGS="$(BUILD_ARGS)" JITSI_REPO="$(JITSI_REPO)" JITSI_RELEASE="$(JITSI_RELEASE)" -C $(JITSI_SERVICE) build + docker build $(BUILD_ARGS) --progress plain --tag $(JITSI_REPO)/$(JITSI_SERVICE) $(JITSI_SERVICE)/ + +$(addprefix build_,$(JITSI_SERVICES)): + $(MAKE) --no-print-directory JITSI_SERVICE=$(patsubst build_%,%,$@) build tag: docker tag $(JITSI_REPO)/$(JITSI_SERVICE):latest $(JITSI_REPO)/$(JITSI_SERVICE):$(JITSI_BUILD) @@ -36,4 +39,4 @@ prepare: docker pull debian:buster-slim FORCE_REBUILD=1 $(MAKE) -.PHONY: all build tag push clean prepare release +.PHONY: all build tag push clean prepare release $(addprefix build_,$(JITSI_SERVICES)) diff --git a/base-java/Makefile b/base-java/Makefile deleted file mode 100644 index d819a6f..0000000 --- a/base-java/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -build: - docker build $(BUILD_ARGS) -t $(JITSI_REPO)/base-java . - -.PHONY: build diff --git a/base/Makefile b/base/Makefile deleted file mode 100644 index 4754b51..0000000 --- a/base/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -build: - docker build $(BUILD_ARGS) --build-arg JITSI_RELEASE=$(JITSI_RELEASE) -t $(JITSI_REPO)/base . - -.PHONY: build diff --git a/jibri/Makefile b/jibri/Makefile deleted file mode 100644 index c69ae8e..0000000 --- a/jibri/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -build: - docker build $(BUILD_ARGS) -t $(JITSI_REPO)/jibri . - -.PHONY: build diff --git a/jicofo/Makefile b/jicofo/Makefile deleted file mode 100644 index e2bbddf..0000000 --- a/jicofo/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -build: - docker build $(BUILD_ARGS) -t $(JITSI_REPO)/jicofo . - -.PHONY: build diff --git a/jigasi/Makefile b/jigasi/Makefile deleted file mode 100644 index d362e53..0000000 --- a/jigasi/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -build: - docker build $(BUILD_ARGS) -t $(JITSI_REPO)/jigasi . - -.PHONY: build diff --git a/jvb/Makefile b/jvb/Makefile deleted file mode 100644 index 5f3469d..0000000 --- a/jvb/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -build: - docker build $(BUILD_ARGS) -t $(JITSI_REPO)/jvb . - -.PHONY: build diff --git a/prosody/Makefile b/prosody/Makefile deleted file mode 100644 index a7225ae..0000000 --- a/prosody/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -build: - docker build $(BUILD_ARGS) -t $(JITSI_REPO)/prosody . - -.PHONY: build diff --git a/web/Makefile b/web/Makefile deleted file mode 100644 index 8b203e2..0000000 --- a/web/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -build: - docker build $(BUILD_ARGS) -t $(JITSI_REPO)/web . - -.PHONY: build