====== 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 ===== * New Job * Name: make-install, Type: freestyle * SCM: mercurial repo: http://nav.uninett.no/hg/series/3.6.x/ branch: 3.6.x * Build Triggers: Poll SCM schedule: * * * * * * Build: Execute shell ./autogen.sh ./configure --prefix="$WORKSPACE/build" make make install * Test build ===== Create DB job ===== * New Job * Name: createdb, Type: freestyle * SCM: mercurial repo: http://nav.uninett.no/hg/series/3.6.x/ branch: 3.6.x * Build Triggers: After other: make-install * Build env: PGDATABASE=nav-$JOB_NAME * Build: Execute shell ./tests/createdb-test.sh * Test build ===== Python tests build ===== * New Job * Name: python-tests, Type: freestyle * SCM: mercurial repo: http://nav.uninett.no/hg/series/3.6.x/ branch: 3.6.x * Build Triggers: After other: make-install * Build env: 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 ===== * New Job * Name: upgradedb, Type: freestyle * SCM: mercurial repo: http://nav.uninett.no/hg/series/3.6.x/ branch: 3.6.x * Build Triggers: After other: createdb * Build env: PGDATABASE=nav-$JOB_NAME OTHER_URL=http://nav.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 ===== Javascript Testing ===== * Install Node Package Manager apt-get install make python g++ wget -N http://nodejs.org/dist/node-latest.tar.gz tar xzvf node-latest.tar.gz && cd `ls -rd node-v*` ./configure make install * ''npm install -g buster'' * install Xvfb * ''dbus-x11'' maybe needed * install google chrome * Fetch correct package from https://www.google.com/intl/en/chrome/browser/ * Install: ''dpkg -i '' * Maybe you need some apt-fu: ''apt-get install -f'' * install imagemagick (for screenshots) ===== Future ideas ===== * Use LDAP for auth * Perform schema diff of upgraded DB