This repository has been archived by the owner on Jun 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Jenkinsfile
66 lines (66 loc) · 1.89 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
65
66
pipeline {
agent any
tools {
maven 'Maven3'
jdk 'Java8'
}
options {
buildDiscarder logRotator(numToKeepStr: '10')
}
stages {
stage('Clean') {
steps {
sh 'mvn clean'
}
}
stage('Version') {
steps {
sh 'mvn versions:set -DnewVersion=2.1.17'
}
}
stage('Compile') {
steps {
sh 'mvn compile'
}
}
stage('Test') {
steps {
sh 'mvn test'
junit testResults: '**/target/surefire-reports/*.xml', allowEmptyResults: true
}
}
stage('Package') {
steps {
sh 'mvn package'
}
}
stage('Re-package') {
steps {
sh 'mvn package javadoc:aggregate-jar'
}
}
stage('Release ZIP') {
steps {
sh '''mkdir -p temp;
cp -r .template/* temp/;
cp cloudnet-core/target/CloudNet-Master.jar temp/CloudNet-Master/;
cp cloudnet-wrapper/target/CloudNet-Wrapper.jar temp/CloudNet-Wrapper/;
find cloudnet-tools/ -type f -name "cloudnet-tools-*.jar" -and -not -name "*-sources.jar" -and -not -name "*-javadoc.jar" -exec cp "{}" temp/tools/ ';' '''
zip archive: true, dir: 'temp', glob: '', zipFile: 'CloudNet.zip'
sh 'rm -r temp/';
}
}
stage('Archive') {
steps {
archiveArtifacts allowEmptyArchive: true, artifacts: '**/target/CloudNet-Wrapper.jar,**/target/CloudNet-Master.jar,**/target/CloudNetAPI.jar,target/cloudnet-*-javadoc.jar,cloudnet-tools/**/target/cloudnet-tools-*.jar', fingerprint: true, onlyIfSuccessful: true
}
}
}
post {
always {
withCredentials([string(credentialsId: 'cloudnet-discord-ci-webhook', variable: 'url')]) {
discordSend description: 'New build for CloudNet!', footer: 'New build!', link: env.BUILD_URL, successful: currentBuild.resultIsBetterOrEqualTo('SUCCESS'), title: JOB_NAME, webhookURL: url
}
}
}
}