-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathJenkinsfile
62 lines (53 loc) · 1.58 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
def GitURL = "https://github.com/DownFall-Team/DownFall.git"
def GitCredentialsId = 'b5f4f865-2a92-418e-8467-7a271a884349'
def SrcPath = "sp/src"
def GameBinFolder = "sp/game/downfall/bin"
def VPCScript = "creategameprojects"
def SolutionName = "games"
stage ('Build Downfall') {
parallel "Linux": {
node ('linux') {
stage('Git') {
git url: GitURL, credentialsId: GitCredentialsId
}
stage('Generate VPC on Linux') {
dir (SrcPath) {
sh "./${VPCScript}"
}
}
stage('Compile on Linux') {
sh "if [ -d ${GameBinFolder} ]; then echo \"Dir already exists...\"; else mkdir -p ${GameBinFolder}; fi"
dir ('sp/src') {
sh "/valve/steam-runtime/shell.sh --arch=i386 make -f ${SolutionName}.mak"
}
}
stage('Get Artifacts on Linux') {
archiveArtifacts(artifacts: "${GameBinFolder}/*.so", onlyIfSuccessful: true)
}
}
},
"Windows": {
node ('windows') {
stage('Git') {
git url: GitURL, credentialsId: GitCredentialsId
}
stage('Generate VPC on Windows') {
dir (SrcPath) {
bat "${VPCScript}.bat"
bat "copy ${SolutionName}.sln+sln_fix.txt ${SolutionName}.sln"
}
}
stage('Compile on Windows') {
bat "if not exist ${GameBinFolder} (mkdir ${GameBinFolder})"
dir ('sp/src') {
bat """call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\Tools\\VsDevCmd.bat"
msbuild ${SolutionName}.sln /t:Build /p:Configuration=Release /m:4"""
}
}
stage('Get Artifacts on Windows')
{
archiveArtifacts(artifacts: "${GameBinFolder}/*.dll", onlyIfSuccessful: true)
}
}
}
}