]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
create a build_deb build script
authorAlfredo Deza <adeza@redhat.com>
Wed, 3 Jun 2015 15:58:44 +0000 (11:58 -0400)
committerAlfredo Deza <adeza@redhat.com>
Wed, 3 Jun 2015 15:58:44 +0000 (11:58 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
ceph-build/build/build_deb [new file with mode: 0644]

diff --git a/ceph-build/build/build_deb b/ceph-build/build/build_deb
new file mode 100644 (file)
index 0000000..f5fa1fb
--- /dev/null
@@ -0,0 +1,91 @@
+# Only do actual work when we are a DEB distro
+if test -f /etc/redhat-release ; then
+    exit 0
+fi
+
+export GNUPGHOME=/home/jenkins-build/build/gnupg.ceph-release/
+export KEYID=17ED316D
+HOST=$(hostname --short)
+echo "Building on $(hostname) Date: $(date)"
+echo "  DIST=${DIST}"
+echo "  BPTAG=${BPTAG}"
+echo "  KEYID=${KEYID}"
+echo "  WS=$WORKSPACE"
+echo "  PWD=$(pwd)"
+echo "  BUILD SOURCE=$COPYARTIFACT_BUILD_NUMBER_CEPH_SETUP"
+echo "*****"
+env
+echo "*****"
+
+if [ ! -d /srv/ceph-build ] ; then
+    echo "Build tools are not installed"
+    exit 1
+fi
+bindir=/srv/ceph-build
+
+vers=`cat ./dist/version`
+# create a release directory for ceph-build tools
+mkdir -p release
+cp -a dist release/${vers}
+echo $DIST > release/${vers}/debian_dists
+echo "${vers}-1" > release/${vers}/debian_version
+
+case $HOST in
+
+gitbuilder-cdep-deb* | tala* | mira*)
+
+        cd release/$vers
+
+        # Dirty Hack:
+        baddist=$(echo $DIST | grep -ic -e squeeze -e wheezy || true)
+        if [ $baddist -eq 1 ]
+        then
+            sed -i 's/ libbabeltrace-ctf-dev, libbabeltrace-dev,//g' ceph_${vers}-1.dsc || true
+            sed -i 's/ liblttng-ust-dev//g' ceph_${vers}-1.dsc || true
+
+        fi
+
+        # unpack sources
+        dpkg-source -x ceph_${vers}-1.dsc
+        if [ $baddist -eq 1 ]
+        then
+            rm -vf *.orig.tar.gz || true
+            grep -v babeltrace ceph-${vers}/debian/control  | grep -v liblttng > ceph-${vers}/debian/control.new
+            mv -v ceph-${vers}/debian/control.new ceph-${vers}/debian/control
+        fi
+        (  cd ceph-${vers}
+           #DEB_VERSION=$(dpkg-parsechangelog | sed -rne 's,^Version: (.*),\1, p' | cut -d'-' -f1)
+           DEB_VERSION=$(dpkg-parsechangelog | sed -rne 's,^Version: (.*),\1, p')
+           #BP_VERSION=${DEB_VERSION}-1${BPTAG}
+           BP_VERSION=${DEB_VERSION}${BPTAG}
+           DEBEMAIL="gary.lowell@inktank.com" dch -D $DIST --force-distribution -b -v "$BP_VERSION" "$comment"
+        )
+        dpkg-source -b ceph-${vers}
+
+        echo "Building Debian"
+        cd "$WORKSPACE"
+        #$bindir/build_dsc.sh ./release $vers 1 $DIST
+        sudo $bindir/build_debs.sh ./release /srv/debian-base $vers
+
+        #Collect Artifacts
+        mkdir -p dist/debian
+        cp -a release/$vers/*.changes dist/debian/.
+        cp -a release/$vers/*.deb     dist/debian/.
+        cp -a release/$vers/*.dsc     dist/debian/.
+        cp -a release/$vers/*.diff.gz dist/debian/.
+        cp -a release/$vers/*.tar.gz  dist/debian/.
+
+        ;;
+
+*)
+        echo "Building RPMs"
+        $bindir/build_rpms.sh ./release $vers
+
+        #Collect Artifacts
+        mkdir -p dist/rpm/${DIST}
+        mv release/${vers}/rpm/*/SRPMS ./dist/rpm/${DIST}/.
+        mv release/${vers}/rpm/*/RPMS/* ./dist/rpm/${DIST}/.
+        ;;
+
+esac
+echo "End Date: $(date)"