This repository has been archived by the owner on Apr 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Jenkinsfile
59 lines (48 loc) · 2.35 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
node {
stage 'Checkout'
// Get some code from a GitHub repository
git branch: env.BRANCH_NAME, url: 'https://github.com/UndeadZeratul/ThereWillBeBlood.git'
stage 'Copy Mod Pack Downloader'
bat "del /s /q \"*.jar\""
step([$class: 'CopyArtifact',
filter: 'target/*.jar',
fingerprintArtifacts: true,
flatten: true,
projectName: 'Mod Pack Downloader',
selector: [$class: 'StatusBuildSelector',
stable: false]])
bat '''del /s /q "common\\base\\loaders\\*.jar"
del /s /q "common\\base\\mods\\*.jar"
del /s /q "client\\base\\mods\\*.jar"
del /s /q "server\\base\\mods\\*.jar"
exit 0'''
stage 'Download Common mods'
bat '''for /f "delims=" %%i IN (\'dir *.jar /b\') DO set modpackdownloader=%%i
java -jar "%modpackdownloader%" -manifest common/base/mods.json -folder common/base/mods'''
stage 'Download Client mods'
bat '''for /f "delims=" %%i IN (\'dir *.jar /b\') DO set modpackdownloader=%%i
java -jar "%modpackdownloader%" -manifest client/dev/mods.json -folder client/dev/mods
for /f "delims=" %%i IN (\'dir *.jar /b\') DO set modpackdownloader=%%i
java -jar "%modpackdownloader%" -manifest client/base/mods.json -folder client/base/mods
for /f "delims=" %%i IN (\'dir *.jar /b\') DO set modpackdownloader=%%i
java -jar "%modpackdownloader%" -manifest client/prod/mods.json -folder client/prod/mods'''
stage 'Download Server mods'
bat '''for /f "delims=" %%i IN (\'dir *.jar /b\') DO set modpackdownloader=%%i
java -jar "%modpackdownloader%" -manifest server/base/mods.json -folder server/base/mods
for /f "delims=" %%i IN (\'dir *.jar /b\') DO set modpackdownloader=%%i
java -jar "%modpackdownloader%" -manifest server/prod/mods.json -folder server/prod/mods'''
// Mark the code build 'stage'....
stage 'Build Pack'
// Get the maven tool.
def mvnHome = tool 'maven'
if(env.BRANCH_NAME.contains("release") || env.BRANCH_NAME.contains("master")){
profileName = "master"
}
else{
profileName = "develop"
}
// Run the maven build
bat "\"${mvnHome}\\bin\\mvn\" clean package -D profile.${profileName} -Dbuild.number=${env.BUILD_NUMBER}"
stage 'Archive'
archive 'target/*.zip,launcher/**/modpack.json,launcher/**/src/mods/*.json'
}