You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2020/03/04 06:13:07 UTC
[groovy] branch GROOVY_2_4_X updated: make CI smarter about finding
artifactory.properties
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch GROOVY_2_4_X
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/GROOVY_2_4_X by this push:
new 7feb25e make CI smarter about finding artifactory.properties
7feb25e is described below
commit 7feb25e15a64429ec83db474d491a829af894e47
Author: Paul King <pa...@asert.com.au>
AuthorDate: Wed Mar 4 15:11:00 2020 +1000
make CI smarter about finding artifactory.properties
---
gradle/publish.gradle | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/gradle/publish.gradle b/gradle/publish.gradle
index b454071..d7403f6 100644
--- a/gradle/publish.gradle
+++ b/gradle/publish.gradle
@@ -22,9 +22,15 @@ ext.artifactoryUser = project.hasProperty('artifactoryUser') ? project.artifacto
ext.artifactoryPassword = project.hasProperty('artifactoryPassword') ? project.artifactoryPassword : System.getenv('ARTIFACTORY_PASSWORD')
if (!artifactoryUser) {
- // try to read from properties
- def artifactoryFile = file('artifactory.properties')
+ // try to read artifactory.properties
+ def base = file(projectDir)
+ def artifactoryFile = new File(base, 'artifactory.properties')
+ while (!artifactoryFile.exists() && base) {
+ base = base.parentFile
+ artifactoryFile = new File(base, 'artifactory.properties')
+ }
if (artifactoryFile.exists()) {
+ logger.lifecycle 'Found artifactory.properties in ' + base.path
def props = new Properties()
props.load(artifactoryFile.newReader())
ext.artifactoryUser = props.getProperty('artifactoryUser','')