1
0
mirror of https://github.com/GeyserMC/Floodgate.git synced 2025-12-19 14:59:20 +00:00

Jenkins uses env variables

This commit is contained in:
Tim203
2022-04-02 16:21:50 +02:00
parent 9ff6ad8589
commit 8d52ffd28d

View File

@@ -45,9 +45,9 @@ fun Project.lastCommitHash(): String? =
// retrieved from https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project
// some properties might be specific to Jenkins
fun Project.branchName(): String =
System.getProperty("GIT_BRANCH", "local/dev")
System.getenv("GIT_BRANCH") ?: "local/dev"
fun Project.buildNumber(): Int =
Integer.parseInt(System.getProperty("BUILD_NUMBER", "-1"))
Integer.parseInt(System.getenv("BUILD_NUMBER") ?: "-1")
fun Project.buildNumberAsString(): String =
buildNumber().takeIf { it != -1 }?.toString() ?: "??"