User Tools

Site Tools


devel:hudson

This is an old revision of the document!


Hudson

Instalation

  • Install deb for hudson
  • chmod +rx /var/lib/hudson (to allow apache access)
  • Goto host:8080

Basic setup

  • Mangage hudson
  • Plugins
  • Installed
  • Remove all installed plugins
  • Restart
  • Mangage hudson
  • Plugins
  • Available
  • Check Green Balls, Setenv, and Mercurial Plugin
  • Install (and wait for success)
  • Restart
  • Mangage hudson
  • Configure system
  • Environment variables
DJANGO_SETTINGS_MODULE=nav.django.settings
PGHOST=navdevdb
PGUSER=navtest
PGPASSWORD=s3cret
CLASSPATH=/usr/share/java/libsnmp-1.4.jar
  • Hudson has no security enabled by default, so be sure to enable appropriate settings for your install.

Make install job

./autogen.sh
./configure --prefix="$WORKSPACE/build"
make
make install
  • Test build

Create DB job

PGDATABASE=nav-$JOB_NAME
  • Build: Execute shell
./tests/createdb-test.sh
  • Test build

Python tests build

PGDATABASE=nav-$JOB_NAME
  • Build: Execute shell
./tests/bootstrap-test-environment.sh "$WORKSPACE/build"
source "$WORKSPACE/build/bin/activate"
cd "$WORKSPACE/build/lib/python/"
nosetests --with-xunit --verbose
  • Post build: Publish JUnit: **/nosetests.xml
  • Test build

Crawler / validation job

  • New Job
  • Name: crawler-tests, Copy: python-tests
  • Build Triggers: After other: createdb
  • Build env:
PGDATABASE=nav-$JOB_NAME
TARGETURL=https://elixis.uninett.no/
ADMINPASSWORD=s3cret
  • Build: Execute shell:
./tests/bootstrap-test-environment.sh "$WORKSPACE/build"
source "$WORKSPACE/build/bin/activate"
nosetests --with-xunit --verbose tests/crawler-test.py
  • Post build: Publish JUnit: **/nosetests.xml
  • Setup apache
  • Test build

Upgrade DB job

PGDATABASE=nav-$JOB_NAME
OTHER_URL=http://metanav.uninett.no/hg/series/3.5.x/
OTHER_FOLDER=$WORKSPACE/3.5
UPGRADE_FILES=3.6.*.sql trunk.sql
  • Build: Execute shell:
test -d $OTHER_FOLDER && rm -rf $OTHER_FOLDER || true
hg clone $OTHER_URL $OTHER_FOLDER
cd $OTHER_FOLDER
hg update tip
../tests/createdb-test.sh
cd -
cd doc/sql/upgrades
for file in `eval echo $UPGRADE_FILES`; do
    out=`mktemp`
    psql -f $file 2>&1 | tee $out
    retval=`grep ERROR $out | wc -l`
    rm $out
    test $retval -eq 0
done
  • Test build

Notification setup

  • Manage Hudson
  • Manage Plugins
  • Available
  • Select Hudson IRC Plugin, Hudson instant-messaging plugin
  • Restart
  • Manage Hudson
  • Configure system
  • Enable IRC Notfication
Hostname: chat.eu.freenode.net
Post: 6667
Channels: #navbuild
Nickname: navbuild
Prefix: !
Hudson username: navbuild
Hudson passwrod: s3cret
  • Save
  • Manage Hudson
  • Manage Users
  • Create user
username: navbuild
password: s3cret
fullname: hudson irc bot
email: bot@example.com
  • create user
  • For each job perform enable IRC notification
  • Restart
  • Test

Future ideas

  • Hudson is currently only track adamcik/testing as this branch has the required helpers, so as soon as this lands in default/3.6.x Hudson should be updated to follow the correct repo.
  • Use LDAP for auth
  • Use metanav.uninett.no/hudson as proxy (with SSL?)
  • Perform schema diff of upgraded DB
  • Integrate new createdb script once written
  • As a new version of seeddb is being created, the old version has been blacklisted from the html validation test. This needs to be undone once the new seeddb version is merged.
devel/hudson.1278677747.txt.gz · Last modified: 2010/07/09 12:15 by thomaska