mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-03-03 22:34:42 +01:00
maven prep
This commit is contained in:
parent
e367be9d70
commit
8fdb2326d0
2 changed files with 64 additions and 0 deletions
52
Jenkinsfile
vendored
Normal file
52
Jenkinsfile
vendored
Normal file
|
@ -0,0 +1,52 @@
|
|||
#!/usr/bin/env groovy
|
||||
|
||||
pipeline {
|
||||
|
||||
agent any
|
||||
|
||||
tools {
|
||||
jdk "jdk-17.0.1"
|
||||
}
|
||||
|
||||
stages {
|
||||
|
||||
stage('Setup') {
|
||||
|
||||
steps {
|
||||
|
||||
echo 'Setup Project'
|
||||
sh 'chmod +x gradlew'
|
||||
sh './gradlew clean'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build') {
|
||||
|
||||
steps {
|
||||
|
||||
withCredentials([
|
||||
file(credentialsId: 'build_secrets', variable: 'ORG_GRADLE_PROJECT_secretFile')
|
||||
]) {
|
||||
|
||||
echo 'Building project.'
|
||||
sh './gradlew build publish --stacktrace --warn'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
|
||||
always {
|
||||
|
||||
archiveArtifacts artifacts: '**/build/libs/*.jar', fingerprint: true
|
||||
|
||||
withCredentials([
|
||||
string(credentialsId: 'discord_webhook_url', variable: 'DISCORD_URL')
|
||||
]) {
|
||||
echo 'Notifying Discord..'
|
||||
discordSend description: "Build: #${currentBuild.number}", link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: env.DISCORD_URL, showChangeset: true, enableArtifactsList: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
12
build.gradle
12
build.gradle
|
@ -314,6 +314,18 @@ project.publishing {
|
|||
}
|
||||
|
||||
repositories {
|
||||
if (project.hasProperty("mavenUsername") && project.hasProperty("mavenPassword") && project.hasProperty("mavenURL")) {
|
||||
project.logger.lifecycle("Adding maven from secrets")
|
||||
|
||||
maven {
|
||||
credentials {
|
||||
username = project.property("mavenUsername") as String
|
||||
password = project.property("mavenPassword") as String
|
||||
}
|
||||
url = URI.create(project.property("mavenURL") as String)
|
||||
}
|
||||
}
|
||||
|
||||
if (project.hasProperty('mavendir')) {
|
||||
maven { url mavendir }
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue