comparison init70-github.gradle @ 339:21b015e926ff

testing
author marc_davis <davis@ssdt-ohio.org>
date Tue, 30 May 2023 13:26:58 -0400
parents 0befe249fc6f
children 5b1ab7484ad7
comparison
equal deleted inserted replaced
338:0befe249fc6f 339:21b015e926ff
33 hostname = "hostname".execute().text.toLowerCase().readLines().first() 33 hostname = "hostname".execute().text.toLowerCase().readLines().first()
34 } catch (e) { 34 } catch (e) {
35 hostname = 'unknown' 35 hostname = 'unknown'
36 } 36 }
37 37
38 System.getenv().each { println it } 38 //Determine if the build is a CI build.
39
40 gradle.ext.bambooBuild = System.getenv().any { 39 gradle.ext.bambooBuild = System.getenv().any {
41 it.key.toLowerCase().contains('ci') 40 it.key.toLowerCase().contains('ci') ||
41 it.key.toLowerCase().contains('github')
42 } 42 }
43 43
44 gradle.ext.bambooLocalBuild = false 44 gradle.ext.bambooLocalBuild = false
45 45
46 gradle.ext.bambooPlan = (System.getenv('BAMBOO_PLAN') ?: 'UNKNOWN-UNKNOWN-JOB1').split('-')[0..1].join('-') 46 gradle.ext.bambooPlan = (System.getenv('BAMBOO_PLAN') ?: 'UNKNOWN-UNKNOWN-JOB1').split('-')[0..1].join('-')
801 .findAll { it.contains('release') || it.contains('hotfix') } 801 .findAll { it.contains('release') || it.contains('hotfix') }
802 .collect { it.replaceAll('\\s+', ' ').split('/').last() - 'v' } 802 .collect { it.replaceAll('\\s+', ' ').split('/').last() - 'v' }
803 .collect { new Version(*it.split('\\.')*.toInteger()) } 803 .collect { new Version(*it.split('\\.')*.toInteger()) }
804 804
805 def results = (branches + versions).sort { v1, v2 -> v2 <=> v1 } 805 def results = (branches + versions).sort { v1, v2 -> v2 <=> v1 }
806
807 results.each {
808 println it
809 }
810
806 if (results.isEmpty()) { 811 if (results.isEmpty()) {
807 return new Version().nextSnapshot() 812 return new Version().nextSnapshot()
808 } else { 813 } else {
809 return results.first().nextSnapshot() 814 return results.first().nextSnapshot()
810 } 815 }