From 72f30f98de111e9f10a58829b78e51e80a5a52a5 Mon Sep 17 00:00:00 2001 From: Dan Radez Date: Wed, 23 Nov 2016 11:38:27 -0500 Subject: Adding a release RPM JIRA: APEX-351 Change-Id: I9b8b74073287005221a7a3f6dfe2d52a7d1cf667 Signed-off-by: Dan Radez --- build/Makefile | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'build/Makefile') diff --git a/build/Makefile b/build/Makefile index a542279b..ee15db33 100644 --- a/build/Makefile +++ b/build/Makefile @@ -31,7 +31,9 @@ export NETVPP_REPO := $(shell awk -F\= '/^netvpp_repo/ {print $$2}' variables.sh export NETVPP_BRANCH := $(shell awk -F\= '/^netvpp_branch/ {print $$2}' variables.sh ) export NETVPP_COMMIT := $(shell git ls-remote $(NETVPP_REPO) $(NETVPP_BRANCH) | awk '{print substr($$1,1,7)}') +export RELRPMVERS = $(shell grep Version $(shell pwd)/rpm_specs/opnfv-apex-release.spec | head -n 1 | awk '{ print $$2 }') export RPMVERS = $(shell grep Version $(shell pwd)/rpm_specs/opnfv-apex.spec | head -n 1 | awk '{ print $$2 }') +export RPMREL = $(shell pwd)/noarch/opnfv-apex-release-$(RPMVERS)-$(shell echo ${RELEASE} | tr -d '_-').noarch.rpm export RPMCOM = $(shell pwd)/noarch/opnfv-apex-common-$(RPMVERS)-$(shell echo ${RELEASE} | tr -d '_-').noarch.rpm export RPMUDR = $(shell pwd)/noarch/opnfv-apex-undercloud-$(RPMVERS)-$(shell echo ${RELEASE} | tr -d '_-').noarch.rpm export RPMODL = $(shell pwd)/noarch/opnfv-apex-$(RPMVERS)-$(shell echo ${RELEASE} | tr -d '_-').noarch.rpm @@ -54,13 +56,33 @@ images-clean: undercloud-clean overcloud-full-clean overcloud-opendaylight-clean rpms: common-rpm undercloud-rpm opendaylight-rpm onos-rpm .PHONY: rpms-check -rpms-check: common-rpm-check undercloud-rpm-check opendaylight-rpm-check onos-rpm-check +rpms-check: release-rpm-check common-rpm-check undercloud-rpm-check opendaylight-rpm-check onos-rpm-check .PHONY: rpms-clean -rpms-clean: common-rpm-clean undercloud-rpm-clean opendaylight-rpm-clean onos-rpm-clean +rpms-clean: release-rpm-clean common-rpm-clean undercloud-rpm-clean opendaylight-rpm-clean onos-rpm-clean rm -rf noarch rm -rf BUILDROOT +opnfv-apex-release.tar.gz: + pushd ../ && git archive --format=tar.gz --prefix=opnfv-apex-release-$(RELRPMVERS)/ HEAD > build/opnfv-apex-release.tar.gz + +.PHONY: release-rpm-check +release-rpm-check: opnfv-apex-release.tar.gz + rpmbuild --clean -bi -bl rpm_specs/opnfv-apex-release.spec -D '_topdir %(echo `pwd`)' -D '_builddir %(echo `pwd`)' -D '_sourcedir %(echo `pwd`)' -D '_rpmdir %(echo `pwd`)' -D '_specdir %(echo `pwd`)' -D '_srcrpmdir %(echo `pwd`)' -D "release $(shell echo $(RELEASE) | tr -d '_-')" + +.PHONY: release-rpm +release-rpm: opnfv-apex-release.tar.gz $(RPMREL) + +$(RPMREL): + @echo "Building the Apex Release RPM" + # build the release RPM + rpmbuild --clean -ba rpm_specs/opnfv-apex-release.spec -D '_topdir %(echo `pwd`)' -D '_builddir %(echo `pwd`)' -D '_sourcedir %(echo `pwd`)' -D '_rpmdir %(echo `pwd`)' -D '_specdir %(echo `pwd`)' -D '_srcrpmdir %(echo `pwd`)' -D "release $(shell echo $(RELEASE) | tr -d '_-')" + +.PHONY: release-rpm-clean +release-rpm-clean: + rm -rf opnfv-apex-release-$(RPMVERS) + rm -rf opnfv-apex-release.tar.gz + opnfv-apex-common.tar.gz: pushd ../ && git archive --format=tar.gz --prefix=opnfv-apex-common-$(RPMVERS)/ HEAD > build/opnfv-apex-common.tar.gz -- cgit 1.2.3-korg