ARCH=$(uname -m)
+function in_jenkins() {
+ test -n "$JENKINS_HOME"
+}
+
function munge_ceph_spec_in {
local with_seastar=$1
shift
}
function ensure_decent_gcc_on_ubuntu {
+ in_jenkins && echo "CI_DEBUG: Start ensure_decent_gcc_on_ubuntu() in install-deps.sh"
# point gcc to the one offered by g++-7 if the used one is not
# new enough
local old=$(gcc -dumpfullversion -dumpversion)
# cmake uses the latter by default
$SUDO ln -nsf /usr/bin/gcc /usr/bin/${ARCH}-linux-gnu-gcc
$SUDO ln -nsf /usr/bin/g++ /usr/bin/${ARCH}-linux-gnu-g++
+
+ in_jenkins && echo "CI_DEBUG: End ensure_decent_gcc_on_ubuntu() in install-deps.sh"
}
function ensure_python3_sphinx_on_ubuntu {
+ in_jenkins && echo "CI_DEBUG: Running ensure_python3_sphinx_on_ubuntu() in install-deps.sh"
local sphinx_command=/usr/bin/sphinx-build
# python-sphinx points $sphinx_command to
# ../share/sphinx/scripts/python2/sphinx-build when it's installed
}
function install_pkg_on_ubuntu {
+ in_jenkins && echo "CI_DEBUG: Running install_pkg_on_ubuntu() in install-deps.sh"
local project=$1
shift
local sha1=$1
for pkg in $pkgs; do
if ! apt -qq list $pkg 2>/dev/null | grep -q installed; then
missing_pkgs+=" $pkg"
+ in_jenkins && echo "CI_DEBUG: missing_pkgs=$missing_pkgs"
fi
done
fi
function install_boost_on_ubuntu {
local ver=1.73
+ in_jenkins && echo "CI_DEBUG: Running install_boost_on_ubuntu() in install-deps.sh"
local installed_ver=$(apt -qq list --installed ceph-libboost*-dev 2>/dev/null |
grep -e 'libboost[0-9].[0-9]\+-dev' |
cut -d' ' -f2 |
}
function install_libzbd_on_ubuntu {
+ in_jenkins && echo "CI_DEBUG: Running install_libzbd_on_ubuntu() in install-deps.sh"
local codename=$1
local project=libzbd
local sha1=1fadde94b08fab574b17637c2bebd2b1e7f9127b
fi
touch $DIR/status
+ in_jenkins && echo "CI_DEBUG: Running munge_debian_control() in install-deps.sh"
backports=""
control=$(munge_debian_control "$VERSION" "$with_seastar" "$for_make_check" "debian/control")
case "$VERSION" in
# make a metapackage that expresses the build dependencies,
# install it, rm the .deb; then uninstall the package as its
# work is done
+ in_jenkins && echo "CI_DEBUG: Running mk-build-deps in install-deps.sh"
$SUDO env DEBIAN_FRONTEND=noninteractive mk-build-deps --install --remove --tool="apt-get -y --no-install-recommends $backports" $control || exit 1
+ in_jenkins && echo "CI_DEBUG: Removing ceph-build-deps"
$SUDO env DEBIAN_FRONTEND=noninteractive apt-get -y remove ceph-build-deps
if [ "$control" != "debian/control" ] ; then rm $control; fi
;;
fi
function populate_wheelhouse() {
+ in_jenkins && echo "CI_DEBUG: Running populate_wheelhouse() in install-deps.sh"
local install=$1
shift
}
function activate_virtualenv() {
+ in_jenkins && echo "CI_DEBUG: Running activate_virtualenv() in install-deps.sh"
local top_srcdir=$1
local env_dir=$top_srcdir/install-deps-python3
}
function preload_wheels_for_tox() {
+ in_jenkins && echo "CI_DEBUG: Running preload_wheels_for_tox() in install-deps.sh"
local ini=$1
shift
pushd . > /dev/null
rm -rf $XDG_CACHE_HOME
type git > /dev/null || (echo "Dashboard uses git to pull dependencies." ; false)
fi
+
+in_jenkins && echo "CI_DEBUG: End install-deps.sh"
ORIGINAL_CCACHE_CONF="$HOME/.ccache/ccache.conf"
SAVED_CCACHE_CONF="$HOME/.run-make-check-saved-ccache-conf"
+function in_jenkins() {
+ test -n "$JENKINS_HOME"
+}
+
function save_ccache_conf() {
test -f $ORIGINAL_CCACHE_CONF && cp $ORIGINAL_CCACHE_CONF $SAVED_CCACHE_CONF || true
}
exit 1
fi
if [ -n "$install_cmd" ]; then
+ in_jenkins && echo "CI_DEBUG: Running '$install_cmd ccache $which_pkg'"
$DRY_RUN sudo $install_cmd ccache $which_pkg
else
echo "WARNING: Don't know how to install packages" >&2
fi
if test -f ./install-deps.sh ; then
+ in_jenkins && echo "CI_DEBUG: Running install-deps.sh"
$DRY_RUN source ./install-deps.sh || return 1
trap clean_up_after_myself EXIT
fi
$DRY_RUN export SOURCE_DATE_EPOCH="946684800"
$DRY_RUN ccache -o sloppiness=time_macros
$DRY_RUN ccache -o run_second_cpp=true
- if [ -n "$JENKINS_HOME" ]; then
+ if in_jenkins; then
# Build host has plenty of space available, let's use it to keep
# various versions of the built objects. This could increase the cache hit
# if the same or similar PRs are running several times
function configure() {
local cmake_build_opts=$(detect_ceph_dev_pkgs)
+ in_jenkins && echo "CI_DEBUG: Running do_cmake.sh"
$DRY_RUN ./do_cmake.sh $cmake_build_opts $@ || return 1
}
$DRY_RUN cd build
BUILD_MAKEOPTS=${BUILD_MAKEOPTS:-$DEFAULT_MAKEOPTS}
test "$BUILD_MAKEOPTS" && echo "make will run with option(s) $BUILD_MAKEOPTS"
+ in_jenkins && echo "CI_DEBUG: Running make"
$DRY_RUN make $BUILD_MAKEOPTS $targets || return 1
$DRY_RUN ccache -s # print the ccache statistics to evaluate the efficiency
}