Mercurial > public > develkit
comparison init.gradle @ 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 | 9ce07c211984 |
comparison
equal
deleted
inserted
replaced
128:c93df17513f1 | 129:bef2bfc61f6e |
---|---|
12 def hostname | 12 def hostname |
13 try { hostname = "hostname".execute().text.toLowerCase().readLines().first() } catch (e) { hostname = 'unknown'} | 13 try { hostname = "hostname".execute().text.toLowerCase().readLines().first() } catch (e) { hostname = 'unknown'} |
14 | 14 |
15 gradle.ext.bambooBuild = System.getenv().any { it.key.startsWith('BAMBOO')} || hostname?.startsWith('ssdt-') | 15 gradle.ext.bambooBuild = System.getenv().any { it.key.startsWith('BAMBOO')} || hostname?.startsWith('ssdt-') |
16 | 16 |
17 gradle.ext.bambooPlan = System.getenv('BAMBOO_PLAN') ?: 'UNKNOWN' | 17 gradle.ext.bambooPlan = (System.getenv('BAMBOO_PLAN') ?: 'UNKNOWN-UNKNOWN-JOB1').split('-')[0..1].join('-') |
18 logger.info "Bamboo plan: ${gradle.bambooPlan}" | |
18 | 19 |
19 gradle.ext.hgRepositoryUrl = "" | 20 gradle.ext.hgRepositoryUrl = "" |
20 try { | 21 try { |
21 gradle.ext.hgRepositoryUrl = "hg path".execute().text.split('=')[1].trim() | 22 gradle.ext.hgRepositoryUrl = "hg path".execute().text.split('=')[1].trim() |
22 } catch (e) {} | 23 } catch (e) {} |
190 println "\n $e:" | 191 println "\n $e:" |
191 gradle.getProperty(e).flatten().each { k, v -> | 192 gradle.getProperty(e).flatten().each { k, v -> |
192 println String.format(' %25s = %s',k, k.contains('password') ? "********" : v ) | 193 println String.format(' %25s = %s',k, k.contains('password') ? "********" : v ) |
193 } | 194 } |
194 } | 195 } |
195 // println "System Properties: " | 196 if (logger.isInfoEnabled() ) { |
196 // System.properties.each { println " $it" } | 197 println "System properties:" |
198 System.properties.each { println " $it" } | |
199 println "env variables:" | |
200 System.getenv().each { println " $it" } | |
201 } | |
197 } | 202 } |
198 | 203 |
199 def loadEnvironments() { | 204 def loadEnvironments() { |
200 def developerPrivate = new Properties() | 205 def developerPrivate = new Properties() |
201 if (file('private.properties').exists()) { | 206 if (file('private.properties').exists()) { |