changeset 93:f351338a3b3a

adding useful scripts
author smith@nwoca.org
date Wed, 22 Feb 2012 19:14:04 +0000
parents 90325a10fe95
children 1290b23e7b76
files scripts/antall.groovy scripts/cloneAll.groovy scripts/hgall.groovy scripts/hgcommit.groovy scripts/pullall.groovy
diffstat 5 files changed, 67 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/antall.groovy	Wed Feb 22 19:14:04 2012 +0000
@@ -0,0 +1,21 @@
+
+def targets = 'clean default'
+if (args) {
+    targets = args.join(' ')
+}
+
+new File('.').traverse([type: groovy.io.FileType.DIRECTORIES, maxDepth:2]) { project -> 
+    def script = new File(project,'build.xml')            
+    if (script.exists() ) {
+        
+        def out = new StringBuffer()
+        def err = new StringBuffer()
+        println "-" * 50
+        println "processing: $script ($targets)" 
+        def proc =  "cmd /C ant $targets".execute(null,project)
+        proc.consumeProcessOutput(out,out)
+        proc.waitForOrKill(480 * 1000)
+        new File(project,"build.log").text = out.toString()               
+        println out 
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/cloneAll.groovy	Wed Feb 22 19:14:04 2012 +0000
@@ -0,0 +1,14 @@
+
+def path = "/hg/ssdt/USPS"
+def parent = path.split('/').last()
+def repos =  "ssh ssdt-web-05 -C ls $path".execute().text.split('\n')
+
+println parent
+println repos 
+
+new File(parent).mkdir()
+
+repos.each {
+ println "cloning: $path/$it to $parent/$it ..."
+ println  "hg clone ssh://hg.ssdt-ohio.org/$path/$it $parent/$it".execute().text
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/hgall.groovy	Wed Feb 22 19:14:04 2012 +0000
@@ -0,0 +1,11 @@
+
+cmd = args ? args.join(' ') : 'out'
+
+new File(".").eachDirRecurse { d ->
+
+   if  ( new File(d,".hg").exists() ) {   
+     println "$d.absolutePath: $cmd \n-----------------------------------"      
+     println  "hg -R ${d.absolutePath} ${cmd}".execute().text
+      
+  }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/hgcommit.groovy	Wed Feb 22 19:14:04 2012 +0000
@@ -0,0 +1,11 @@
+
+comment = args ? args.join(' ') : 'out'
+
+new File(".").eachDirRecurse { d ->
+
+   if  ( new File(d,".hg").exists() ) {   
+     println "$d.absolutePath: $comment \n-----------------------------------"      
+     println  "hg -R ${d.absolutePath} commit -m \"${comment}\"".execute().text
+      
+  }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/pullall.groovy	Wed Feb 22 19:14:04 2012 +0000
@@ -0,0 +1,10 @@
+
+new File(".").eachDir { d ->
+
+   if  ( new File(d,".hg").exists() ) {   
+      println d.name
+      
+     println  "hg pull -R ${d.name} -u".execute().text
+      
+  }
+}
\ No newline at end of file