Change in vdsm[ovirt-3.6]: automation: add build_artifacts

phoracek at redhat.com phoracek at redhat.com
Fri Oct 2 08:57:05 UTC 2015


Hello Ondřej Svoboda, Dan Kenigsberg,

I'd like you to do a code review.  Please visit

    https://gerrit.ovirt.org/46929

to review the following change.

Change subject: automation: add build_artifacts
......................................................................

automation: add build_artifacts

Change automation structure according to new CI standard. Add
build-artifacts.sh which builds all required packages.

check-patch.sh then runs PEP8, Pyflakes and unit tests. If specfile
was changed, it tries to install created packages as well.

This patch is related to jenkins project patch:
https://gerrit.ovirt.org/#/c/46147/

Change-Id: Ia29761aa2ec920db4485bf704926b67e0d9851b1
Bug-Url: https://bugzilla.redhat.com/1268229
Signed-off-by: Petr Horáček <phoracek at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/46135
Continuous-Integration: Jenkins CI
Reviewed-by: Ondřej Svoboda <osvoboda at redhat.com>
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
A automation/build-artifacts.packages
A automation/build-artifacts.repos.el7
A automation/build-artifacts.repos.fc21
A automation/build-artifacts.repos.fc22
A automation/build-artifacts.sh
M automation/check-patch.packages
A automation/check-patch.repos.el7
A automation/check-patch.repos.fc21
A automation/check-patch.repos.fc22
M automation/check-patch.sh
10 files changed, 101 insertions(+), 54 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/29/46929/1

diff --git a/automation/build-artifacts.packages b/automation/build-artifacts.packages
new file mode 100644
index 0000000..9bf9a16
--- /dev/null
+++ b/automation/build-artifacts.packages
@@ -0,0 +1,21 @@
+autoconf
+automake
+gcc
+git
+libguestfs-tools-c
+m2crypto
+make
+mom
+policycoreutils-python
+pyflakes
+python-blivet
+python-devel
+python-ethtool
+python-inotify
+python-ioprocess
+python-netaddr
+python-nose
+python-pep8
+python-pthreading
+python-six
+rpm-build
diff --git a/automation/build-artifacts.repos.el7 b/automation/build-artifacts.repos.el7
new file mode 100644
index 0000000..8c8de34
--- /dev/null
+++ b/automation/build-artifacts.repos.el7
@@ -0,0 +1,2 @@
+ovirt-snapshot,http://resources.ovirt.org/pub/ovirt-master-snapshot/rpm/$distro
+ovirt-glusterfs-epel,http://download.gluster.org/pub/gluster/glusterfs/LATEST/EPEL.repo/epel-7/x86_64
diff --git a/automation/build-artifacts.repos.fc21 b/automation/build-artifacts.repos.fc21
new file mode 100644
index 0000000..a80e9aa
--- /dev/null
+++ b/automation/build-artifacts.repos.fc21
@@ -0,0 +1,2 @@
+ovirt-snapshot,http://resources.ovirt.org/pub/ovirt-master-snapshot/rpm/$distro
+ovirt-glusterfs-fedora,http://download.gluster.org/pub/gluster/glusterfs/LATEST/Fedora/fedora-21/x86_64
diff --git a/automation/build-artifacts.repos.fc22 b/automation/build-artifacts.repos.fc22
new file mode 100644
index 0000000..47b6979
--- /dev/null
+++ b/automation/build-artifacts.repos.fc22
@@ -0,0 +1,2 @@
+ovirt-snapshot,http://resources.ovirt.org/pub/ovirt-master-snapshot/rpm/$distro
+ovirt-glusterfs-fedora,http://download.gluster.org/pub/gluster/glusterfs/LATEST/Fedora/fedora-22/x86_64
diff --git a/automation/build-artifacts.sh b/automation/build-artifacts.sh
new file mode 100755
index 0000000..95bd421
--- /dev/null
+++ b/automation/build-artifacts.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+set -xe
+
+# prepare env
+BUILDS=$PWD/rpmbuild
+EXPORTS=$PWD/exported-artifacts
+mkdir -p "$EXPORTS"
+
+# autogen may already have been executed by check-patch.sh
+if [ ! -f Makefile ]; then
+  ./autogen.sh --system --enable-hooks
+fi
+
+make
+# tests will be done elsewhere
+make PYFLAKES=true PEP8=true NOSE_EXCLUDE=.* rpm
+
+find "$BUILDS" \
+    -iname \*.rpm \
+    -exec mv {} "$EXPORTS/" \;
+find "$PWD" \
+    -maxdepth 1 \
+    -iname vdsm\*.tar.gz \
+    -exec mv {} "$EXPORTS/" \;
diff --git a/automation/check-patch.packages b/automation/check-patch.packages
index afe7069..c608a90 100644
--- a/automation/check-patch.packages
+++ b/automation/check-patch.packages
@@ -1,51 +1,23 @@
-yum
-sudo
-dhclient
-autoreconf
-gettext-devel
-make
-automake
-pyflakes
-python-pep8
-libvirt-python
-python-blivet
-python-devel
-python-nose
-sanlock-python
-python-ordereddict
-python-pthreading
-libselinux-python
-python-ethtool
-m2crypto
-python-dmidecode
-python-netaddr
-python-inotify
-python-argparse
-git
-python-cpopen
-bridge-utils
-libguestfs-tools-c
-pyparted
-openssl
-libnl
-libtool
-gettext-devel
-python-ioprocess
 autoconf
 automake
-pyflakes
-logrotate
 gcc
-python-pep8
-libvirt-python
-python-devel
-python-nose
-rpm-build
-sanlock-python
-genisoimage
-libnl3
-policycoreutils-python
-python-simplejson
-python-blivet
-python-six
+git
+libguestfs-tools-c
+m2crypto
+make
 mom
+policycoreutils-python
+pyflakes
+python-blivet
+python-devel
+python-ethtool
+python-inotify
+python-ioprocess
+python-netaddr
+python-nose
+python-pep8
+python-pthreading
+python-six
+rpm-build
+sudo
+yum
diff --git a/automation/check-patch.repos.el7 b/automation/check-patch.repos.el7
new file mode 100644
index 0000000..86aaf02
--- /dev/null
+++ b/automation/check-patch.repos.el7
@@ -0,0 +1,4 @@
+ovirt-snapshot,http://resources.ovirt.org/pub/ovirt-master-snapshot/rpm/$distro
+ovirt-snapshot-static,http://resources.ovirt.org/pub/ovirt-master-snapshot-static/rpm/$distro
+ovirt-glusterfs-epel,http://download.gluster.org/pub/gluster/glusterfs/LATEST/EPEL.repo/epel-7/x86_64
+openstack-kilo,https://repos.fedorapeople.org/repos/openstack/openstack-kilo/el7/
diff --git a/automation/check-patch.repos.fc21 b/automation/check-patch.repos.fc21
new file mode 100644
index 0000000..16ae431
--- /dev/null
+++ b/automation/check-patch.repos.fc21
@@ -0,0 +1,3 @@
+ovirt-snapshot,http://resources.ovirt.org/pub/ovirt-master-snapshot/rpm/$distro
+ovirt-snapshot-static,http://resources.ovirt.org/pub/ovirt-master-snapshot-static/rpm/$distro
+ovirt-glusterfs-fedora,http://download.gluster.org/pub/gluster/glusterfs/LATEST/Fedora/fedora-21/x86_64
diff --git a/automation/check-patch.repos.fc22 b/automation/check-patch.repos.fc22
new file mode 100644
index 0000000..01396e5
--- /dev/null
+++ b/automation/check-patch.repos.fc22
@@ -0,0 +1,3 @@
+ovirt-snapshot,http://resources.ovirt.org/pub/ovirt-master-snapshot/rpm/$distro
+ovirt-snapshot-static,http://resources.ovirt.org/pub/ovirt-master-snapshot-static/rpm/$distro
+ovirt-glusterfs-fedora,http://download.gluster.org/pub/gluster/glusterfs/LATEST/Fedora/fedora-22/x86_64
diff --git a/automation/check-patch.sh b/automation/check-patch.sh
index 68a3083..4a29f38 100755
--- a/automation/check-patch.sh
+++ b/automation/check-patch.sh
@@ -1,16 +1,29 @@
-#!/bin/bash -e
-#
-# Run on each patch to gerrit, should be faster than check-meged and require
-# less resources but thorough enough to provide relevant feedback
+#!/bin/bash
+
+set -xe
 
 # Nose 1.3.0 and later segatult with this flag
 #export NOSE_WITH_XUNIT=1
 
 export NOSE_SKIP_STRESS_TESTS=1
+
 # this redefines 'ugly' but looks like NOSE_EXCLUDE works at test method level,
 # not at module neither at testcase level, so we have no choice but this.
-export NOSE_EXCLUDE=".*testGetBondingOptions.*|testMirroring.*|testToggleIngress|testException|testQdiscsOfDevice|testReplacePrio"
+export NOSE_EXCLUDE="\
+.*testGetBondingOptions.*|\
+testMirroring.*|\
+testToggleIngress|\
+testException|\
+testQdiscsOfDevice|\
+testReplacePrio\
+"
 
-sh -x autogen.sh --system
-make all
+./autogen.sh --system --enable-hooks
 make check
+
+./automation/build-artifacts.sh
+
+# if specfile was changed, try to install all created packages
+if git diff-tree --no-commit-id --name-only -r HEAD | grep --quiet 'vdsm.spec.in' ; then
+  yum -y install exported-artifacts/*.rpm
+fi


-- 
To view, visit https://gerrit.ovirt.org/46929
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia29761aa2ec920db4485bf704926b67e0d9851b1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Petr Horáček <phoracek at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Ondřej Svoboda <osvoboda at redhat.com>


More information about the vdsm-patches mailing list