From e2970e0057cb685ebda5279c12f1a9ccd948d450 Mon Sep 17 00:00:00 2001 From: rtm516 Date: Sun, 15 Nov 2020 14:29:19 +0000 Subject: [PATCH] Update repo urls and jenkinsfile (#78) Switched to the Open Collaboration repo --- Jenkinsfile | 33 ++++++++++++++++++++++++++++++++- common/pom.xml | 8 ++++---- pom.xml | 8 ++++---- 3 files changed, 40 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c82840b9..a4c09f30 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -34,9 +34,40 @@ pipeline { post { always { + script { + def changeLogSets = currentBuild.changeSets + def message = "**Changes:**" + + if (changeLogSets.size() == 0) { + message += "\n*No changes.*" + } else { + def repositoryUrl = scm.userRemoteConfigs[0].url.replace(".git", "") + def count = 0; + def extra = 0; + for (int i = 0; i < changeLogSets.size(); i++) { + def entries = changeLogSets[i].items + for (int j = 0; j < entries.length; j++) { + if (count <= 10) { + def entry = entries[j] + def commitId = entry.commitId.substring(0, 6) + message += "\n - [`${commitId}`](${repositoryUrl}/commit/${entry.commitId}) ${entry.msg}" + count++ + } else { + extra++; + } + } + } + + if (extra != 0) { + message += "\n - ${extra} more commits" + } + } + + env.changes = message + } deleteDir() withCredentials([string(credentialsId: 'geyser-discord-webhook', variable: 'DISCORD_WEBHOOK')]) { - discordSend description: "**Build:** [${currentBuild.id}](${env.BUILD_URL})\n**Status:** [${currentBuild.currentResult}](${env.BUILD_URL})\n\n[**Artifacts on Jenkins**](https://ci.nukkitx.com/job/GeyserMC/job/Floodgate)", footer: 'NukkitX Jenkins', link: env.BUILD_URL, successful: currentBuild.resultIsBetterOrEqualTo('SUCCESS'), title: "${env.JOB_NAME} #${currentBuild.id}", webhookURL: DISCORD_WEBHOOK + discordSend description: "**Build:** [${currentBuild.id}](${env.BUILD_URL})\n**Status:** [${currentBuild.currentResult}](${env.BUILD_URL})\n${changes}\n\n[**Artifacts on Jenkins**](https://ci.nukkitx.com/job/GeyserMC/job/Floodgate)", footer: 'Cloudburst Jenkins', link: env.BUILD_URL, successful: currentBuild.resultIsBetterOrEqualTo('SUCCESS'), title: "${env.JOB_NAME} #${currentBuild.id}", webhookURL: DISCORD_WEBHOOK } } } diff --git a/common/pom.xml b/common/pom.xml index a1dcbbad..9018e26b 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -13,8 +13,8 @@ - nukkitx-release-repo - https://repo.nukkitx.com/maven-releases/ + opencollab-release-repo + https://repo.opencollab.dev/maven-releases/ true @@ -23,8 +23,8 @@ - nukkitx-snapshot-repo - https://repo.nukkitx.com/maven-snapshots/ + opencollab-snapshot-repo + https://repo.opencollab.dev/maven-snapshots/ false diff --git a/pom.xml b/pom.xml index 5671356d..06964f0b 100644 --- a/pom.xml +++ b/pom.xml @@ -45,13 +45,13 @@ releases - nukkitx-releases - https://repo.nukkitx.com/maven-releases + opencollab-releases + https://repo.opencollab.dev/maven-releases snapshots - nukkitx-snapshots - https://repo.nukkitx.com/maven-snapshots + opencollab-snapshots + https://repo.opencollab.dev/maven-snapshots