Skip to content

Commit

Permalink
travis: fix the travis checks
Browse files Browse the repository at this point in the history
The Travis checks did fail, because the Bareos project directory structure have changed.
The Bareos WebUI is now build and packaged in the same step as the Bareos core.

Also disables the tests for MySQL and Sqlite, as these are deprecated.

Debian build now honors the flag
DEB_BUILD_OPTIONS="nocheck"
to skip tests.
  • Loading branch information
joergsteffens committed Aug 29, 2020
1 parent de46d0b commit bc0e785
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 40 deletions.
22 changes: 11 additions & 11 deletions .travis.yml
@@ -1,12 +1,15 @@
os:
- linux
dist: trusty
# dist: using Ubuntu 20.04 (Focal Fossa)
dist: focal
sudo: required
language: cpp
compiler:
- gcc
git:
depth: false
services:
- postgresql

# This project also uses Coverity Scan https://scan.coverity.com/
# However, the Travis coverity scan addon (as of 19.02.2014) does not fit our needs,
Expand All @@ -16,6 +19,8 @@ git:

env:
global:
- BAREOS_VERSION="unknown"
- NOW=$(LANG=C date -R -u)
# -- BEGIN Coverity Scan ENV
# The build command with all of the arguments that you would apply to a manual `cov-build`
# Usually this is the same as STANDARD_BUILD_COMMAND, excluding the automated test arguments
Expand All @@ -35,19 +40,15 @@ env:
matrix:
include:
- env: DB=postgresql
- env: DB=mysql
- env: DB=sqlite3
- env: DB=postgresql COVERITY_SCAN=1
- env: DB=postgresql COVERITY_SCAN=true
- env: DB=postgresql BUILD_WEBUI=true
addons:
sauce_connect: true
- env: DB=postgresql
compiler: clang
allow_failures:
- env: DB=postgresql COVERITY_SCAN=true
- env: DB=postgresql BUILD_WEBUI=true
- env: DB=postgresql COVERITY_SCAN=1



before_install:
# install build dependencies
Expand All @@ -56,16 +57,15 @@ before_install:
before_script:
# changelog file is required (and normally generated by Jenkins)
- cmake -P write_version_files.cmake
- printf "bareos (19.0.0~pre-1) unstable; urgency=low\n\n * dummy\n\n -- nobody <nobody@example.com> Tue, 01 Jan 2019 00:00:00 +0000\n\n" > core/debian/changelog
- printf "bareos-webui (19.0.0~pre-1) unstable; urgency=low\n\n * dummy\n\n -- nobody <nobody@example.com> Tue, 01 Jan 2019 00:00:00 +0000\n\n" > webui/debian/changelog
- BAREOS_VERSION=$(cmake -P get_version.cmake | sed -e 's/-- //')
- printf "bareos (%s) unstable; urgency=low\n\n * dummy\n\n -- nobody <nobody@example.com> %s\n\n" "${BAREOS_VERSION}" "${NOW}" | tee debian/changelog
# build and install Bareos packages
- .travis/travis_before_script.sh

script:
# run test script
- if [ -z "${COVERITY_SCAN}" ]; then sudo -E $PWD/.travis/all; fi
- if [ -z "${COVERITY_SCAN:-}" ]; then sudo -E $PWD/.travis/all; fi

addons:
hosts:
- bareos.example.com

3 changes: 2 additions & 1 deletion .travis/all
Expand Up @@ -2,6 +2,7 @@

# stop on first error
set -e
set -u

echo "start testing ... "
echo "TRAVIS_BRANCH: $TRAVIS_BRANCH"
Expand Down Expand Up @@ -42,7 +43,7 @@ echo -e "restore select current\r2\rls\rmark usr\rdone\ryes\rwait" | bconsole
echo "status dir" | bconsole
grep "bareos restore test" /tmp/bareos-restores/${BACKUP_TEST_FILE}

if [ "${BUILD_WEBUI}" ]; then
if [ "${BUILD_WEBUI:-}" ]; then
# show environment
export | grep " TRAVIS"

Expand Down
13 changes: 6 additions & 7 deletions .travis/travis_before_install.sh
@@ -1,21 +1,20 @@
#!/bin/bash

set -e
set -u

sudo apt-get -qq update
# qt5 should be used. Remove qt4-dev to avoid confusion.
sudo apt-get remove libqt4-dev
cd core
dpkg-checkbuilddeps 2> /tmp/dpkg-builddeps || true
if [ $BUILD_WEBUI ]; then
if [ "${BUILD_WEBUI:-}" ]; then
sudo -H pip install --upgrade pip 'urllib3>=1.22'
sudo -H pip install sauceclient selenium
cd ../webui
dpkg-checkbuilddeps 2>> /tmp/dpkg-builddeps || true
fi
cat /tmp/dpkg-builddeps
sed -e "s/^.*:.*:\s//" -e "s/\s([^)]*)//g" -e "s/|/ /g" -e "s/ /\n/g" /tmp/dpkg-builddeps > /tmp/build_depends
sudo apt-get -q --assume-yes install fakeroot
cat /tmp/build_depends | while read pkg; do
echo "installing $pkg"
sudo apt-get -q --assume-yes install $pkg
echo "installing $pkg"
sudo apt-get -q --assume-yes install $pkg || true
done
true
32 changes: 12 additions & 20 deletions .travis/travis_before_script.sh
@@ -1,5 +1,8 @@
#!/bin/bash

set -e
set -u

print_header()
{
TEXT="$1"
Expand All @@ -8,9 +11,7 @@ print_header()
printf "#\n"
}

cd core

if [ "${COVERITY_SCAN}" ]; then
if [ "${COVERITY_SCAN:-}" ]; then
# run configure with default options
debian/rules override_dh_auto_configure
eval "$COVERITY_SCAN_BUILD"
Expand All @@ -20,18 +21,10 @@ fi


print_header "build Bareos core packages"
# https://www.debian.org/doc/debian-policy/ch-source.html#s-debianrules-options
export DEB_BUILD_OPTIONS="nocheck"
fakeroot debian/rules binary


if [ "${BUILD_WEBUI}" ]; then
cd ../webui
# to avoid timestamp conflicts while autoconfiguring we refresh every file
#touch *
print_header "build Bareos webui packages"
fakeroot debian/rules binary
fi


print_header "create Debian package repository"
cd ..
dpkg-scanpackages . > Packages
Expand All @@ -41,11 +34,10 @@ printf 'deb file:%s /\n' $PWD > /tmp/bareos.list
sudo cp /tmp/bareos.list /etc/apt/sources.list.d/bareos.list
cd -


print_header "install Bareos core package"
sudo apt-get -qq update
sudo apt-get install -y --force-yes bareos bareos-database-$DB

if [ "${BUILD_WEBUI}" ]; then
sudo apt-get install -y --force-yes bareos-webui
PKGS="bareos bareos-database-$DB"
if [ "${BUILD_WEBUI:-}" ]; then
PKGS="$PKGS bareos-webui"
fi
print_header "install Bareos packages: $PKGS"
sudo apt-get -qq update --allow-insecure-repositories || true
sudo apt-get install -y --allow-unauthenticated $PKGS
3 changes: 2 additions & 1 deletion debian/control
Expand Up @@ -21,9 +21,10 @@ Section: admin
Priority: optional
Maintainer: Joerg Steffens <joerg.steffens@bareos.com>
Build-Depends: acl-dev,
cmake (>= 3.0.0) | cmake-mozilla,
apache2 | httpd,
bc,
chrpath,
cmake (>= 3.0.0) | cmake-mozilla,
debhelper (>= 7.0.50~),
dpkg-dev (>= 1.13.19),
libacl1-dev,
Expand Down
9 changes: 9 additions & 0 deletions debian/rules
Expand Up @@ -126,8 +126,17 @@ override_dh_installinit:
override_dh_makeshlibs:
dh_makeshlibs -n


override_dh_auto_test:
# Only run tests,
# if DEB_BUILD_OPTIONS does not contain nocheck,
# see https://www.debian.org/doc/debian-policy/ch-source.html#s-debianrules-options
# No tabs allowed before ifeq.
ifneq (nocheck,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
cd obj-x86_64-linux-gnu && make clean && REGRESS_DEBUG=1 ctest -j 10 -V -D Continuous || echo "ctest failed"
else
@echo "ctest: skipped"
endif


override_dh_shlibdeps:
Expand Down

0 comments on commit bc0e785

Please sign in to comment.