build: refactor Makefile

Use a single one with dynamically generated rules instead of individual
makefiles which are 99% boilerplate.
pull/852/head
Saúl Ibarra Corretgé 4 years ago
parent b00f92ae19
commit 43f678d967
  1. 9
      Makefile
  2. 4
      base-java/Makefile
  3. 4
      base/Makefile
  4. 4
      jibri/Makefile
  5. 4
      jicofo/Makefile
  6. 4
      jigasi/Makefile
  7. 4
      jvb/Makefile
  8. 4
      prosody/Makefile
  9. 4
      web/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))

@ -1,4 +0,0 @@
build:
docker build $(BUILD_ARGS) -t $(JITSI_REPO)/base-java .
.PHONY: build

@ -1,4 +0,0 @@
build:
docker build $(BUILD_ARGS) --build-arg JITSI_RELEASE=$(JITSI_RELEASE) -t $(JITSI_REPO)/base .
.PHONY: build

@ -1,4 +0,0 @@
build:
docker build $(BUILD_ARGS) -t $(JITSI_REPO)/jibri .
.PHONY: build

@ -1,4 +0,0 @@
build:
docker build $(BUILD_ARGS) -t $(JITSI_REPO)/jicofo .
.PHONY: build

@ -1,4 +0,0 @@
build:
docker build $(BUILD_ARGS) -t $(JITSI_REPO)/jigasi .
.PHONY: build

@ -1,4 +0,0 @@
build:
docker build $(BUILD_ARGS) -t $(JITSI_REPO)/jvb .
.PHONY: build

@ -1,4 +0,0 @@
build:
docker build $(BUILD_ARGS) -t $(JITSI_REPO)/prosody .
.PHONY: build

@ -1,4 +0,0 @@
build:
docker build $(BUILD_ARGS) -t $(JITSI_REPO)/web .
.PHONY: build
Loading…
Cancel
Save