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