Merge pull request #134 from jose-bigio/make_image_tars

Add tar targets for engine image
Upstream-commit: d645291be026da9e2aab9906e0d0918d0799c3f3
Component: packaging
This commit is contained in:
Eli Uriegas
2018-08-07 13:47:31 -07:00
committed by GitHub
3 changed files with 27 additions and 14 deletions

View File

@ -28,6 +28,10 @@ clean: ## remove build artifacts
[ ! -d debbuild ] || $(CHOWN) -R $(shell id -u):$(shell id -g) debbuild
$(RM) -r debbuild
engine-$(ARCH).tar:
$(MAKE) -C ../image image-linux
docker save -o $@ $$(cat ../image/image-linux)
.PHONY: deb
deb: ubuntu debian raspbian ## build all deb packages
@ -41,49 +45,49 @@ debian: debian-stretch debian-jessie ## build all debian deb packages
raspbian: raspbian-stretch debian-jessie ## build all raspbian deb packages
.PHONY: ubuntu-xenial
ubuntu-xenial: ## build ubuntu xenial deb packages
ubuntu-xenial: engine-$(ARCH).tar ## build ubuntu xenial deb packages
$(BUILD)
$(RUN)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
.PHONY: ubuntu-trusty
ubuntu-trusty: ## build ubuntu trusty deb packages
ubuntu-trusty: engine-$(ARCH).tar ## build ubuntu trusty deb packages
$(BUILD)
$(RUN)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
.PHONY: ubuntu-bionic
ubuntu-bionic: ## build ubuntu bionic deb packages
ubuntu-bionic: engine-$(ARCH).tar ## build ubuntu bionic deb packages
$(BUILD)
$(RUN)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
.PHONY: debian-buster
debian-buster: ## build debian buster deb packages
debian-buster: engine-$(ARCH).tar ## build debian buster deb packages
$(BUILD)
$(RUN)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
.PHONY: debian-jessie
debian-jessie: ## build debian jessie deb packages
debian-jessie: engine-$(ARCH).tar ## build debian jessie deb packages
$(BUILD)
$(RUN)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
.PHONY: debian-stretch
debian-stretch: ## build debian stretch deb packages
debian-stretch: engine-$(ARCH).tar ## build debian stretch deb packages
$(BUILD)
$(RUN)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
.PHONY: raspbian-jessie
raspbian-jessie: ## build raspbian jessie deb packages
raspbian-jessie: engine-$(ARCH).tar ## build raspbian jessie deb packages
$(BUILD)
$(RUN)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
.PHONY: raspbian-stretch
raspbian-stretch: ## build raspbian stretch deb packages
raspbian-stretch: engine-$(ARCH).tar ## build raspbian stretch deb packages
$(BUILD)
$(RUN)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@

View File

@ -4,7 +4,7 @@ CLI_DIR:=$(CURDIR)/../../cli
VERSION?=0.0.0-dev
STATIC_VERSION=$(shell ../static/gen-static-ver $(ENGINE_DIR) $(VERSION))
DOCKER_HUB_ORG?=docker
ARCH=$(uname -m)
ARCH=$(shell uname -m)
ENGINE_IMAGE?=engine-community
.PHONY: help
@ -14,6 +14,7 @@ help: ## show make targets
.PHONY: clean
clean: ## remove build artifacts
-docker rmi $(DOCKER_HUB_ORG)/$(ENGINE_IMAGE):$(STATIC_VERSION)
-rm -f image-linux
.PHONY: image
image: image-linux
@ -24,12 +25,16 @@ $(ENGINE_DIR)/Dockerfile.engine:
# builds across multiple archs because the base images
# utilize manifests
.PHONY: image-linux
image-linux: $(ENGINE_DIR)/Dockerfile.engine
docker build -t $(DOCKER_HUB_ORG)/$(ENGINE_IMAGE):$(STATIC_VERSION).$(ARCH) \
--build-arg VERSION=$(STATIC_VERSION) \
--build-arg DOCKER_GITCOMMIT=$(cd $(ENGINE_DIR) && git rev-parse --short=7 HEAD) \
--build-arg DOCKER_GITCOMMIT=$$(cd $(ENGINE_DIR) && git rev-parse --short=7 HEAD) \
--file $< $(ENGINE_DIR)
echo $(DOCKER_HUB_ORG)/$(ENGINE_IMAGE):$(STATIC_VERSION).$(ARCH) > $@
engine-$(ARCH).tar: image-linux
docker save -o $@ $$(cat $<)
.PHONY: release
release:

View File

@ -40,20 +40,24 @@ fedora: fedora-28 fedora-27 fedora-26 ## build all fedora rpm packages
.PHONY: centos
centos: centos-7 ## build all centos rpm packages
engine-$(ARCH).tar:
$(MAKE) -C ../image image-linux
docker save -o $@ $$(cat ../image/image-linux)
.PHONY: fedora-28
fedora-28: rpmbuild/SOURCES/engine.tgz rpmbuild/SOURCES/cli.tgz ## build fedora-28 rpm packages
fedora-28: engine-$(ARCH).tar rpmbuild/SOURCES/engine.tgz rpmbuild/SOURCES/cli.tgz ## build fedora-28 rpm packages
docker build --build-arg GO_VERSION=$(GO_VERSION) -t rpmbuild-$@/$(ARCH) -f $@/Dockerfile.$(ARCH) $@
$(RPMBUILD) rpmbuild-$@/$(ARCH) $(RPMBUILD_FLAGS)
$(CHOWN) -R $(shell id -u):$(shell id -g) rpmbuild
.PHONY: fedora-27
fedora-27: rpmbuild/SOURCES/engine.tgz rpmbuild/SOURCES/cli.tgz ## build fedora-27 rpm packages
fedora-27:engine-$(ARCH).tar rpmbuild/SOURCES/engine.tgz rpmbuild/SOURCES/cli.tgz ## build fedora-27 rpm packages
docker build --build-arg GO_VERSION=$(GO_VERSION) -t rpmbuild-$@/$(ARCH) -f $@/Dockerfile.$(ARCH) $@
$(RPMBUILD) rpmbuild-$@/$(ARCH) $(RPMBUILD_FLAGS)
$(CHOWN) -R $(shell id -u):$(shell id -g) rpmbuild
.PHONY: centos-7
centos-7: rpmbuild/SOURCES/engine.tgz rpmbuild/SOURCES/cli.tgz ## build centos-7 rpm packages
centos-7:engine-$(ARCH).tar rpmbuild/SOURCES/engine.tgz rpmbuild/SOURCES/cli.tgz ## build centos-7 rpm packages
docker build --build-arg GO_VERSION=$(GO_VERSION) -t rpmbuild-$@/$(ARCH) -f $@/Dockerfile.$(ARCH) $@
$(RPMBUILD) rpmbuild-$@/$(ARCH) $(RPMBUILD_FLAGS)
$(CHOWN) -R $(shell id -u):$(shell id -g) rpmbuild