forked from theSimpleCloud/SimpleCloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
58 lines (58 loc) · 1.73 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
pipeline {
agent any
options {
buildDiscarder logRotator(numToKeepStr: '10')
}
stages {
stage('Clean') {
steps {
sh 'chmod +x ./gradlew';
sh './gradlew clean';
}
}
stage('Build') {
steps {
sh './gradlew build';
}
}
stage('Test') {
steps {
sh './gradlew test';
junit '**/build/test-results/test/*.xml';
}
}
stage('Create zip') {
steps {
sh 'rm -f SimpleCloud-Latest.zip';
sh 'mkdir -p temp'
sh 'mkdir temp/modules/'
sh 'mkdir temp/storage/'
sh 'cp start-files/*.* temp/';
sh 'cp simplecloud-modules/**/build/libs/*.jar temp/modules/';
sh 'cp simplecloud-runner/build/libs/runner.jar temp/runner.jar';
sh 'cp simplecloud-base/build/libs/base.jar temp/storage/base.jar';
sh 'rm temp/modules/SimpleCloud-Chat+Tab.jar';
sh 'rm temp/modules/SimpleCloud-ServiceSelection.jar';
sh 'rm temp/modules/SimpleCloud-CloudFlare.jar';
zip archive: true, dir: 'temp', glob: '', zipFile: 'SimpleCloud-Latest.zip';
sh 'rm -r temp/';
}
}
stage('Sources') {
steps {
sh './gradlew sourceJar';
}
}
stage('Publish') {
when {
anyOf {
branch 'master';
branch 'dev/2.0';
}
}
steps {
sh './gradlew publish';
}
}
}
}