-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
36 lines (36 loc) · 1.26 KB
/
Jenkinsfile
File metadata and controls
36 lines (36 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
pipeline {
agent any
options { timestamps() }
stages {
stage('SCM-SKIP') {
steps {
scmSkip(skipPattern:'.*\\[ci skip\\].*')
}
}
stage('Build') {
tools {
jdk "OpenJDK 21"
}
environment {
MAVEN_URL = "https://repo.codemc.io/repository/relativitymc/"
}
steps {
sh 'git fetch --tags'
sh 'git reset --hard'
withCredentials([usernamePassword(credentialsId: 'nexus-repository', passwordVariable: 'MAVEN_CRED_PSW', usernameVariable: 'MAVEN_CRED_USR')]) {
sh './gradlew clean build publish --stacktrace'
}
}
post {
always {
withCredentials([string(credentialsId: 'discord-github-webhook', variable: 'DISCORD_WEBHOOK_URL')]) {
discordSend description: "Jenkins Pipeline Build", link: env.BUILD_URL, result: currentBuild.currentResult, title: "${env.JOB_NAME} #${currentBuild.number}", webhookURL: env.DISCORD_WEBHOOK_URL
}
}
failure {
cleanWs()
}
}
}
}
}