Change in vdsm[master]: Packaging: make the auto build scripts suitable for running ...

zhshzhou at linux.vnet.ibm.com zhshzhou at linux.vnet.ibm.com
Mon Jan 21 07:00:46 UTC 2013


Zhou Zheng Sheng has uploaded a new change for review.

Change subject: Packaging: make the auto build scripts suitable for running in Jenkins
......................................................................

Packaging: make the auto build scripts suitable for running in Jenkins

1. Add a "--local" option to autobuild.sh to generate rpms in the
./rpmbuild . When runs in Jenkins, it's better to do everything under
the current working dir.

2. When checking pep8, ignore .py files generated from .py.in, because
this kind of files may contain generated long lines. When built in
Jenkins, the working path can be very long, so generated files under
./builder may contain constants for a long path.

Change-Id: I470a7eca71d6d28ef76521a2759b485b5a5cab6f
Signed-off-by: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
---
M .gitignore
M Makefile.am
M autobuild.sh
3 files changed, 27 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/38/11238/1

diff --git a/.gitignore b/.gitignore
index d36ed82..b8eb409 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,10 +15,12 @@
 build-aux/install-sh
 build-aux/missing
 build-aux/py-compile
+builder
 config.log
 config.status
 configure
 results.log
+rpmbuild
 tests/run_tests.sh
 tests/run_tests_local.sh
 vdsm-*.tar.gz
diff --git a/Makefile.am b/Makefile.am
index 48bdc5e..ba6df2a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -61,19 +61,27 @@
 	vdsm_reg \
 	$(NULL)
 
-PEP8_BLACKLIST = config.py,constants.py
+PEP8_BLACKLIST =
 
 check-local:
 	find . -path './.git' -prune -type f -o \
 		-name '*.py' -o -name '*.py.in'  | xargs $(PYFLAKES)
-	$(PEP8) --exclude="$(PEP8_BLACKLIST)" --filename '*.py,*.py.in' \
-		$(PEP8_WHITELIST)
-	@if test -f .gitignore; then \
+	PEP8_EXCLUDE="$(PEP8_BLACKLIST)" ; \
+	if test -f .gitignore; then \
 	  for i in `git ls-files \*.in`; do \
 	    if ! grep -q -x $${i%%.in} .gitignore; then \
 	      echo "Missing $${i%%.in} in .gitignore"; exit 1; fi; \
 	  done; \
-	fi;
+	  PEP8_EXCLUDE+=`find . -path './.git' -prune -type f -o -name "*.py" | \
+	    while read PYFILE; do \
+	      if [ -f "$$PYFILE.in" ]; then \
+	        printf ,\`basename "$$PYFILE"\`; \
+	      fi; \
+	    done`; \
+	fi; \
+	PEP8_EXCLUDE=$${PEP8_EXCLUDE#,} ; \
+	$(PEP8) --exclude="$$PEP8_EXCLUDE" --filename '*.py,*.py.in' \
+		$(PEP8_WHITELIST)
 
 all-local: \
 	vdsm.spec
diff --git a/autobuild.sh b/autobuild.sh
index c7a592c..cb74f86 100755
--- a/autobuild.sh
+++ b/autobuild.sh
@@ -3,6 +3,16 @@
 set -e
 set -v
 
+if [ "$1" == "--local" ]; then
+    # --prefix needs absolute directory name
+	BUILDERDIR="$(pwd)/builder"
+	RPMTOPDIR="$(pwd)/rpmbuild"
+    shift
+else
+    BUILDERDIR="$HOME/builder"
+    RPMTOPDIR="$HOME/rpmbuild"
+fi
+
 # Make things clean.
 
 test -n "$1" && RESULTS=$1 || RESULTS=results.log
@@ -10,7 +20,7 @@
 
 test -f Makefile && make -k distclean || :
 
-./autogen.sh --prefix="$AUTOBUILD_INSTALL_ROOT"
+./autogen.sh --prefix="$BUILDERDIR"
 
 # If the MAKEFLAGS envvar does not yet include a -j option,
 # add -jN where N depends on the number of processors.
@@ -50,5 +60,6 @@
   NOSE_EXCLUDE=.* rpmbuild --nodeps \
      --define "extra_release $EXTRA_RELEASE" \
      --define "_sourcedir `pwd`" \
+     --define "_topdir $RPMTOPDIR" \
      -ba --clean vdsm.spec
 fi


--
To view, visit http://gerrit.ovirt.org/11238
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I470a7eca71d6d28ef76521a2759b485b5a5cab6f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>


More information about the vdsm-patches mailing list