]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
nfs-ganesha: debian fixes, various additions 625/head
authorAli Maredia <amaredia@redhat.com>
Fri, 10 Feb 2017 13:52:04 +0000 (08:52 -0500)
committerAli Maredia <amaredia@redhat.com>
Fri, 10 Feb 2017 13:56:35 +0000 (08:56 -0500)
Signed-off-by: Ali Maredia <amaredia@redhat.com>
nfs-ganesha/build/build_deb
nfs-ganesha/build/failure [new file with mode: 0644]
nfs-ganesha/build/setup
nfs-ganesha/config/definitions/nfs-ganesha.yml

index bb0de429782cb24ac871e3d12aca56358f40fa52..4630e2ab662e14b4be3558b383402d7f853cf322 100644 (file)
@@ -7,14 +7,10 @@ if test "$DISTRO" != "debian" -a "$DISTRO" != "ubuntu"; then
 fi
 
 
-## Install any setup-time deps
-# TODO: add file to /etc/apt/sources.list.d/ to get repos for librgw-dev and libcephfs-dev and run sudo apt-get update
-
 # We need this for system, to build ganesha, and to enable FSAL_CEPH and 
 # FSAL_RGW in the .spec file when cmake command runs
-sudo apt-get -y install "cmake equivs libkrb5-dev bison flex quilt
-libdbus-1-dev libnfsidmap-dev libwbclient-dev libntirpc-dev (>= 1.4.3) libattr1-dev libacl1-dev libcap-dev glusterfs-common (>= 3.8.4) python-qt4 pyqt4-dev-tools pkgconf
-librgw-dev libcephfs-dev"
+sudo apt-get update
+sudo apt-get -y install cmake equivs libkrb5-dev bison flex quilt librgw-dev libcephfs-dev
 
 # Normalize variables across rpm/deb builds
 NORMAL_DISTRO=$DISTRO
@@ -41,24 +37,23 @@ cd build
 cmake -DCMAKE_BUILD_TYPE=Maintainer -DUSE_FSAL_GLUSTER=OFF -DUSE_FSAL_CEPH=ON -DUSE_FSAL_RGW=ON $WORKSPACE/nfs-ganesha/src && make dist || exit 1
 
 # move unpacked tarball code into nfs-ganesha-debian/src
-VERSION=`grep -om 1 '[[:digit:]]\+\.[[:digit:]]\+-dev-[[:digit:]]\+' $WORKSPACE/nfs-ganesha/build/CPackSourceConfig.cmake | sed s/-//g`
-BUILD=`grep -om 1 "[[:digit:]]\+-g\w\w\w\w\w\w\w" $WORKSPACE/nfs-ganesha/build/include/config.h`
-NFS_GANESHA_ORIG_TAR_GZ="nfs-ganesha_${VERSION}.orig.tar.gz"
 NFS_GANESHA_SOURCE_DIR=`grep -om 1 'nfs-ganesha-[[:digit:]]\+\.[[:digit:]]\+-dev-[[:digit:]]\+-[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+-Source' $WORKSPACE/nfs-ganesha/build/CPackSourceConfig.cmake`
+VERSION=`grep -om 1 '[[:digit:]]\+\.[[:digit:]]\+-dev-[[:digit:]]\+' $WORKSPACE/nfs-ganesha/build/CPackSourceConfig.cmake`
+TAR_VERSION=`grep -om 1 '[[:digit:]]\+\.[[:digit:]]\+-dev' $WORKSPACE/nfs-ganesha/build/CPackSourceConfig.cmake`
+NFS_GANESHA_ORIG_TAR_GZ="nfs-ganesha_${TAR_VERSION}.orig.tar.gz"
+mkdir nfs-ganesha-${VERSION}
 tar xzf ${NFS_GANESHA_SOURCE_DIR}.tar.gz
-mv ${NFS_GANESHA_SOURCE_DIR}.tar.gz ${NFS_GANESHA_ORIG_TAR_GZ}
-mv ${NFS_GANESHA_SOURCE_DIR} nfs-ganesha-${VERSION}
-rm -rf $WORKSPACE/nfs-ganesha-debian/debian/patches
+mv ${NFS_GANESHA_SOURCE_DIR} nfs-ganesha-${VERSION}/src
+tar czf ${NFS_GANESHA_ORIG_TAR_GZ} nfs-ganesha-${VERSION}/src
 mv $WORKSPACE/nfs-ganesha-debian/debian $WORKSPACE/nfs-ganesha/build/nfs-ganesha-${VERSION}/debian
+cd nfs-ganesha-${VERSION}
 
 ## Get some basic information about the system and the repository
 DEB_ARCH=$(dpkg-architecture -qDEB_BUILD_ARCH)
 
-cd $WORKSPACE/nfs-ganesha-debian
-
 ## Prepare the debian files
 # Bump the changelog
-dch -v "$VERSION-$BUILD" "New release ($VERSION)"
+dch -v "$VERSION" "Dev release ($VERSION)"
 
 # Create .dsc and source tarball
 sudo dpkg-buildpackage -S -us -uc -d
@@ -74,8 +69,10 @@ mkdir -p $WORKSPACE/dist/deb
 
 # use libcephfs and librgw from shaman
 REPO_URL="https://shaman.ceph.com/api/repos/ceph/$CEPH_BRANCH/$CEPH_SHA1/$DISTRO/$DIST/repo"
+SHAMAN_MIRROR=`curl -L ${REPO_URL}`
 echo "EXTRAPACKAGES=\"libcephfs-dev librgw-dev\"" >> ~/.pbuilderrc
-echo "OTHERMIRROR=deb ${REPO_URL}" >> ~/.pbuildrrc
+echo "OTHERMIRROR=\"${SHAMAN_MIRROR}\"" >> ~/.pbuilderrc
+cat ~/.pbuilderrc
 
 echo "Building debs for $DIST"
 sudo pbuilder build \
@@ -83,7 +80,7 @@ sudo pbuilder build \
     --basetgz $PBUILDDIR/$DIST.tgz \
     --buildresult $WORKSPACE/dist/deb/ \
     --debbuildopts "-j`grep -c processor /proc/cpuinfo`" \
-    $WORKSPACE/dist/nfs-ganesha_$VERSION.dsc
+    $WORKSPACE/nfs-ganesha/build/nfs-ganesha_${VERSION}.dsc
 
 
 ## Upload the created RPMs to chacra
diff --git a/nfs-ganesha/build/failure b/nfs-ganesha/build/failure
new file mode 100644 (file)
index 0000000..6a4fe02
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash -ex
+
+# note: the failed_build_status call relies on normalized variable names that
+# are infered by the builds themselves. If the build fails before these are
+# set, they will be posted with empty values
+NFS_GANESHA_BRANCH=`branch_slash_filter $NFS_GANESHA_BRANCH`
+
+# update shaman with the failed build status
+failed_build_status "nfs-ganesha" $NORMAL_DISTRO $NORMAL_DISTRO_VERSION $NORMAL_ARCH
index 4abb70880769de44520559cf6e0816f29777e324..78c61c20f5a6dea40477cd5e134cc910f4cdee74 100644 (file)
@@ -11,6 +11,7 @@
 #  License as published by the Free Software Foundation; either
 #  version 2.1 of the License, or (at your option) any later version.
 #
+
 set -ex
 
 # Make sure we execute at the top level directory before we do anything
@@ -43,6 +44,9 @@ export LC_ALL=C # the following is vulnerable to i18n
 pkgs=( "chacractl>=0.0.4" )
 install_python_packages "pkgs[@]"
 
+NFS_GANESHA_BRANCH=`branch_slash_filter $NFS_GANESHA_BRANCH`
+CEPH_BRANCH=`branch_slash_filter $CEPH_BRANCH`
+
 # ask shaman which chacra instance to use
 chacra_url=`curl -f -u $SHAMAN_API_USER:$SHAMAN_API_KEY https://shaman.ceph.com/api/nodes/next/`
 # create the .chacractl config file using global variables
index 7bdb47cf7398d1f4b34bec629a165d581d59e58c..98afac1135ae87443925356775dd300f074ab3c5 100644 (file)
@@ -134,6 +134,18 @@ If this is checked, then the binaries will be built and pushed to chacra even if
             - ../../build/setup
             - ../../build/build_rpm
 
+    publishers:
+      - postbuildscript:
+          script-only-if-failed: True
+          script-only-if-succeeded: False 
+          builders:
+            - inject:
+                properties-file: ${WORKSPACE}/build_info
+            - shell:
+                !include-raw:
+                  - ../../../scripts/build_utils.sh
+                  - ../../build/failure
+
     wrappers:
       - inject-passwords:
           global: true