From: Ken Dreyer Date: Tue, 14 Jan 2014 03:24:39 +0000 (-0700) Subject: add jenkins scripts X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=145e4157522a07e193ca78fec6715474f3c8b3ac;p=ceph-build.git add jenkins scripts Move our Jenkins scripts out of Jenkins' database and into Git so that we can have greater visibility on future changes. Going forward, we will modify the ceph Jenkins tasks to only run these scripts. Signed-off-by: Ken Dreyer --- diff --git a/jenkins/build b/jenkins/build new file mode 100644 index 00000000..a0c8d16f --- /dev/null +++ b/jenkins/build @@ -0,0 +1,81 @@ +#export GNUPGHOME=/home/jenkins-build/build/gnupg.autobuild/ +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 + +case $HOST in +gitbuilder-cdep-deb* | tala* | mira*) + if [ ! -d /srv/debian-base ] ; then + echo "debian base is not installed" + exit 1 + fi + ;; +esac + + +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 + + # unpack sources + dpkg-source -x ceph_${vers}-1.dsc + ( 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" + 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)" diff --git a/jenkins/package b/jenkins/package new file mode 100644 index 00000000..9f8fa702 --- /dev/null +++ b/jenkins/package @@ -0,0 +1,13 @@ +# +for dir in * ; do + echo $dir + arch=$(echo $dir | cut -d',' -f1 | cut -d'=' -f2) + dist=$(echo $dir | cut -d',' -f2 | cut -d'=' -f2 | cut -d'-' -f1) + echo "arch = $arch, dist = $dist" + if [ -d $dir/dist/rpm ] ; then + echo "rpms" + fi + if [ -d $dir/dist/debian ] ; then + echo "debian" + fi +done diff --git a/jenkins/setup b/jenkins/setup new file mode 100644 index 00000000..996e1908 --- /dev/null +++ b/jenkins/setup @@ -0,0 +1,67 @@ +#export GNUPGHOME=/home/jenkins-build/build/gnupg.autobuild/ +export GNUPGHOME=/home/jenkins-build/build/gnupg.ceph-release/ +export KEYID=17ED316D +HOST=$(hostname --short) +echo "Building on ${HOST}" +echo " DIST=${DIST}" +echo " BPTAG=${BPTAG}" +echo " KEYID=${KEYID}" +echo " WS=$WORKSPACE" +echo " PWD=$(pwd)" +echo " BRANCH=$BRANCH" + +if [ -x "$BRANCH" ] ; then + echo "No git branch was supplied" + exit 1 +fi + +echo "Building version $(git describe) Branch $Branch" + +if [ ! -d /srv/ceph-build ] ; then + echo "Build tools are not installed" + exit 1 +fi +bindir=/srv/ceph-build +rm -rf dist +rm -rf release + +# fix version/release. Hack needed only for the spec +# file for rc candidates. +#export force=force +#sed -i 's/^Version:.*/Version: 0.72/' ceph.spec.in +#sed -i 's/^Release:.*/Release: rc1%{?dist}/' ceph.spec.in +#sed -i 's/^Source0:.*/Source0: http:\/\/ceph.com\/download\/%{name}-%{version}-rc1.tar.bz2/' ceph.spec.in +#sed -i 's/^%setup.*/%setup -q -n %{name}-%{version}-rc1/' ceph.spec.in + +echo "Running configure ..." +./do_autogen.sh +if [ $? -ne 0 ] ; then + echo "autogen failed" + exit 1 +fi + +mkdir -p release +$bindir/release_tarball.sh release release/version +if [ $? -ne 0] ; then + echo "make tarballs failed" + exit 2 +fi +vers=`cat release/version` + +( + cd release/$vers + mv debian ceph-$vers/. + dpkg-source -b ceph-$vers +) + +mkdir -p dist +# Debian Source Files +mv release/$vers/*.dsc dist/. +mv release/$vers/*.diff.gz dist/. +mv release/$vers/*.orig.tar.gz dist/. +# RPM Source Files +mv release/$vers/ceph.spec dist/. +mv release/$vers/*.tar.* dist/. +# Parameters +mv release/version dist/. +exit 0