From: megacz Date: Fri, 30 Jan 2004 06:45:27 +0000 (+0000) Subject: 2002/04/27 04:39:17 X-Git-Tag: RC3~1849 X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=commitdiff_plain;h=88ffc93f505271834240412c9d17c4dea1b8ab77 2002/04/27 04:39:17 darcs-hash:20040130064527-2ba56-9ce8b99899fa068855057a164c035703cd1f58f6.gz --- diff --git a/CHANGES b/CHANGES index 7fd9de7..2f614d9 100644 --- a/CHANGES +++ b/CHANGES @@ -43,6 +43,9 @@ 26-Apr megacz src/org/xwt/TinySSL.java: fixed PKCS1 bug +26-Apr megacz build.xml: staging/production push process + + diff --git a/build.xml b/build.xml index 79980cd..3b09121 100644 --- a/build.xml +++ b/build.xml @@ -124,38 +124,77 @@ - - + + + + + - find www/html -name \*~ | xargs rm -f + + + + + - # throw on the prefix/suffix where needed - rm -f /tmp/delete-$$ - for A in `find www/html -name \*.html_` - do (cat www/html/prefix.html; cat $A; cat www/html/suffix.html; cat "$A"_ 2>/dev/null; cat www/html/tagline.html) > `echo $A | sed s/_\$//g` - echo $A | sed s/_\$//g >> /tmp/delete-$$ - done + + - # in theory, we should be able to slam a fully-functional - # copy of the xwt server onto any debian machine with the - # right packages preinstalled (roughly: bind, apache, libapache-mod-ssl - # apache-ssl, sshd, rsync, j2sdk, tomcat) + + + + # first, clone the currently running copy of xwt, so we can use rsync to save bandwidth - ssh root@xwt.org "rm -rf /xwt-new; mkdir -p /xwt; mkdir -p /xwt-new; cd /xwt; tar cf - . | tar xf - -C /xwt-new" + rm -rf /xwt-new + mkdir -p /xwt + mkdir -p /xwt-new + cd /xwt + tar cf - . | tar xf - -C /xwt-new + - # now, rsync to process our changes - rsync -Pv --delete -rze ssh www/ root@xwt.org:/xwt-new/www/ + + # tidy up and rsync our changes + find www/html -name \*~ | xargs rm -f + rsync -Pv --delete -rze ssh www/ root@${host}:/xwt-new/www/ + + + + # stop services + /sbin/start-stop-daemon --stop --pidfile /var/log/xwt/apache.pid --exec /usr/sbin/apache + /sbin/start-stop-daemon --stop --pidfile /var/log/xwt/tomcat.pid --user www-data + + rm -rf /xwt-old + mv /xwt /xwt-old + mv /xwt-new /xwt - # clean up generated html - cat /tmp/delete-$$ | xargs rm - rm -f /tmp/delete-$$ + mkdir /var/log/xwt &>/dev/null + chown www-data /var/log/xwt/ - # stop services, clean up, transfer control, and restart services - ssh root@xwt.org "chmod +x /xwt-new/www/bounce.sh; /xwt-new/www/bounce.sh" + ln -s /xwt/www/webapps /xwt/www/webapps/ROOT + ln -s /xwt/www/webapps /xwt/www/webapps/WEB-INF + ln -s /xwt/www/launch /xwt/www/launch/ROOT + ln -s /xwt/www/launch /xwt/www/launch/WEB-INF + + export JAVA_HOME=/usr/lib/j2sdk1.3 + export CLASSPATH=$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/tools.jar:/usr/share/tomcat/classes:/usr/share/tomcat/lib/tomcat.jar + + touch /var/log/xwt/tomcat.log + chown www-data /var/log/xwt/tomcat.log + + test ${host} == "xwt-staging.org" && echo -e "User-agent: *\nDisallow: /\n" > /xwt/www/html/robots.txt + + /sbin/start-stop-daemon \ + --start --pidfile /var/log/xwt/tomcat.pid --make-pidfile --chuid www-data --exec \ + /usr/lib/j2sdk1.3/bin/java -- -server -Dtomcat.home=/usr/share/tomcat -Xmx500M \ + org.apache.tomcat.startup.Main -config /xwt/www/etc/server.xml start \ + >> /var/log/xwt/tomcat.log 2>&1 & + + /sbin/start-stop-daemon --start --pidfile /var/log/xwt/apache.pid --exec /usr/sbin/apache -- -f /xwt/www/etc/httpd.conf ${staging-flag} + +