From 2d3f017c011bfdcefcdb33e46b695000fb001542 Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Thu, 7 Apr 2022 01:16:22 -0500 Subject: [PATCH 1/6] This should work --- Jenkinsfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fefe277..ed47dd2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,9 +12,7 @@ pipeline { post { always { archiveArtifacts artifacts: "build/libs/*.jar", fingerprint: true - javadoc javadocDir "build/docs/javadoc" { - javadoc keepAll false - } + javadoc javadocDir: 'build/docs/javadoc', keepAll: false discordSend description: "Jenkins", link: env.BUILD_URL, result: currentBuild.currentResult, title: JOB_NAME, webhookURL: env.PLEX_WEBHOOK_URL deleteWs() } From d4ddf09c32682e45c1648a2a72dc82f1266d7bd4 Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Thu, 7 Apr 2022 01:17:53 -0500 Subject: [PATCH 2/6] OF COURSE --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ed47dd2..7486006 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,7 +14,7 @@ pipeline { archiveArtifacts artifacts: "build/libs/*.jar", fingerprint: true javadoc javadocDir: 'build/docs/javadoc', keepAll: false discordSend description: "Jenkins", link: env.BUILD_URL, result: currentBuild.currentResult, title: JOB_NAME, webhookURL: env.PLEX_WEBHOOK_URL - deleteWs() + cleanWs() } } } \ No newline at end of file From 85eff9a26deecd74d0280ec053ed50727e944ece Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Thu, 7 Apr 2022 01:32:06 -0500 Subject: [PATCH 3/6] I have no idea how to securely set credentials --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7486006..b4a077e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,7 @@ pipeline { stage("build") { steps { withGradle { - sh "./gradlew build javadoc publish --no-daemon" + sh "./gradlew build javadoc --no-daemon" } } } From 804e0af63cb2af3064d6345bcaa087e9e6150dfc Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Thu, 7 Apr 2022 01:55:59 -0500 Subject: [PATCH 4/6] Only publish if its the master branch --- Jenkinsfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index b4a077e..51b20c6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,6 +8,16 @@ pipeline { } } } + stage("publish") { + when { + branch "master" + } + steps { + withGradle { + sh "./gradlew publish --no-daemon" + } + } + } } post { always { From 02393f6be394255b5cea21c7e5b9524f1920ca05 Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Thu, 7 Apr 2022 02:04:36 -0500 Subject: [PATCH 5/6] Change update URL --- src/main/java/dev/plex/util/UpdateChecker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/dev/plex/util/UpdateChecker.java b/src/main/java/dev/plex/util/UpdateChecker.java index bafc58c..65f7246 100644 --- a/src/main/java/dev/plex/util/UpdateChecker.java +++ b/src/main/java/dev/plex/util/UpdateChecker.java @@ -150,7 +150,7 @@ public class UpdateChecker extends PlexBase try { FileUtils.copyURLToFile( - new URL(DOWNLOAD_PAGE + "lastSuccessfulBuild/artifact/build/libs/" + name), + new URL(DOWNLOAD_PAGE + "job/master/lastSuccessfulBuild/artifact/build/libs/" + name), new File(Bukkit.getUpdateFolderFile(), name) ); PlexLog.log("Saved new jar. Please restart your server."); From c9d3b26930d38ba3174488692ca1e605827ba6b3 Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Thu, 7 Apr 2022 02:16:37 -0500 Subject: [PATCH 6/6] Forgot to do it here --- src/main/java/dev/plex/util/UpdateChecker.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/dev/plex/util/UpdateChecker.java b/src/main/java/dev/plex/util/UpdateChecker.java index 65f7246..01da09d 100644 --- a/src/main/java/dev/plex/util/UpdateChecker.java +++ b/src/main/java/dev/plex/util/UpdateChecker.java @@ -137,13 +137,13 @@ public class UpdateChecker extends PlexBase public void updateJar() { CloseableHttpClient client = HttpClients.createDefault(); - HttpGet get = new HttpGet(DOWNLOAD_PAGE + "lastSuccessfulBuild/api/json"); + HttpGet get = new HttpGet(DOWNLOAD_PAGE + "job/master/lastSuccessfulBuild/api/json"); try { HttpResponse response = client.execute(get); JSONObject object = new JSONObject(EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8)); JSONObject artifact = object.getJSONArray("artifacts").getJSONObject(0); - String name = artifact.getString("displayPath"); + String name = artifact.getString("fileName"); PlexLog.log("Downloading latest Plex jar file: " + name); CompletableFuture.runAsync(() -> {