]> git.apps.os.sepia.ceph.com Git - autobuild-ceph.git/commitdiff
build-ceph-cmake.sh: build with cmake
authorSage Weil <sage@redhat.com>
Thu, 3 Sep 2015 02:17:27 +0000 (22:17 -0400)
committerSage Weil <sage@redhat.com>
Thu, 3 Sep 2015 19:03:22 +0000 (15:03 -0400)
No make check for the time being.

Signed-off-by: Sage Weil <sage@redhat.com>
build-auto.sh
build-ceph-cmake.sh [new file with mode: 0755]

index dae20f72927aebf9b6c7e70f27bfd156a30e8de5..586cdbd59ec573823ae92df6a21a419f19e82d45 100755 (executable)
@@ -29,6 +29,9 @@ if hostname | grep -q -- ceph-deb- ; then
     exec $mydir/build-ceph-deb-native.sh
 fi
 if hostname | grep -q -- ceph-tarball- ; then
+    if hostname | grep -q -- -cmake ; then
+       exec $mydir/build-ceph-cmake.sh
+    fi
     exec $mydir/build-ceph.sh
 fi
 if hostname | grep -q -- ceph-rpm- ; then
diff --git a/build-ceph-cmake.sh b/build-ceph-cmake.sh
new file mode 100755 (executable)
index 0000000..ec262ff
--- /dev/null
@@ -0,0 +1,90 @@
+#!/bin/bash -x
+set -e
+
+git submodule foreach 'git clean -fdx && git reset --hard'
+rm -rf ceph-object-corpus
+rm -rf ceph-erasure-code-corpus
+rm -rf src/gmock
+rm -rf src/leveldb
+rm -rf src/libs3
+rm -rf src/mongoose
+rm -rf src/civetweb
+rm -rf src/rocksdb
+rm -rf src/erasure-code/jerasure/gf-complete
+rm -rf src/erasure-code/jerasure/jerasure
+rm -rf .git/modules/
+git clean -fdx && git reset --hard
+/srv/git/bin/git submodule sync
+/srv/autobuild-ceph/use-mirror.sh
+/srv/git/bin/git submodule update --init --recursive
+git clean -fdx
+
+echo --START-IGNORE-WARNINGS
+[ ! -x install-deps.sh ] || ./install-deps.sh
+
+mkdir build
+cd build
+cmake ..
+
+#
+# Return MIN(4, MAX(1, (number of processors / 2)))
+# Do not try to use more than 4 because it will stress
+# IO too much
+#
+function get_processors() {
+    if test $(nproc) -ge 16 ; then
+        echo 4
+    elif test $(nproc) -ge 2 ; then
+        expr $(nproc) / 2
+    else
+        echo 1
+    fi
+}
+
+make -j$(get_processors) "$@" || exit 4
+
+# run "make check", but give it a time limit in case a test gets stuck
+#trap "pkill -9 ceph-osd || true ; pkill -9 ceph-mon || true" EXIT
+#if ! ../maxtime 5400 make $(maybe_parallel_make_check) check "$@" ; then
+#    exit 5
+#fi
+
+REV="$(git rev-parse HEAD)"
+OUTDIR="../out/output/sha1/$REV"
+OUTDIR_TMP="${OUTDIR}.tmp"
+install -d -m0755 -- "$OUTDIR_TMP"
+printf '%s\n' "$REV" >"$OUTDIR_TMP/sha1"
+MACH="$(uname -m)"
+INSTDIR="inst.tmp"
+[ ! -e "$INSTDIR" ]
+../maxtime 1800 ionice -c3 nice -n20 make install DESTDIR="$PWD/$INSTDIR"
+tar czf "$OUTDIR_TMP/ceph.$MACH.tgz" -C "$INSTDIR" .
+rm -rf -- "$INSTDIR"
+
+# put our temp files inside .git/ so ls-files doesn't see them
+git ls-files --modified >.git/modified-files
+if [ -s .git/modified-files ]; then
+    rm -rf "$OUTDIR_TMP"
+    echo "error: Modified files:" 1>&2
+    cat .git/modified-files 1>&2
+    exit 6
+fi
+
+git ls-files --exclude-standard --others >.git/added-files
+if [ -s .git/added-files ]; then
+    rm -rf "$OUTDIR_TMP"
+    echo "error: Added files:" 1>&2
+    cat .git/added-files 1>&2
+    exit 7
+fi
+
+# we're successful, the files are ok to be published; try to be as
+# atomic as possible about replacing potentially existing OUTDIR
+if [ -e "$OUTDIR" ]; then
+    rm -rf -- "$OUTDIR.old"
+    mv -- "$OUTDIR" "$OUTDIR.old"
+fi
+mv -- "$OUTDIR_TMP" "$OUTDIR"
+rm -rf -- "$OUTDIR.old"
+
+exit 0