From f0a05a8256de5e01b608f9c2bef9146fb1c8e143 Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Thu, 31 Mar 2022 02:01:29 -0500 Subject: [PATCH] Try to automate Jenkins publishing --- build.gradle | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 8f80569..379ad64 100644 --- a/build.gradle +++ b/build.gradle @@ -91,7 +91,7 @@ static def getDate() { task buildProperties { ant.propertyfile(file: "$project.rootDir/src/main/resources/build.properties") { entry(key: "buildAuthor", default: System.getenv("JENKINS_URL") != null ? "jenkins" : "unknown") - entry(key: "buildNumber", value: System.getenv("JENKINS_URL") != null ? System.getenv("BUILD_NUMBER") + " (Jenkins)": getBuildNumber()) + entry(key: "buildNumber", value: System.getenv("JENKINS_URL") != null ? System.getenv("BUILD_NUMBER") + " (Jenkins)" : getBuildNumber()) entry(key: "buildDate", value: getDate()) entry(key: "buildHead", value: getGitHash()) } @@ -159,4 +159,16 @@ task publishRelease { task publishSnapshot { dependsOn(publishPlexSnapshotsPublicationToMaven2Repository) +} + +task jenkinsPublish { + if (System.getenv("plex_repo_user") == "jenkins") { + if (System.getenv("plex_repo_user") != null && System.getenv("plex_repo_user") == "jenkins") { + if (!getVersion().toString().toLowerCase().endsWith("-snapshot")) { + dependsOn(publishPlexReleasesPublicationToMavenRepository) + } else { + dependsOn(publishPlexSnapshotsPublicationToMaven2Repository) + } + } + } } \ No newline at end of file