xref: /5.5.2/couchdb/test/ci/domain (revision 80992523)
1#!/bin/bash
2
3if [ ! -f ~/.cienv ]; then
4cat > ~/.cienv <<EOF
5    export CINAME=ci-views
6    export WORKSPACE=/opt/build
7    export RELEASE=5.0.0
8    export MANIFEST="couchbase-server/spock.xml"
9    export MODE="test"
10    export BRANCH="unstable"
11    #export WATCHERS="somebody@couchbase.com nobody@couchbase.com"
12    #export PEGGED=1979          # Set to fix base build, 0 means latest
13    #export GERRIT="90331 90332" # Pick up uncommitted changes from gerrit
14EOF
15fi
16source ~/.cienv
17
18if [ "$WORKSPACE" = "" ]; then
19  echo 'WORKSPACE not set'
20  exit 2
21fi
22
23if [ "$MODE" = "" ]; then
24  echo MODE must be set to 'test'
25  exit 2
26fi
27
28if [ "$MANIFEST" == "" ]; then
29  echo MANIFEST must be set
30fi
31
32if [ "$RELEASE" == "" ]; then
33  echo RELEASE must be set
34fi
35
36cd /var/www
37(ls -t logs-*.tar* | head -n 30; ls -t logs-*.tar*) | sort | uniq -u | xargs -r rm
38(ls -t make-*.log | head -n 3; ls -t make-*.log) | sort | uniq -u | xargs -r rm
39export TS="`date +%d.%m.%Y-%H.%M`"
40echo '<html><head></head><body><pre>' > /var/www/views-current.html
41chmod a+rx /var/www/views-current.html
42dobuild clean 1>>/var/www/views-current.html 2>&1; rc=$?
43test $rc -eq 0 && dotest 1>>/var/www/views-current.html 2>&1; rc=$?
44echo '</pre>' >> /var/www/views-current.html
45if [ $rc -eq 0 ]; then status=pass; else status=fail; fi
46echo '<pre>' >> /var/www/views-current.html
47gzip ${WORKSPACE}/logs.tar 2>&1 1>/dev/null
48echo "Version: <a href='versions-$TS.cfg'>versions-$TS.cfg</a>" >> /var/www/views-current.html
49echo "Build Log: <a href='make-$TS.log'>make-$TS.log</a>" >> /var/www/views-current.html
50echo "Server Log: <a href='logs-$TS.tar.gz'>logs-$TS.tar.gz</a>" >> /var/www/views-current.html
51echo "</pre><h1>Finished</h1></body></html>" >> /var/www/views-current.html
52cp  /var/www/views-current.html /var/www/views-$TS.$status.html
53mv ${WORKSPACE}/make.log /var/www/make-$TS.log
54mv ${WORKSPACE}/logs.tar.gz /var/www/logs-$TS.tar.gz
55mv ${WORKSPACE}/versions.cfg /var/www/versions-$TS.cfg
56dowatch
57