6934: Package libpam-arvados using Python recipe. Add sdk/pam to run-tests.
authorTom Clegg <tom@curoverse.com>
Mon, 10 Aug 2015 14:41:00 +0000 (10:41 -0400)
committerTom Clegg <tom@curoverse.com>
Wed, 12 Aug 2015 16:07:27 +0000 (12:07 -0400)
jenkins/run-build-packages.sh
jenkins/run-tests.sh

index 1ceecee278412a9adce691f7142a75771a9ea2d6..9dcfd1f96bdd05c54131c7a18420a6be523994de 100755 (executable)
@@ -424,15 +424,16 @@ if [[ "$DEBUG" != 0 ]]; then
   echo
 fi
 
-cd "$WORKSPACE"
+cd "$WORKSPACE/sdk/pam"
+handle_python_package
 
-cd sdk/python
+cd "$WORKSPACE/sdk/python"
 handle_python_package
 
-cd ../../services/fuse
+cd "$WORKSPACE/services/fuse"
 handle_python_package
 
-cd ../../services/nodemanager
+cd "$WORKSPACE/services/nodemanager"
 handle_python_package
 
 # Arvados-src
@@ -558,6 +559,11 @@ cd $WORKSPACE/packages/$TARGET
 rm -rf "$WORKSPACE/sdk/python/build"
 fpm_build $WORKSPACE/sdk/python "${PYTHON2_PKG_PREFIX}-arvados-python-client" 'Curoverse, Inc.' 'python' "$(awk '($1 == "Version:"){print $2}' $WORKSPACE/sdk/python/arvados_python_client.egg-info/PKG-INFO)" "--url=https://arvados.org" "--description=The Arvados Python SDK" --deb-recommends=git
 
+# The PAM module
+cd $WORKSPACE/packages/$TARGET
+rm -rf "$WORKSPACE/sdk/pam/build"
+fpm_build $WORKSPACE/sdk/pam libpam-arvados 'Curoverse, Inc.' 'python' "$(awk '($1 == "Version:"){print $2}' $WORKSPACE/sdk/pam/arvados_pam.egg-info/PKG-INFO)" "--url=https://arvados.org" "--description=PAM module for authenticating shell logins using Arvados API tokens"
+
 # The FUSE driver
 # Please see comment about --no-python-fix-name above; we stay consistent and do
 # not omit the python- prefix first.
@@ -588,18 +594,6 @@ for deppkg in "${PYTHON3_BACKPORTS[@]}"; do
     fpm_build "$deppkg" "$outname" "" python3
 done
 
-# libpam-arvados
-cd $WORKSPACE/sdk/pam
-PKG_VERSION=$(version_from_git)
-cd $WORKSPACE/packages/$TARGET
-
-if [[ "$FORMAT" == "deb" ]]; then
-  fpm_build $WORKSPACE/sdk/pam/debian/shellinabox=/etc/pam.d/shellinabox libpam-arvados 'Curoverse, Inc.' 'dir' "$PKG_VERSION" "--url=https://arvados.org" "--license=Apache License, Version 2.0" "--description=PAM module for Arvados" "--config-files=/etc/default" "-d libpam-python" $WORKSPACE/sdk/pam/arvados_pam.py=/usr/bin/arvados_pam.py $WORKSPACE/sdk/pam/debian/arvados_pam=/etc/default/arvados_pam
-#else
-  # FIXME enable and test once we have the centos pam.d file
-  #fpm_build $WORKSPACE/sdk/pam/centos/shellinabox=/etc/pam.d/shellinabox libpam-arvados 'Curoverse, Inc.' 'dir' "$PKG_VERSION" "--url=https://arvados.org" "--license=Apache License, Version 2.0" "--description=PAM module for Arvados" "--config-files=/etc/default" "-d libpam-python" $WORKSPACE/sdk/pam/arvados_pam.py=/usr/bin/arvados_pam.py $WORKSPACE/sdk/pam/centos/arvados_pam=/etc/default/arvados_pam
-fi
-
 # Build the API server package
 
 cd "$WORKSPACE/services/api"
index 775994450f40d58d5d7d5f099afce5cd9ef1d1ed..e191b4443bebf9fd6c8d9564acd62786ec87f056 100755 (executable)
@@ -63,6 +63,7 @@ services/keepstore
 services/nodemanager
 services/arv-git-httpd
 sdk/cli
+sdk/pam
 sdk/python
 sdk/ruby
 sdk/go/arvadosclient
@@ -390,6 +391,10 @@ ln -sfn "$WORKSPACE" "$GOPATH/src/git.curoverse.com/arvados.git" \
 virtualenv --setuptools "$VENVDIR" || fatal "virtualenv $VENVDIR failed"
 . "$VENVDIR/bin/activate"
 
+if (pip install setuptools | grep setuptools-0) || [ "$($VENVDIR/bin/easy_install --version | cut -d\  -f2 | cut -d. -f1)" -lt 18 ]; then
+    pip install --upgrade setuptools
+fi
+
 # Note: this must be the last time we change PATH, otherwise rvm will
 # whine a lot.
 setup_ruby_environment
@@ -506,10 +511,10 @@ do_install() {
             # the source dist package to avoid a pip bug.
             # see https://arvados.org/issues/5766 for details.
 
-            # Also need to install twice, because if it belives the package is
+            # Also need to install twice, because if it believes the package is
             # already installed, pip it won't install it.  So the first "pip
             # install" ensures that the dependencies are met, the second "pip
-            # install" ensures that we've actually install the local package
+            # install" ensures that we've actually installed the local package
             # we just built.
             cd "$WORKSPACE/$1" \
                 && "${3}python" setup.py sdist rotate --keep=1 --match .tar.gz \
@@ -585,6 +590,7 @@ do_install sdk/cli cli
 # keepproxy).
 declare -a pythonstuff
 pythonstuff=(
+    sdk/pam
     sdk/python
     services/fuse
     services/nodemanager