Skip to content

Commit

Permalink
Merge pull request #97 from thraizz/webui-travis-mergebranch
Browse files Browse the repository at this point in the history
travis: build and test webui as new build environment
  • Loading branch information
joergsteffens committed Oct 9, 2018
2 parents a1e063e + facaae8 commit cb4f22b
Show file tree
Hide file tree
Showing 9 changed files with 140 additions and 73 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Expand Up @@ -37,9 +37,13 @@ matrix:
- env: DB=mysql
- env: DB=sqlite3
- env: DB=postgresql COVERITY_SCAN=1
- env: DB=postgresql BUILD_WEBUI=true
addons:
sauce_connect: true
- env: DB=postgresql
compiler: clang
allow_failures:
- env: DB=postgresql BUILD_WEBUI=true
- env: DB=postgresql COVERITY_SCAN=1


Expand All @@ -51,6 +55,7 @@ before_install:
before_script:
# changelog file is required (and normally generated by OBS)
- cp -a core/platforms/packaging/bareos.changes core/debian/changelog
- if [ -n "${BUILD_WEBUI}" ]; then cp -a webui/packaging/obs/bareos-webui.changes webui/debian/changelog; fi
# build and install Bareos packages
- .travis/travis_before_script.sh

Expand Down
12 changes: 12 additions & 0 deletions .travis/all
Expand Up @@ -42,3 +42,15 @@ 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
service apache2 restart
service apache2 status
export BAREOS_BROWSER="none"
export BAREOS_USERNAME="citest"
export BAREOS_PASSWORD="citestpass"
export BAREOS_CLIENT_NAME=$HOSTNAME-fd
echo "--------- testing webui over selenium -----------"
echo "configure add console name=citest password=citestpass profile=webui-admin" | bconsole
python ${TRAVIS_BUILD_DIR}/webui/tests/selenium/webui-selenium-test.py -v
fi
17 changes: 13 additions & 4 deletions .travis/travis_before_install.sh
Expand Up @@ -5,10 +5,19 @@ sudo apt-get -qq update
sudo apt-get remove libqt4-dev
cd core
dpkg-checkbuilddeps 2> /tmp/dpkg-builddeps || true
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" /tmp/dpkg-builddeps > /tmp/build_depends
echo "additional packages required for building:"; cat /tmp/build_depends
sudo xargs --arg-file /tmp/build_depends apt-get -q --assume-yes install fakeroot
dpkg -l
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
done
true

41 changes: 27 additions & 14 deletions .travis/travis_before_script.sh
Expand Up @@ -14,19 +14,32 @@ if [ "${COVERITY_SCAN}" ]; then
debian/rules override_dh_auto_configure
eval "$COVERITY_SCAN_BUILD"
else
print_header "build Bareos packages"
print_header "build Bareos core packages"
fakeroot debian/rules binary

print_header "create Debian package repository"
cd ..
dpkg-scanpackages . > Packages
gzip --keep Packages
ls -la Packages*
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 packages"
sudo apt-get -qq update
sudo apt-get install -y --force-yes bareos bareos-database-$DB
fi
if [ "${BUILD_WEBUI}" ]; then
cd ../webui
# to avoid timestamp conflicts while autoconfiguring we refresh every file
touch *
if [ "${COVERITY_SCAN}" ]; then
# run configure with default options
debian/rules override_dh_auto_configure
eval "$COVERITY_SCAN_BUILD"
else
print_header "build Bareos webui packages"
fakeroot debian/rules binary
fi
fi
print_header "create Debian package repository"
cd ..
dpkg-scanpackages . > Packages
gzip --keep Packages
ls -la Packages*
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; fi
4 changes: 2 additions & 2 deletions README.md
@@ -1,6 +1,7 @@
# <img src="https://raw.githubusercontent.com/bareos/bareos/master/webui/public/img/bareos.png" alt="Bareos" />

[![Build Status](https://travis-ci.org/bareos/bareos.png?branch=master)](https://travis-ci.org/bareos/bareos/branches)

[![Build Status](https://travis-ci.org/bareos/bareos.png?branch=master)](https://travis-ci.org/bareos/bareos/branches)<br><a href="https://www.saucelabs.com/"> <img src="http://info.saucelabs.com/rs/468-XBT-687/images/Powered+by+Sauce+Labs+badges+white.svg" alt="Saucelabs" width="90px"/></a>

### Bareos

Expand Down Expand Up @@ -48,4 +49,3 @@ The Bareos project offers two mailing lists: bareos-users and bareos-devel.
### Packages

* [http://download.bareos.org](http://download.bareos.org)

1 change: 1 addition & 0 deletions core/debian/control
Expand Up @@ -28,6 +28,7 @@ Build-Depends: acl-dev,
libwrap0-dev,
libx11-dev,
libsqlite3-dev, default-libmysqlclient-dev | libmysqlclient-dev, libpq-dev,
libjansson-dev,
logrotate,
lsb-release,
mtx [!hurd-any],
Expand Down
1 change: 1 addition & 0 deletions core/debian/control.in
Expand Up @@ -28,6 +28,7 @@ Build-Depends: acl-dev,
libwrap0-dev,
libx11-dev,
libsqlite3-dev, default-libmysqlclient-dev | libmysqlclient-dev, libpq-dev,
libjansson-dev,
logrotate,
lsb-release,
mtx [!hurd-any],
Expand Down
2 changes: 1 addition & 1 deletion webui/debian/rules 100644 → 100755
Expand Up @@ -10,7 +10,7 @@
# Modified to make a template file for a multi-binary package with separated
# build-arch and build-indep targets by Bill Allombert 2001

BAREOS_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' )
BAREOS_VERSION := $(shell sed -n 2p ../core/src/include/version.h | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}')

# Uncomment this to turn on verbose mode.
export DH_VERBOSE = 1
Expand Down

0 comments on commit cb4f22b

Please sign in to comment.