diff --git a/Jenkinsfile b/Jenkinsfile index a4830ee131..45daa90e12 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,7 +29,7 @@ test_steps = [ sh("git -C cli checkout $branch") sh('git clone https://github.com/docker/engine.git') sh("git -C engine checkout $branch") - sh('make VERSION=0.0.1-dev DOCKER_BUILD_PKGS=ubuntu-xenial ENGINE_DIR=$(pwd)/engine CLI_DIR=$(pwd)/cli deb') + sh('make -C deb VERSION=0.0.1-dev ENGINE_DIR=$(pwd)/engine CLI_DIR=$(pwd)/cli ubuntu-xenial') } } }, @@ -41,7 +41,7 @@ test_steps = [ sh("git -C cli checkout $branch") sh('git clone https://github.com/docker/engine.git') sh("git -C engine checkout $branch") - sh('make VERSION=0.0.1-dev DOCKER_BUILD_PKGS=centos-7 ENGINE_DIR=$(pwd)/engine CLI_DIR=$(pwd)/cli rpm') + sh('make -C rpm VERSION=0.0.1-dev ENGINE_DIR=$(pwd)/engine CLI_DIR=$(pwd)/cli centos-7') } } }, diff --git a/Makefile b/Makefile index 5147089232..bf786929da 100644 --- a/Makefile +++ b/Makefile @@ -36,18 +36,12 @@ clean: clean-image ## remove build artifacts $(MAKE) -C static clean .PHONY: rpm -rpm: DOCKER_BUILD_PKGS:=$(shell find rpm -type d | grep ".*-.*" | sed 's/^rpm\///') rpm: ## build rpm packages - for p in $(DOCKER_BUILD_PKGS); do \ - $(MAKE) -C $@ VERSION=$(VERSION) ENGINE_DIR=$(ENGINE_DIR) CLI_DIR=$(CLI_DIR) GO_VERSION=$(GO_VERSION) $${p}; \ - done + $(MAKE) -C $@ VERSION=$(VERSION) ENGINE_DIR=$(ENGINE_DIR) CLI_DIR=$(CLI_DIR) GO_VERSION=$(GO_VERSION) rpm .PHONY: deb -deb: DOCKER_BUILD_PKGS:=$(shell find deb -type d | grep ".*-.*" | sed 's/^deb\///') deb: ## build deb packages - for p in $(DOCKER_BUILD_PKGS); do \ - $(MAKE) -C $@ VERSION=$(VERSION) ENGINE_DIR=$(ENGINE_DIR) CLI_DIR=$(CLI_DIR) GO_VERSION=$(GO_VERSION) $${p}; \ - done + $(MAKE) -C $@ VERSION=$(VERSION) ENGINE_DIR=$(ENGINE_DIR) CLI_DIR=$(CLI_DIR) GO_VERSION=$(GO_VERSION) deb .PHONY: static static: DOCKER_BUILD_PKGS:=static-linux cross-mac cross-win cross-arm diff --git a/deb/Makefile b/deb/Makefile index 55391eceab..2a6f5b3572 100644 --- a/deb/Makefile +++ b/deb/Makefile @@ -38,6 +38,11 @@ RUN=docker run --rm -i \ SOURCE_FILES=engine-image cli.tgz engine.tgz docker.service docker.socket distribution_based_engine.json plugin-installers.tgz SOURCES=$(addprefix sources/, $(SOURCE_FILES)) +DEBIAN_VERSIONS := debian-stretch debian-buster +UBUNTU_VERSIONS := ubuntu-xenial ubuntu-bionic ubuntu-cosmic ubuntu-disco +RASPBIAN_VERSIONS := raspbian-stretch raspbian-buster +DISTROS := $(DEBIAN_VERSIONS) $(UBUNTU_VERSIONS) $(RASPBIAN_VERSIONS) + .PHONY: help help: ## show make targets @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) @@ -55,34 +60,20 @@ engine-$(ARCH).tar: docker save -o $@ $$(cat ../image/image-linux) .PHONY: deb -deb: ubuntu debian raspbian ## build all deb packages +deb: ubuntu debian ## build all deb packages except for raspbian .PHONY: ubuntu -ubuntu: ubuntu-bionic ubuntu-xenial ## build all ubuntu deb packages +ubuntu: $(UBUNTU_VERSIONS) ## build all ubuntu deb packages .PHONY: debian -debian: debian-stretch debian-buster ## build all debian deb packages +debian: $(DEBIAN_VERSIONS) ## build all debian deb packages .PHONY: raspbian -raspbian: raspbian-stretch raspbian-buster ## build all raspbian deb packages - -.PHONY: ubuntu-% -## build ubuntu deb packages -ubuntu-%: $(SOURCES) - $(BUILD) - $(RUN) - $(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@ - -.PHONY: debian-% -## build debian deb packages -debian-%: $(SOURCES) - $(BUILD) - $(RUN) - $(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@ +raspbian: $(RASPBIAN_VERSIONS) ## build all raspbian deb packages -.PHONY: raspbian-% -## build raspbian deb packages -raspbian-%: $(SOURCES) +.PHONY: $(DISTROS) +$(DISTROS): $(SOURCES) + @echo "== Building packages for $@ ==" $(BUILD) $(RUN) $(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@ diff --git a/rpm/Makefile b/rpm/Makefile index d861f92445..710919edad 100644 --- a/rpm/Makefile +++ b/rpm/Makefile @@ -42,6 +42,9 @@ RUN?=$(RPMBUILD) rpmbuild-$@/$(ARCH) $(RPMBUILD_FLAGS) SOURCE_FILES=engine-image engine.tgz cli.tgz docker.service docker.socket distribution_based_engine.json plugin-installers.tgz SOURCES=$(addprefix rpmbuild/SOURCES/, $(SOURCE_FILES)) +FEDORA_RELEASES := fedora-31 fedora-30 fedora-29 fedora-28 +CENTOS_RELEASES := centos-7 + .PHONY: help help: ## show make targets @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) @@ -61,22 +64,14 @@ clean: ## remove build artifacts rpm: fedora centos ## build all rpm packages .PHONY: fedora -fedora: fedora-31 fedora-30 fedora-29 fedora-28 ## build all fedora rpm packages +fedora: $(FEDORA_RELEASES) ## build all fedora rpm packages .PHONY: centos -centos: centos-7 ## build all centos rpm packages - -.PHONY: fedora-% -fedora-%: ## build fedora rpm packages -fedora-%: $(SOURCES) - $(CHOWN) -R root:root rpmbuild - $(BUILD) - $(RUN) - $(CHOWN) -R $(shell id -u):$(shell id -g) rpmbuild +centos: $(CENTOS_RELEASES) ## build all centos rpm packages -.PHONY: centos-7 -centos-7: ## build centos-7 rpm packages -centos-7: $(SOURCES) +.PHONY: $(FEDORA_RELEASES) $(CENTOS_RELEASES) +$(FEDORA_RELEASES) $(CENTOS_RELEASES): $(SOURCES) + @echo "== Building packages for $@ ==" $(CHOWN) -R root:root rpmbuild $(BUILD) $(RUN)