comparison init40-github.gradle @ 349:45fc06cbb6b2

use github system properties
author Marc Davis <marc.davis@mcoecn.org>
date Wed, 26 Jul 2023 08:30:15 -0400
parents 9791f84cfc67
children 7b6d30651db7
comparison
equal deleted inserted replaced
348:aa5e8be335d6 349:45fc06cbb6b2
704 } 704 }
705 705
706 } 706 }
707 707
708 void setBranchInfo() { 708 void setBranchInfo() {
709 def branchInfo = new BranchInfo(System.getenv('bamboo_planRepository_branch')) 709 def branchInfo = new BranchInfo(System.getenv('ssdt_head_ref'))
710 gradle.ext.branch = branchInfo 710 gradle.ext.branch = branchInfo
711 gradle.ext.branchName = gradle.branch.name 711 gradle.ext.branchName = gradle.branch.name
712 gradle.ext.branchStream = gradle.branch.stream 712 gradle.ext.branchStream = gradle.branch.stream
713 gradle.ext.branchHash = gradle.branch.hash 713 gradle.ext.branchHash = gradle.branch.hash
714 println "${gradle.hgRepositoryUrl} ${gradle.branch} ${gradle.branch.version}" 714 println "${gradle.hgRepositoryUrl} ${gradle.branch} ${gradle.branch.version}"
715 } 715 }
716 716
717 717
718 @ToString(includes=['name','shortName','buildVersion','imageId','deployName'],includeNames= true)
719 class BranchInfo { 718 class BranchInfo {
720 def name 719 def name
721 def stream = "none" 720 def stream = "none"
722 def buildNumber = "" 721 def buildNumber = ""
723 def changeset = "" 722 def changeset = ""
724 def version 723 def version
725 724
725 String toString() {
726 "{name:$name, stream:$stream, buildNumber:$buildNumber, changeSet:$changeset, version:$version}"
727 }
728
726 BranchInfo(name) { 729 BranchInfo(name) {
727 this.name = name 730 this.name = name
728 if (!name) { 731 if (!name) {
729 this.name = determineName() ?: '' 732 this.name = determineName() ?: ''
730 } 733 }
731 this.name = this.name.replace('@', '-') 734 this.name = this.name.replace('@', '-')
732 determineStream() 735 determineStream()
733 buildNumber = System.getenv('bamboo_buildNumber') ?: "" 736 buildNumber = System.getenv('ssdt_run_number') ?: ""
734 changeset = System.getenv('bamboo_planRepository_revision') ?: "" 737 changeset = System.getenv('ssdt_sha') ?: ""
735 } 738 }
736 739
737 String getDefaultDependencyStatus() { 740 String getDefaultDependencyStatus() {
738 return isRelease() ? 'release' : 'integration' 741 return isRelease() ? 'release' : 'integration'
739 } 742 }
782 } 785 }
783 786
784 private Version findSnapshotVersion() { 787 private Version findSnapshotVersion() {
785 println "findSnapshotVersion()" 788 println "findSnapshotVersion()"
786 try { 789 try {
787 def repositoryUrl = System.getenv('bamboo_planRepository_repositoryUrl') 790 def repositoryUrl = System.getenv('ssdt_repositoryUrl')
788 if (repositoryUrl) { 791 if (repositoryUrl) {
789 println "git pull $repositoryUrl".execute().text 792 println "git pull $repositoryUrl".execute().text
790 } 793 }
791 def versions = "git tag".execute().text.split("\n") 794 def versions = "git tag".execute().text.split("\n")
792 .findAll { it != null || it != "" } 795 .findAll { it != null || it != "" }