comparison init70-github.gradle @ 346:3504897af0f5

use github vars
author Marc Davis <marc.davis@mcoecn.org>
date Tue, 25 Jul 2023 14:31:34 -0400
parents b892973af800
children 1d55012b6af3
comparison
equal deleted inserted replaced
345:172495bee8a1 346:3504897af0f5
700 } 700 }
701 701
702 } 702 }
703 703
704 void setBranchInfo() { 704 void setBranchInfo() {
705 gradle.ext.branch = new BranchInfo(System.getenv('bamboo_planRepository_branch')) 705 gradle.ext.branch = new BranchInfo(System.getenv('head_ref'))
706 gradle.ext.branchName = gradle.branch.name 706 gradle.ext.branchName = gradle.branch.name
707 gradle.ext.branchStream = gradle.branch.stream 707 gradle.ext.branchStream = gradle.branch.stream
708 gradle.ext.branchHash = gradle.branch.hash 708 gradle.ext.branchHash = gradle.branch.hash
709 println "${gradle.hgRepositoryUrl} ${gradle.branch} ${gradle.branch.version}" 709 println "${gradle.hgRepositoryUrl} ${gradle.branch} ${gradle.branch.version}"
710 } 710 }
716 def buildNumber = "" 716 def buildNumber = ""
717 def changeset = "" 717 def changeset = ""
718 def version 718 def version
719 719
720 String toString() { 720 String toString() {
721 "{name:$name, stream:$stream, buildNumber:$buildNumber, changeSet:$changeset, version:$version" 721 "{name:$name, stream:$stream, buildNumber:$buildNumber, changeSet:$changeset, version:$version}"
722 } 722 }
723 723
724 BranchInfo(name) { 724 BranchInfo(name) {
725 this.name = name 725 this.name = name
726 if (!name) { 726 if (!name) {
727 this.name = determineName() ?: '' 727 this.name = determineName() ?: ''
728 } 728 }
729 this.name = this.name.replace('@', '-') 729 this.name = this.name.replace('@', '-')
730 determineStream() 730 determineStream()
731 buildNumber = System.getenv('bamboo_buildNumber') ?: "" 731 buildNumber = System.getenv('run_number') ?: ""
732 changeset = System.getenv('bamboo_planRepository_revision') ?: "" 732 changeset = System.getenv('sha') ?: ""
733 } 733 }
734 734
735 String getDefaultDependencyStatus() { 735 String getDefaultDependencyStatus() {
736 return isRelease() ? 'release' : 'integration' 736 return isRelease() ? 'release' : 'integration'
737 } 737 }
780 } 780 }
781 781
782 private Version findSnapshotVersion() { 782 private Version findSnapshotVersion() {
783 println "findSnapshotVersion()" 783 println "findSnapshotVersion()"
784 try { 784 try {
785 def repositoryUrl = System.getenv('bamboo_planRepository_repositoryUrl') 785 def repositoryUrl = System.getenv('repositoryUrl')
786 if (repositoryUrl) { 786 if (repositoryUrl) {
787 println "git pull $repositoryUrl".execute().text 787 println "git pull $repositoryUrl".execute().text
788 } 788 }
789 def versions = "git tag".execute().text.split("\n") 789 def versions = "git tag".execute().text.split("\n")
790 .findAll { it != null || it != "" } 790 .findAll { it != null || it != "" }