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

Create DB job

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

Make install job

./autogen.sh
./configure --prefix="$WORKSPACE/build"
make
make install
  • 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, make-install
  • 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:
./version.sh
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: #nav
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 the following changes:
  • Congfigure
  • IRC Notification: Notification Strategy: Change
  • Save
  • Restart
  • Test

Future ideas

  • 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
devel/hudson.1278581811.txt.gz · Last modified: 2010/07/08 11:36 by thomaska