]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
samba: Build against desired ceph branch/commit
authorBoris Ranto <branto@redhat.com>
Thu, 18 May 2017 10:35:41 +0000 (12:35 +0200)
committerBoris Ranto <branto@redhat.com>
Thu, 18 May 2017 12:39:03 +0000 (14:39 +0200)
Signed-off-by: Boris Ranto <branto@redhat.com>
samba/build/build_deb
samba/build/build_rpm
samba/config/definitions/samba.yml

index 3cc86f7f0a149396c7388ee2ba49bbb28e442bff..19c88e8e4d038c254bda32619ce3a41828d822b7 100644 (file)
@@ -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
index 780a8945ca2636df7a6b2d410dedbe65ab757308..abaa265110971610a7db259fdb2df416df17c364 100644 (file)
@@ -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)"
 
index dee8b81e01e668a61e9bb42ef7b03a2a030289af..a7c7bea49944a06fd1e0d94de95b493690732edb 100644 (file)
           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"