forked from Paul19988/Advanced-Slime-World-Manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
64 lines (58 loc) · 2.08 KB
/
Jenkinsfile
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
pipeline {
agent any
tools {
maven '3.6.3'
jdk '8u262'
}
stages {
stage ('Initialize') {
steps {
sh '''
wget https://cdn.getbukkit.org/spigot/spigot-1.16.1.jar && mvn install:install-file -Dfile=spigot-1.16.1.jar -DgroupId=org.spigotmc -DartifactId=spigot -Dversion=1.16.1-R0.1-SNAPSHOT -Dpackaging=jar
echo "PATH = ${PATH}"
echo "M2_HOME = ${M2_HOME}"
'''
}
}
stage ('Build') {
steps {
dir('.'){
sh 'mvn -Dmaven.test.failure.ignore=true install'
}
}
}
stage('Release') {
steps {
dir('.'){
echo 'Creating artifacts...';
sh "mkdir -p output"
sh "mv slimeworldmanager-api/target/slimeworldmanager*.jar output/"
sh "mv slimeworldmanager-classmodifier/target/slimeworldmanager*.jar output/"
sh "mv slimeworldmanager-plugin/target/slimeworldmanager*.jar output/"
sh "mv slimeworldmanager-importer/target/slimeworldmanager*.jar output/"
archiveArtifacts artifacts: 'output/*'
}
}
}
stage('Maven Publish') {
when {
anyOf {
branch 'master';
branch 'develop';
}
}
steps {
echo 'Publishing artifacts to Nexus...';
sh 'mvn deploy';
}
}
}
post {
always {
cleanWs();
withCredentials([string(credentialsId: 'cloudnet-discord-ci-webhook', variable: 'url')]) {
discordSend description: 'New build for Advanced Slime World manager!', footer: 'New build!', link: env.BUILD_URL, successful: currentBuild.resultIsBetterOrEqualTo('SUCCESS'), title: JOB_NAME, webhookURL: url
}
}
}
}