switch from using gradle.properties to enviroment variables for repository auth

This commit is contained in:
Pyrbu 2023-06-19 13:45:32 +02:00
parent 600d3f2fca
commit 6686e98836
2 changed files with 6 additions and 8 deletions

2
.gitignore vendored

@ -44,5 +44,3 @@ bin/
/plugin/run/
/.idea/
gradle.properties

@ -22,13 +22,13 @@ publishing {
}
repositories {
maven {
if (properties.containsKey("DIST_USERNAME") && properties.containsKey("DIST_PASSWORD")) {
credentials {
username properties.get("DIST_USERNAME")
password properties.get("DIST_PASSWORD")
}
Map<String, String> systemProperties = System.getenv()
credentials {
if (systemProperties.containsKey("DIST_USERNAME")) username systemProperties.get("DIST_USERNAME")
if (systemProperties.containsKey("DIST_PASSWORD")) password systemProperties.get("DIST_PASSWORD")
}
url = uri("https://repo.pyr.lol/releases/")
// If the BUILD_ID enviroment variable is present that means its a Jenkins build & that it should go into the snapshots repo
url = systemProperties.containsKey("BUILD_ID") ? uri("https://repo.pyr.lol/snapshots/") : uri("https://repo.pyr.lol/releases/")
}
}
}