comparison init.gradle @ 115:8ddd1a6fa4ea

patch to improve identification of bamboo severs
author smith@nwoca.org
date Wed, 31 Oct 2012 22:27:31 +0100
parents 9ed6a36104ed
children 6f1918544f7f
comparison
equal deleted inserted replaced
114:9ed6a36104ed 115:8ddd1a6fa4ea
7 loadEnvironments() 7 loadEnvironments()
8 8
9 9
10 gradle.addListener(new ArtifactoryGradleSettings()) 10 gradle.addListener(new ArtifactoryGradleSettings())
11 11
12 gradle.ext.bambooBuild = System.getenv().any { it.key.startsWith('BAMBOO')} 12 def hostname
13 logger.info "applying SSDT artifactory Gradle Settings (bamboo: $gradle.bambooBuild)" 13 try { hostname = "hostname".execute().text.toLowerCase().readLines().first() } catch (e) { hostname = 'unknown'}
14
15 gradle.ext.bambooBuild = System.getenv().any { it.key.startsWith('BAMBOO')} || hostname?.startsWith('ssdt-')
16
17 logger.info "applying SSDT artifactory Gradle Settings (bamboo: $gradle.bambooBuild host: $hostname)"
14 18
15 if (gradle.bambooBuild) { 19 if (gradle.bambooBuild) {
16 gradle.ext.ssdtGradlekitLocation = gradle.ext.has('ssdtGradlekitLocation') ? gradle.ssdtGradlekitLocation : 'http://hg.ssdt-ohio.org/ssdt/gradlekit/raw-file/tip' 20 gradle.ext.ssdtGradlekitLocation = gradle.ext.has('ssdtGradlekitLocation') ? gradle.ssdtGradlekitLocation : 'http://hg.ssdt-ohio.org/ssdt/gradlekit/raw-file/tip'
17 apply from: "${gradle.ssdtGradlekitLocation}/artifactory.gradle" 21 apply from: "${gradle.ssdtGradlekitLocation}/artifactory.gradle"
18 } 22 }
117 } 121 }
118 } 122 }
119 123
120 124
121 task showEnvironments << { 125 task showEnvironments << {
122 println "Defined environments: $gradle.environments" 126 println "Defined environments: $gradle.environments"
123 gradle.environments.each { e -> 127 gradle.environments.each { e ->
124 println "\n $e:" 128 println "\n $e:"
125 gradle.getProperty(e).flatten().each { k, v -> 129 gradle.getProperty(e).flatten().each { k, v ->
126 println String.format(' %25s = %s',k, k.contains('password') ? "********" : v ) 130 println String.format(' %25s = %s',k, k.contains('password') ? "********" : v )
127 } 131 }
128 } 132 }
133 // println "System Properties: "
134 // System.properties.each { println " $it" }
129 } 135 }
130 136
131 def loadEnvironments() { 137 def loadEnvironments() {
132 def developerPrivate = new Properties() 138 def developerPrivate = new Properties()
133 if (file('private.properties').exists()) { 139 if (file('private.properties').exists()) {