summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Radez <dradez@redhat.com>2016-11-23 16:07:49 -0500
committerDan Radez <dradez@redhat.com>2016-11-29 15:58:53 -0500
commit8ab6ced38e575d29902646eb0acd7cc4503b7d92 (patch)
tree7b30f9e882a0643af63fd8da661dcd3edf17d91b
parentc3d74dbf05ee8b0c161190b85eb1e238a69402a7 (diff)
Adding git commit to RPM releases
Preparing for better caching by adding the git hash to the rpm release We can skip building the RPMs if they are cached and would be built off the same hash JIRA: APEX-325 Change-Id: I9b0e26f123667673d126362a2501abb13830e44b Signed-off-by: Dan Radez <dradez@redhat.com>
-rw-r--r--build/Makefile117
-rwxr-xr-xbuild/overcloud-full.sh7
-rw-r--r--build/rpm_specs/networking-vpp.spec35
-rw-r--r--build/rpm_specs/openstack-congress.spec2
-rw-r--r--build/rpm_specs/openstack-tacker.spec2
-rw-r--r--build/rpm_specs/python-tackerclient.spec2
-rwxr-xr-xbuild/undercloud.sh4
-rw-r--r--build/variables.sh16
8 files changed, 93 insertions, 92 deletions
diff --git a/build/Makefile b/build/Makefile
index 226bc09f..a542279b 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -12,18 +12,36 @@ export CENTDNLD = http://mirrors.cat.pdx.edu/centos/7.2.1511/isos/x86_64/CentOS-
export CENTISO = $(shell pwd)/$(shell basename $(CENTDNLD))
export RELEASE = "0"
export ISO = $(shell pwd)/release/OPNFV-CentOS-7-x86_64-${RELEASE}.iso
+
+export RPM_DIST = $(shell rpm -E %dist)
+export TACKER_REPO = "http://github.com/trozet/tacker"
+export TACKER_BRANCH = "SFC_colorado"
+export TACKER_COMMIT := $(shell git ls-remote $(TACKER_REPO) $(TACKER_BRANCH) | awk '{print substr($$1,1,7)}')
+
+export TACKERCLIENT_REPO := $(shell awk -F\= '/^tackerclient_repo/ {print $$2}' variables.sh )
+export TACKERCLIENT_BRANCH := $(shell awk -F\= '/^tackerclient_branch/ {print $$2}' variables.sh )
+export TACKERCLIENT_COMMIT := $(shell git ls-remote $(TACKERCLIENT_REPO) $(TACKERCLIENT_BRANCH) | awk '{print substr($$1,1,7)}')
+
+export CONGRESS_REPO := $(shell awk -F\= '/^congress_repo/ {print $$2}' variables.sh )
+export CONGRESS_BRANCH := $(shell awk -F\= '/^congress_branch/ {print $$2}' variables.sh )
+export CONGRESS_COMMIT := $(shell git ls-remote $(CONGRESS_REPO) $(CONGRESS_BRANCH) | awk '{print substr($$1,1,7)}')
+
+export NETVPP_VERS := $(shell grep Version $(shell pwd)/rpm_specs/networking-vpp.spec | head -n 1 | awk '{ print $$2 }')
+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 RPMVERS = $(shell grep Version $(shell pwd)/rpm_specs/opnfv-apex.spec | head -n 1 | awk '{ print $$2 }')
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
export RPMONO = $(shell pwd)/noarch/opnfv-apex-onos-$(RPMVERS)-$(shell echo ${RELEASE} | tr -d '_-').noarch.rpm
-
.PHONY: all
all: iso
.PHONY: clean
-clean: images-clean rpms-clean iso-clean tacker-clean tackerclient-clean congress-clean vpp-clean
+clean: images-clean rpms-clean iso-clean tacker-clean tackerclient-clean congress-clean networking-vpp-clean
.PHONY: images
images: undercloud overcloud-full overcloud-opendaylight overcloud-onos
@@ -41,6 +59,7 @@ rpms-check: common-rpm-check undercloud-rpm-check opendaylight-rpm-check onos-rp
.PHONY: rpms-clean
rpms-clean: common-rpm-clean undercloud-rpm-clean opendaylight-rpm-clean onos-rpm-clean
rm -rf noarch
+ rm -rf BUILDROOT
opnfv-apex-common.tar.gz:
pushd ../ && git archive --format=tar.gz --prefix=opnfv-apex-common-$(RPMVERS)/ HEAD > build/opnfv-apex-common.tar.gz
@@ -99,15 +118,15 @@ tacker-clean:
openstack-tacker.tar.gz:
@echo "Preparing the Tacker RPM prerequisites"
- git clone http://github.com/trozet/tacker -b SFC_colorado openstack-tacker-2015.2
+ git clone $(TACKER_REPO) -b $(TACKER_BRANCH) openstack-tacker-2015.2
tar czf openstack-tacker.tar.gz openstack-tacker-2015.2
.PHONY: tacker-rpm
-tacker-rpm: openstack-tacker.tar.gz openstack-tacker-2015.2-1.trozet.noarch.rpm
+tacker-rpm: openstack-tacker.tar.gz noarch/openstack-tacker-2015.2-1.trozetgit$(TACKER_COMMIT).noarch.rpm
-openstack-tacker-2015.2-1.trozet.noarch.rpm:
+noarch/openstack-tacker-2015.2-1.trozetgit$(TACKER_COMMIT).noarch.rpm:
@echo "Building the Tacker RPM"
- rpmbuild --clean -bb --target noarch rpm_specs/openstack-tacker.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`)'
+ rpmbuild --clean -ba --target noarch rpm_specs/openstack-tacker.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 'git .trozetgit$(TACKER_COMMIT)'
#################
# TACKERCLIENT #
@@ -120,93 +139,61 @@ tackerclient-clean:
python-tackerclient.tar.gz:
@echo "Preparing the TackerClient RPM prerequisites"
- git clone http://github.com/trozet/python-tackerclient -b SFC_refactor python-tackerclient-2015.2
+ git clone $(TACKERCLIENT_REPO) -b $(TACKERCLIENT_BRANCH) python-tackerclient-2015.2
tar czf python-tackerclient.tar.gz python-tackerclient-2015.2
.PHONY: tackerclient-rpm
-tackerclient-rpm: python-tackerclient.tar.gz python-tackerclient-2015.2-1.trozet.noarch.rpm
+tackerclient-rpm: python-tackerclient.tar.gz noarch/python-tackerclient-2015.2-1.trozetgit$(TACKERCLIENT_COMMIT).noarch.rpm
-python-tackerclient-2015.2-1.trozet.noarch.rpm:
+noarch/python-tackerclient-2015.2-1.trozetgit$(TACKERCLIENT_COMMIT).noarch.rpm:
@echo "Building the TackerClient RPM"
- rpmbuild --clean -bb --target noarch rpm_specs/python-tackerclient.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`)'
+ rpmbuild --clean -ba --target noarch rpm_specs/python-tackerclient.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 'git .trozetgit$(TACKERCLIENT_COMMIT)'
###############
# CONGRESS #
###############
.PHONY: congress-clean
-
congress-clean:
@rm -rf openstack-congress-2016.1
@rm -f openstack-congress.tar.gz
openstack-congress.tar.gz:
@echo "Preparing the Congress RPM prerequisites"
- git clone http://github.com/openstack/congress -b stable/mitaka openstack-congress-2016.1
+ git clone $(CONGRESS_REPO) -b $(CONGRESS_BRANCH) openstack-congress-2016.1
cd openstack-congress-2016.1 && curl -O https://radez.fedorapeople.org/openstack-congress.service
tar czf openstack-congress.tar.gz openstack-congress-2016.1
.PHONY: congress-rpm
-congress-rpm: openstack-congress.tar.gz openstack-congress-2016.1-1.noarch.rpm
+congress-rpm: openstack-congress.tar.gz noarch/openstack-congress-2016.1-1.git$(CONGRESS_COMMIT).noarch.rpm
-openstack-congress-2016.1-1.noarch.rpm:
+
+noarch/openstack-congress-2016.1-1.git$(CONGRESS_COMMIT).noarch.rpm:
@echo "Building the Congress RPM"
- rpmbuild --clean -bb --target noarch rpm_specs/openstack-congress.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`)'
+ rpmbuild --clean -ba --target noarch rpm_specs/openstack-congress.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 'git .git$(CONGRESS_COMMIT)'
-###############
-# VPP #
-###############
+##################
+# NETWORKING-VPP #
+##################
-VPP_DIR = vpp
-MAVEN = apache-maven-3.3.9
-MAVEN_FILE = $(MAVEN)-bin.tar.gz
-
-.PHONY: vpp-clean
-vpp-clean:
- @rm -f vpp-bin.tar.gz
- @rm -rf vpp-bin vpp
- @rm -rf honeycomb $(MAVEN) $(MAVEN_FILE) honeycomb-1.0.0-99.noarch.rpm
- @rm -rf networking-vpp networking-vpp.noarch.rpm
-
-.PHONY: vpp-build
-vpp-build: vpp-bin.tar.gz
-
-vpp-bin.tar.gz: vpp honeycomb $(MAVEN)
- $(MAKE) -C $(VPP_DIR) UNATTENDED=yes install-dep bootstrap build pkg-rpm
- $(MAKE) -C $(VPP_DIR)/build-root PLATFORM=vpp TAG=vpp_debug vpp-api-install
- pushd vpp/vpp-api/python && python setup.py bdist
- pushd vpp/build-root/build-vpp-native/vpp-api/java/ && ../../../../../$(MAVEN)/bin/mvn install:install-file -Dfile=jvpp-registry-16.12.jar -DgroupId=io.fd.vpp -DartifactId=jvpp-registry -Dversion=16.12-SNAPSHOT -Dpackaging=jar
- pushd vpp/build-root/build-vpp-native/vpp-api/java/ && ../../../../../$(MAVEN)/bin/mvn install:install-file -Dfile=jvpp-core-16.12.jar -DgroupId=io.fd.vpp -DartifactId=jvpp-core -Dversion=16.12-SNAPSHOT -Dpackaging=jar
- pushd honeycomb && ../$(MAVEN)/bin/mvn clean install -DskipTests
- pushd honeycomb/packaging/rpm/ && BUILD_NUMBER=99 ./rpmbuild.sh
- mkdir vpp-bin
- mv vpp/build-root/*.rpm vpp-bin/
- mv honeycomb/packaging/rpm/RPMS/noarch/*.rpm .
- mv vpp/vpp-api/python/dist/*.tar.gz vpp-bin/
- tar czf vpp-bin.tar.gz vpp-bin
-
-vpp:
- git clone https://gerrit.fd.io/r/vpp
-
-honeycomb:
- git clone https://gerrit.fd.io/r/p/honeycomb.git
-
-$(MAVEN): $(MAVEN_FILE)
- tar zxvf apache-maven-3.3.9-bin.tar.gz
- cp mvn_settings.xml $(MAVEN)/conf/settings.xml
-
-$(MAVEN_FILE):
- wget http://www.webhostingjams.com/mirror/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
+.PHONY: networking-vpp-clean
+networking-vpp-clean:
+ @rm -rf networking-vpp
+ @rm -rf networking-vpp-*
+ @rm -f networking-vpp.tar.gz
+ @rm -f networking-vpp-agent.service
-.PHONY: networking-vpp-rpm
-networking-vpp-rpm: networking-vpp.noarch.rpm
+networking-vpp.tar.gz:
+ @echo "Preparing the networking-vpp RPM prerequisites"
+ git clone $(NETVPP_REPO) networking-vpp-$(NETVPP_VERS)
+ tar czf networking-vpp.tar.gz networking-vpp-$(NETVPP_VERS)
-networking-vpp.noarch.rpm: networking-vpp
- pushd networking-vpp && rpmbuild --clean -bb ../rpm_specs/networking-vpp.spec
- mv networking-vpp/build/rpm/noarch/*.rpm networking-vpp.noarch.rpm
+.PHONY: networking-vpp-rpm
+networking-vpp-rpm: noarch/networking-vpp-$(NETVPP_VERS)-1.git$(NETVPP_COMMIT)$(RPM_DIST).noarch.rpm
-networking-vpp:
- git clone https://git.openstack.org/openstack/networking-vpp
+noarch/networking-vpp-$(NETVPP_VERS)-1.git$(NETVPP_COMMIT)$(RPM_DIST).noarch.rpm: networking-vpp.tar.gz
+ @echo "Building the Networking VPP RPM"
+ rpmbuild --clean -ba --target noarch rpm_specs/networking-vpp.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 'git .git$(NETVPP_COMMIT)'
###############
# UNDERCLOUD #
diff --git a/build/overcloud-full.sh b/build/overcloud-full.sh
index 95a7b04e..188c40e4 100755
--- a/build/overcloud-full.sh
+++ b/build/overcloud-full.sh
@@ -113,7 +113,8 @@ LIBGUESTFS_BACKEND=direct virt-customize \
--upload /tmp/fdio.repo:/etc/yum.repos.d/fdio.repo \
$dpdk_pkg_str \
--run-command "yum install --downloadonly --downloaddir=/root/fdio vpp vpp-devel vpp-lib vpp-python-api vpp-plugins" \
- --upload ../networking-vpp.noarch.rpm:/root/fdio \
+ $fdio_pkg_str \
+ --upload ../noarch/$netvpp_pkg:/root/fdio \
--run-command "pip install distro flask_restful" \
--run-command "yum install -y etcd" \
--run-command "pip install python-etcd" \
@@ -124,8 +125,8 @@ LIBGUESTFS_BACKEND=direct virt-customize \
--run-command "yum remove -y qemu-system-x86" \
--upload ../os-net-config.tar.gz:/usr/lib/python2.7/site-packages \
--run-command "cd /usr/lib/python2.7/site-packages/ && rm -rf os_net_config && tar xzf os-net-config.tar.gz" \
- --upload ../noarch/$openstack_congress_pkg:/root/ \
- --install /root/$openstack_congress_pkg \
+ --upload ../noarch/$congress_pkg:/root/ \
+ --install /root/$congress_pkg \
--install "python2-congressclient" \
--upload puppet-congress.tar.gz:/etc/puppet/modules/ \
--run-command "cd /etc/puppet/modules/ && tar xzf puppet-congress.tar.gz" \
diff --git a/build/rpm_specs/networking-vpp.spec b/build/rpm_specs/networking-vpp.spec
index 2fd4e049..fea66eb8 100644
--- a/build/rpm_specs/networking-vpp.spec
+++ b/build/rpm_specs/networking-vpp.spec
@@ -1,26 +1,25 @@
-%define name networking-vpp
-%define version %(python setup.py --version)
%define release 1
-%define _topdir %(pwd)/build/rpm
-%define _builddir %(pwd)
-%define _rpmdir %(pwd)/build/rpm
-
-Summary: OpenStack Networking for VPP
-Name: %{name}
-Version: %{version}
-Release: %{release}
-License: Apache 2.0
-Group: Development/Libraries
+
+Summary: OpenStack Networking for VPP
+Name: networking-vpp
+Version: 0.0.1
+Release: %{release}%{?git}%{?dist}
+
+License: Apache 2.0
+Group: Applications/Internet
+Source0: networking-vpp.tar.gz
+Url: https://github.com/openstack/networking-vpp/
+
BuildArch: noarch
-Requires: vpp
-Vendor: OpenStack <openstack-dev@lists.openstack.org>
-Packager: Feng Pan <fpan@redhat.com>
-Url: http://www.openstack.org/
+Requires: vpp
+Vendor: OpenStack <openstack-dev@lists.openstack.org>
+Packager: Feng Pan <fpan@redhat.com>
%description
ML2 Mechanism driver and small control plane for OpenVPP forwarder
%prep
+%setup -q
cat << EOF > %{_builddir}/networking-vpp-agent.service
[Unit]
Description=Networking VPP ML2 Agent
@@ -38,12 +37,12 @@ WantedBy=multi-user.target
EOF
%install
-/usr/bin/python setup.py install -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
+python setup.py install -O1 --root=%{buildroot} --record=INSTALLED_FILES
mkdir -p %{buildroot}/usr/lib/systemd/system
install %{_builddir}/networking-vpp-agent.service %{buildroot}/usr/lib/systemd/system
%clean
-rm -rf $RPM_BUILD_ROOT
+rm -rf %{buildroot}
%files -f INSTALLED_FILES
%defattr(-,root,root)
diff --git a/build/rpm_specs/openstack-congress.spec b/build/rpm_specs/openstack-congress.spec
index c4c04a97..fd8e95ef 100644
--- a/build/rpm_specs/openstack-congress.spec
+++ b/build/rpm_specs/openstack-congress.spec
@@ -2,7 +2,7 @@
Name: openstack-congress
Version: 2016.1
-Release: 1%{?dist}
+Release: 1%{?git}%{?dist}
Summary: OpenStack servicevm/device manager
Group: Applications/Internet
diff --git a/build/rpm_specs/openstack-tacker.spec b/build/rpm_specs/openstack-tacker.spec
index b4c9adaa..b491cd1e 100644
--- a/build/rpm_specs/openstack-tacker.spec
+++ b/build/rpm_specs/openstack-tacker.spec
@@ -2,7 +2,7 @@
Name: openstack-tacker
Version: 2015.2
-Release: 1.trozet
+Release: 1%{?git}
Summary: OpenStack servicevm/device manager
Group: Applications/Internet
diff --git a/build/rpm_specs/python-tackerclient.spec b/build/rpm_specs/python-tackerclient.spec
index 72cbf629..aa379361 100644
--- a/build/rpm_specs/python-tackerclient.spec
+++ b/build/rpm_specs/python-tackerclient.spec
@@ -2,7 +2,7 @@
Name: python-tackerclient
Version: 2015.2
-Release: 1.trozet
+Release: 1%{?git}
Summary: CLI and Client Library for OpenStack Networking
Group: Applications/Internet
diff --git a/build/undercloud.sh b/build/undercloud.sh
index a2bb9c60..39885faf 100755
--- a/build/undercloud.sh
+++ b/build/undercloud.sh
@@ -54,8 +54,8 @@ LIBGUESTFS_BACKEND=direct virt-customize \
--run-command "sed -i '/PASSWORD_NAMES =/a\\ \"OVERCLOUD_TACKER_PASSWORD\",' /usr/lib/python2.7/site-packages/tripleoclient/utils.py" \
--run-command "sed -i '/AodhPassword/a\\ parameters\[\x27TackerPassword\x27\] = passwords\[\x27OVERCLOUD_TACKER_PASSWORD\x27\]' /usr/lib/python2.7/site-packages/tripleoclient/v1/overcloud_deploy.py" \
--run-command "sed -i '/^SERVICES/a\ \x27tacker\x27: {\x27description\x27: \x27Tacker Service\x27, \x27type\x27: \x27servicevm\x27, \x27path\x27: \x27/\x27, \x27port\x27: 8888 },' /usr/lib/python2.7/site-packages/os_cloud_config/keystone.py" \
- --upload ../noarch/python-tackerclient-2015.2-1.trozet.noarch.rpm:/root/ \
- --install /root/python-tackerclient-2015.2-1.trozet.noarch.rpm \
+ --upload ../noarch/$tackerclient_pkg:/root/ \
+ --install /root/$tackerclient_pkg \
--install "python2-aodhclient" \
--install "openstack-heat-engine" \
--install "openstack-heat-api-cfn" \
diff --git a/build/variables.sh b/build/variables.sh
index c307c84c..c8754379 100644
--- a/build/variables.sh
+++ b/build/variables.sh
@@ -14,7 +14,6 @@ onos_release_file=onos-1.6.0-rc2.tar.gz
onos_jdk_uri=http://artifacts.opnfv.org/apex/colorado
onos_ovs_uri=http://artifacts.opnfv.org/apex/colorado
onos_ovs_pkg=package_ovs_rpm3.tar.gz
-openstack_congress_pkg="openstack-congress-2016.1-1$(rpm -E '%dist').noarch.rpm"
doctor_driver=https://raw.githubusercontent.com/openstack/congress/master/congress/datasources/doctor_driver.py
if [ -z ${GS_PATHNAME+x} ]; then
GS_PATHNAME=/colorado
@@ -27,3 +26,18 @@ dpdk_rpms=(
'ovs4opnfv-e8acab14-dpdk-tools-16.04.0-1.el7.centos.x86_64.rpm'
'ovs4opnfv-e8acab14-openvswitch-2.5.90-0.12032.gitc61e93d6.1.el7.centos.x86_64.rpm'
)
+
+tackerclient_repo="http://github.com/trozet/python-tackerclient"
+tackerclient_branch="SFC_refactor"
+tackerclient_commit=$(git ls-remote ${tackerclient_repo} ${tackerclient_branch} | awk '{print substr($$1,1,7)}')
+tackerclient_pkg=python-tackerclient-2015.2-1.trozetgit${tackerclient_commit}.noarch.rpm
+
+congress_repo="http://github.com/openstack/congress"
+congress_branch="stable/mitaka"
+congress_commit=$(git ls-remote ${congress_repo} ${congress_branch} | awk '{print substr($$1,1,7)}')
+congress_pkg=openstack-congress-2016.1-1.git${congress_commit}$(rpm -E %dist).noarch.rpm
+
+netvpp_repo="https://github.com/openstack/networking-vpp"
+netvpp_branch="master"
+netvpp_commit=$(git ls-remote ${netvpp_repo} ${netvpp_branch} | awk '{print substr($$1,1,7)}')
+netvpp_pkg=networking-vpp-0.0.1-1.git${NETVPP_COMMIT}$(rpm -E %dist).noarch.rpm