-
Notifications
You must be signed in to change notification settings - Fork 198
/
Jenkinsfile
95 lines (91 loc) · 2.45 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
pipeline {
agent none
stages {
stage('Build') {
parallel {
stage('Build macOS') {
agent {
node {
label 'macos'
}
}
steps {
sh '''
# Setup environment
export PATH="/usr/local/bin:$PATH"
# Build Release
mkdir -p build
cd build
cmake ../packager -G "Ninja"
ninja
cd ..
'''
}
post {
success {
deploy();
}
}
}
stage('Build Windows x64') {
agent {
node {
label 'win_x64'
}
}
steps {
bat '''
rem Setup environment
call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat" amd64
set CC=cl.exe
set CXX=cl.exe
rem Build Release
if not exist build mkdir build
cd build
cmake ../packager -G "Ninja"
ninja
'''
}
post {
success {
deploy();
}
}
}
stage('Build Linux') {
agent {
node {
label 'linux'
}
}
steps {
sh '''
# Build Release
mkdir -p build
cd build
cmake ../packager -G "Ninja"
ninja
cd ..
'''
}
post {
success {
deploy();
}
}
}
}
}
}
}
def deploy() {
withAWS(endpointUrl:'https://sfo2.digitaloceanspaces.com', credentials:'jenkins-access') {
if (env.BRANCH_NAME == 'master') {
s3Upload(bucket: 'ultralight-sdk', workingDir:'build', includePathPattern:'*.7z', acl:'PublicRead');
s3Upload(bucket: 'ultralight-sdk', workingDir:'build/latest', includePathPattern:'*.7z', acl:'PublicRead', cacheControl:'public,max-age=60');
} else if (env.BRANCH_NAME == 'dev') {
s3Upload(bucket: 'ultralight-sdk-dev', workingDir:'build', includePathPattern:'*.7z', acl:'PublicRead');
s3Upload(bucket: 'ultralight-sdk-dev', workingDir:'build/latest', includePathPattern:'*.7z', acl:'PublicRead', cacheControl:'public,max-age=60');
}
}
}