chiark / gitweb /
Merge branch 'some-bug-fixes' into 'master'
[fdroidserver.git] / jenkins-build
index 7decda4bf0045caa6510ede7a663225be7745950..8a7ca9bdfa10c15a503e5e6338062ccc0037c797 100755 (executable)
@@ -25,46 +25,49 @@ if [ -z $ANDROID_HOME ]; then
     fi
 fi
 
+
 #------------------------------------------------------------------------------#
-# required Java 7 keytool/jarsigner for :file support
+# cache pypi downloads
+if [ -z $PIP_DOWNLOAD_CACHE ]; then
+    export PIP_DOWNLOAD_CACHE=$HOME/.pip_download_cache
+fi
 
-export PATH=/usr/lib/jvm/java-7-openjdk-amd64/bin:$PATH
 
 #------------------------------------------------------------------------------#
-# run local build
-cd $WORKSPACE/fdroidserver/getsig
-./make.sh
+# required Java 7 keytool/jarsigner for :file support
+
+export PATH=/usr/lib/jvm/java-7-openjdk-amd64/bin:$PATH
 
 
 #------------------------------------------------------------------------------#
-# run local tests
+# run local tests, don't scan fdroidserver/ project for APKs
 cd $WORKSPACE/tests
-./run-tests.sh
+./run-tests ~jenkins/workspace/[[:upper:]a-eg-z]\*
 
 
 #------------------------------------------------------------------------------#
 # test building the source tarball
 cd $WORKSPACE
-python setup.py sdist
+python2 setup.py sdist
 
 
 #------------------------------------------------------------------------------#
 # test install using site packages
 cd $WORKSPACE
 rm -rf $WORKSPACE/env
-virtualenv --system-site-packages $WORKSPACE/env
+virtualenv --python=python2 --system-site-packages $WORKSPACE/env
 . $WORKSPACE/env/bin/activate
 pip install -e $WORKSPACE
-python setup.py install
+python2 setup.py install
 
 # run tests in new pip+virtualenv install
 . $WORKSPACE/env/bin/activate
-fdroid=$WORKSPACE/env/bin/fdroid $WORKSPACE/tests/run-tests.sh
+fdroid=$WORKSPACE/env/bin/fdroid $WORKSPACE/tests/run-tests ~jenkins/
 
 
 #------------------------------------------------------------------------------#
-# run pyflakes
-pyflakes fdroid makebuildserver fdroidserver/*.py setup.py
+# run git pre-commit hook for pep8, pyflakes, etc
+sh hooks/pre-commit
 
 
 #------------------------------------------------------------------------------#
@@ -73,14 +76,16 @@ pyflakes fdroid makebuildserver fdroidserver/*.py setup.py
 cd $WORKSPACE
 set +e
 # use the virtualenv python so pylint checks against its installed libs
-    PYTHONPATH=$WORKSPACE/.pylint-plugins python /usr/bin/pylint \
+    PYTHONPATH=$WORKSPACE/.pylint-plugins python2 /usr/bin/pylint \
         --output-format=parseable --reports=n \
         --load-plugins astng_hashlib \
         fdroidserver/*.py fdroid makebuildserver setup.py > $WORKSPACE/pylint.parseable
 
 # to only tell jenkins there was an error if we got ERROR or FATAL, uncomment these:
+# running pylint in the virtualenv is causing this FATAL error, which is a bug:
+# https://bitbucket.org/logilab/pylint/issue/73/pylint-is-unable-to-import
 [ $(($? & 1)) = "1" ] && echo "FATALs found"
-[ $(($? & 2)) = "2" ] && echo "ERRORs found"
-[ $(($? & 4)) = "4" ] && echo "WARNINGs found"
+[ $(($? & 2)) = "2" ] && exit 2
+[ $(($? & 4)) = "4" ] && exit 4
 set -e