changeset 129:bef2bfc61f6e

CM-133: fix bamboo plan parsing. enable showEnv to display sytem properties and env variables in -info mode
author smith@nwoca.org
date Wed, 05 Jun 2013 02:29:48 +0100
parents c93df17513f1
children 253374129034
files init.gradle
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/init.gradle	Tue Jun 04 23:13:59 2013 +0100
+++ b/init.gradle	Wed Jun 05 02:29:48 2013 +0100
@@ -14,7 +14,8 @@
 
 gradle.ext.bambooBuild = System.getenv().any { it.key.startsWith('BAMBOO')} || hostname?.startsWith('ssdt-')
 
-gradle.ext.bambooPlan = System.getenv('BAMBOO_PLAN') ?: 'UNKNOWN'
+gradle.ext.bambooPlan = (System.getenv('BAMBOO_PLAN') ?: 'UNKNOWN-UNKNOWN-JOB1').split('-')[0..1].join('-')
+logger.info "Bamboo plan: ${gradle.bambooPlan}"
 
 gradle.ext.hgRepositoryUrl = ""
 try {
@@ -192,8 +193,12 @@
             println String.format('  %25s = %s',k, k.contains('password') ? "********" : v )
         }
     }
-//    println "System Properties: "    
-//    System.properties.each { println "    $it" }
+    if (logger.isInfoEnabled() ) {
+        println "System properties:"
+        System.properties.each { println "    $it" }
+        println "env variables:"
+        System.getenv().each { println "    $it" }
+    }
 }
 
 def loadEnvironments() {