From: Boris Ranto Date: Thu, 18 May 2017 10:35:41 +0000 (+0200) Subject: samba: Build against desired ceph branch/commit X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=300d7fbaeb50d1489cc6d37dcdd1383a5b371836;p=ceph-build.git samba: Build against desired ceph branch/commit Signed-off-by: Boris Ranto --- diff --git a/samba/build/build_deb b/samba/build/build_deb index 3cc86f7f..19c88e8e 100644 --- a/samba/build/build_deb +++ b/samba/build/build_deb @@ -6,10 +6,39 @@ if test "$DISTRO" != "debian" -a "$DISTRO" != "ubuntu"; then exit 0 fi +## Get the desired CEPH_BRANCH/CEPH_SHA1 ceph repo +# Get repo file from appropriate shaman build +REPO_URL="https://shaman.ceph.com/api/repos/ceph/$CEPH_BRANCH/$CEPH_SHA1/$DISTRO/$DIST/repo" +TIME_LIMIT=1200 +INTERVAL=30 +REPO_FOUND=0 + +# poll shaman for up to 10 minutes +while [ "$SECONDS" -le "$TIME_LIMIT" ] +do + if `curl --fail -L ${REPO_URL} > $WORKSPACE/shaman.list`; then + echo "Ceph debian lib repo exists in shaman" + REPO_FOUND=1 + break + else + sleep $INTERVAL + fi +done + +if [[ "$REPO_FOUND" -eq 0 ]]; then + echo "Ceph debian lib repo does NOT exist in shaman" + exit 1 +fi + +# Copy the repo +sudo cp $WORKSPACE/shaman.list /etc/apt/sources.list.d/ ## Install any setup-time deps +# Make sure we use the latest version of libcephfs-dev +sudo apt-get remove -y libcephfs-dev || true + # We need these for the build -sudo apt-get update && sudo apt-get install -y build-essential equivs libgnutls-dev libacl1-dev libldap2-dev ruby ruby-dev +sudo apt-get update && sudo apt-get install -y build-essential equivs libgnutls-dev libacl1-dev libldap2-dev ruby ruby-dev libcephfs-dev # We use fpm to create the deb package sudo gem install fpm diff --git a/samba/build/build_rpm b/samba/build/build_rpm index 780a8945..abaa2651 100644 --- a/samba/build/build_rpm +++ b/samba/build/build_rpm @@ -6,10 +6,41 @@ if test "$DISTRO" != "fedora" -a "$DISTRO" != "centos" -a "$DISTRO" != "rhel"; t exit 0 fi +RELEASE="$(lsb_release --short -r | cut -d '.' -f 1)" # sytem release + +## Get the desired CEPH_BRANCH/CEPH_SHA1 ceph repo +# Get .repo file from appropriate shaman build +REPO_URL="https://shaman.ceph.com/api/repos/ceph/$CEPH_BRANCH/$CEPH_SHA1/$DISTRO/$RELEASE/flavors/default/repo" +TIME_LIMIT=1200 +INTERVAL=30 +REPO_FOUND=0 + +# poll shaman for up to 10 minutes +while [ "$SECONDS" -le "$TIME_LIMIT" ] +do + if `curl --fail -L $REPO_URL > $WORKSPACE/shaman.repo`; then + echo "Ceph repo file has been added from shaman" + REPO_FOUND=1 + break + else + sleep $INTERVAL + fi +done + +if [[ "$REPO_FOUND" -eq 0 ]]; then + echo "Ceph lib repo does NOT exist in shaman" + exit 1 +fi + +# Copy the repo +sudo cp $WORKSPACE/shaman.repo /etc/yum.repos.d/ ## Install any setup-time deps +# We modified the repos, clean cache first +sudo yum clean all + # We need these for the build -sudo yum install -y gnutls-devel libacl-devel openldap-devel rubygems ruby-devel +sudo yum install -y gnutls-devel libacl-devel openldap-devel rubygems ruby-devel libcephfs-devel # We use fpm to create the deb package sudo gem install fpm @@ -30,7 +61,6 @@ make -j$NCPU install DESTDIR=${DESTDIR} ## Get some basic information about the system and the repository # Get version export LD_LIBRARY_PATH=${DESTDIR}/usr/local/samba/lib/:${DESTDIR}/usr/local/samba/lib/private/ -RELEASE="$(lsb_release --short -r | cut -d '.' -f 1)" # system release VERSION=$(${DESTDIR}/usr/local/samba/sbin/smbd --version | sed -e "s|Version ||") REVISION="$(git rev-parse HEAD)" diff --git a/samba/config/definitions/samba.yml b/samba/config/definitions/samba.yml index dee8b81e..a7c7bea4 100644 --- a/samba/config/definitions/samba.yml +++ b/samba/config/definitions/samba.yml @@ -12,6 +12,16 @@ description: "The git branch (or tag) to build" default: "master" + - string: + name: CEPH_SHA1 + description: "The SHA1 of the ceph branch" + default: "latest" + + - string: + name: CEPH_BRANCH + description: "The branch of Ceph to get the repo file of for libcephfs" + default: "master" + - string: name: DISTROS description: "A list of distros to build for. Available options are: xenial, centos7, centos6, trusty-pbuilder, precise, wheezy, and jessie"