diff extra/soundsoftware/extract-docs.sh @ 218:292cde42265a feature_20

* Enable Embedded on projects that have new documentation
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Fri, 11 Feb 2011 16:21:55 +0000
parents 1e55195bca45
children c3544e9fd588
line wrap: on
line diff
--- a/extra/soundsoftware/extract-docs.sh	Mon Feb 07 16:46:28 2011 +0000
+++ b/extra/soundsoftware/extract-docs.sh	Fri Feb 11 16:21:55 2011 +0000
@@ -8,6 +8,11 @@
 hgdir="/var/hg"
 docdir="/var/doc"
 
+apikey=""
+apihost=""
+apiuser=""
+apipass=""
+
 progdir=$(dirname $0)
 case "$progdir" in
     /*) ;;
@@ -23,6 +28,16 @@
     fi
 done
 
+enable_embedded()
+{
+    p="$1"
+    if [ -n "$apiuser" ]; then
+	curl -u "$apiuser":"$apipass" "http://$apihost/sys/projects/$p/embedded.xml?enable=1&key=$apikey" -d ""
+    else
+	curl "http://$apihost/sys/projects/$p/embedded.xml?enable=1&key=$apikey" -d ""
+    fi
+}
+
 for projectdir in "$hgdir"/* ; do
 
     if [ -d "$projectdir" ] && [ -d "$projectdir/.hg" ]; then
@@ -59,6 +74,7 @@
 # # If we have just written something to a doc directory that was
 # # previously empty, we should switch on Embedded for this project
 		echo "This project hasn't had doc extracted before -- I should switch on Embedded for it at this point"
+		enable_embedded "$project"
 	    fi
 
 	    if [ -d "$targetdir" ]; then