[BUG] Fix 1.21 jenkins config

This commit is contained in:
2024-06-13 21:11:37 +02:00
parent e2d74998ac
commit df24617dd1
4 changed files with 136 additions and 21 deletions

View File

@@ -26,25 +26,33 @@ pipeline {
} }
stage("Prepare") { stage("Prepare") {
steps { steps {
dir("${WORKSPACE}/${majorMc}") {
sh "chmod +x ./gradlew" sh "chmod +x ./gradlew"
sh "./gradlew clean" sh "./gradlew clean"
} }
} }
}
stage("Publish to Modrinth/Curseforge") { stage("Publish to Modrinth/Curseforge") {
steps { steps {
dir("${WORKSPACE}/${majorMc}") {
sh "./gradlew publishMod -Prelease=true" sh "./gradlew publishMod -Prelease=true"
} }
} }
}
stage("Publish to Maven") { stage("Publish to Maven") {
steps { steps {
dir("${WORKSPACE}/${majorMc}") {
sh "./gradlew publish -Prelease=true" sh "./gradlew publish -Prelease=true"
} }
} }
} }
}
post { post {
always { always {
dir("${WORKSPACE}/${majorMc}") {
sh "./gradlew --stop" sh "./gradlew --stop"
deleteDir() deleteDir()
}
discordSend webhookURL: env.FDD_WH_ADMIN, discordSend webhookURL: env.FDD_WH_ADMIN,
title: "CraterLib Port Deploy #${BUILD_NUMBER}", title: "CraterLib Port Deploy #${BUILD_NUMBER}",

View File

@@ -32,22 +32,27 @@ pipeline {
stage("Prepare") { stage("Prepare") {
steps { steps {
dir("${WORKSPACE}/${majorMc}") {
sh "chmod +x ./gradlew" sh "chmod +x ./gradlew"
sh "./gradlew build -PreleaseType=${reltype}" sh "./gradlew build -PreleaseType=${reltype}"
} }
} }
}
stage("Publish to Maven") { stage("Publish to Maven") {
steps { steps {
dir ("${WORKSPACE}/${majorMc}") {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh "./gradlew publish -PreleaseType=${reltype}" sh "./gradlew publish -PreleaseType=${reltype}"
} }
} }
} }
} }
}
post { post {
always { always {
dir("${WORKSPACE}/${majorMc}") {
sh "./gradlew --stop" sh "./gradlew --stop"
archiveArtifacts artifacts: 'artifacts/*.jar' archiveArtifacts artifacts: 'artifacts/*.jar'
@@ -64,3 +69,4 @@ pipeline {
} }
} }
} }
}

View File

@@ -0,0 +1,42 @@
--- a/.jenkins/Jenkinsfile.deploy
+++ b/.jenkins/Jenkinsfile.deploy
@@ -26,25 +26,33 @@
}
stage("Prepare") {
steps {
- sh "chmod +x ./gradlew"
- sh "./gradlew clean"
+ dir("${WORKSPACE}/${majorMc}") {
+ sh "chmod +x ./gradlew"
+ sh "./gradlew clean"
+ }
}
}
stage("Publish to Modrinth/Curseforge") {
steps {
- sh "./gradlew publishMod -Prelease=true"
+ dir("${WORKSPACE}/${majorMc}") {
+ sh "./gradlew publishMod -Prelease=true"
+ }
}
}
stage("Publish to Maven") {
steps {
- sh "./gradlew publish -Prelease=true"
+ dir("${WORKSPACE}/${majorMc}") {
+ sh "./gradlew publish -Prelease=true"
+ }
}
}
}
post {
always {
- sh "./gradlew --stop"
- deleteDir()
+ dir("${WORKSPACE}/${majorMc}") {
+ sh "./gradlew --stop"
+ deleteDir()
+ }
discordSend webhookURL: env.FDD_WH_ADMIN,
title: "CraterLib Port Deploy #${BUILD_NUMBER}",

View File

@@ -9,3 +9,62 @@
pipeline { pipeline {
agent { agent {
@@ -32,15 +32,19 @@
stage("Prepare") {
steps {
- sh "chmod +x ./gradlew"
- sh "./gradlew build -PreleaseType=${reltype}"
+ dir("${WORKSPACE}/${majorMc}") {
+ sh "chmod +x ./gradlew"
+ sh "./gradlew build -PreleaseType=${reltype}"
+ }
}
}
stage("Publish to Maven") {
steps {
- catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
- sh "./gradlew publish -PreleaseType=${reltype}"
+ dir ("${WORKSPACE}/${majorMc}") {
+ catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
+ sh "./gradlew publish -PreleaseType=${reltype}"
+ }
}
}
}
@@ -48,19 +52,21 @@
post {
always {
- sh "./gradlew --stop"
- archiveArtifacts artifacts: 'artifacts/*.jar'
-
- fddsnapshotter apiKey: env.PLATFORM_KEY,
- projectSlug: "craterlib",
- projectName: "${projectName}",
- projectIcon: "${projectIcon}",
- modLoaders: "${modLoaders}",
- minecraftVersions: "${supportedMc}",
- failWebhook: env.SSS_WEBHOOK,
- publishWebhooks: "${env.SSS_WEBHOOK}|${env.FDD_WH}"
-
- deleteDir()
+ dir("${WORKSPACE}/${majorMc}") {
+ sh "./gradlew --stop"
+ archiveArtifacts artifacts: 'artifacts/*.jar'
+
+ fddsnapshotter apiKey: env.PLATFORM_KEY,
+ projectSlug: "craterlib",
+ projectName: "${projectName}",
+ projectIcon: "${projectIcon}",
+ modLoaders: "${modLoaders}",
+ minecraftVersions: "${supportedMc}",
+ failWebhook: env.SSS_WEBHOOK,
+ publishWebhooks: "${env.SSS_WEBHOOK}|${env.FDD_WH}"
+
+ deleteDir()
+ }
}
}
}