-
Notifications
You must be signed in to change notification settings - Fork 36
/
Jenkinsfile
98 lines (86 loc) · 3.82 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
96
97
98
pipeline {
agent {
label 'WinAgent'
}
stages {
stage('Nuget restore') {
steps {
bat "nuget restore CapFrameX.sln"
}
}
stage('Build') {
stages {
stage('Build Installer') {
stages {
stage('Build CX') {
steps {
bat "msbuild source\\CapFrameX\\CapFrameX.csproj /p:Configuration=Release /p:Platform=x64 /p:DeployOnBuild=true /p:VisualStudioVersion=17.0"
}
}
stage('Build HWInfo') {
steps {
bat "msbuild source\\CapFrameX.Hwinfo\\CapFrameX.Hwinfo.vcxproj /p:SolutionDir=${pwd()}\\ /p:Configuration=Release /p:Platform=x64 /p:DeployOnBuild=true /p:VisualStudioVersion=17.0"
}
}
stage('Build IGCL') {
steps {
bat "msbuild source\\CapFrameX.IGCL\\CapFrameX.IGCL.vcxproj /p:SolutionDir=${pwd()}\\ /p:Configuration=Release /p:Platform=x64 /p:DeployOnBuild=true /p:VisualStudioVersion=17.0"
}
}
stage('Build ADLX') {
steps {
bat "msbuild source\\CapFrameX.ADLX\\CapFrameX.ADLX.vcxproj /p:SolutionDir=${pwd()}\\ /p:Configuration=Release /p:Platform=x64 /p:DeployOnBuild=true /p:VisualStudioVersion=17.0"
}
}
stage('Build FrameView') {
steps {
bat "msbuild source\\CapFrameX.FrameView\\CapFrameX.FrameView.vcxproj /p:SolutionDir=${pwd()}\\ /p:Configuration=Release /p:Platform=x64 /p:DeployOnBuild=true /p:VisualStudioVersion=17.0"
}
}
stage('Build Installer') {
steps {
bat "msbuild source\\CapFrameXInstaller\\CapFrameXInstaller.wixproj /p:SolutionDir=${pwd()}\\ /p:Configuration=Release /p:Platform=x64 /p:DeployOnBuild=true /p:VisualStudioVersion=17.0"
}
}
stage('Build Bootstrapper') {
steps {
bat "msbuild source\\CapFrameXBootstrapper\\CapFrameXBootstrapper.wixproj /p:SolutionDir=${pwd()}\\ /p:Configuration=Release /p:Platform=x64 /p:DeployOnBuild=true /p:VisualStudioVersion=17.0"
}
}
}
}
}
}
stage('Publish') {
environment {
filename = getFilename()
uploadPath = getUploadPath()
branch = getBranch()
}
stages {
stage('Create Archive') {
steps {
zip archive: false, dir: 'source/CapFrameXBootstrapper/bin/x64/Release', glob: 'CapFrameXBootstrapper.exe', zipFile: "${filename}_installer.zip"
zip archive: false, dir: 'source/CapFrameX/bin/x64/Release', glob: '**/*', zipFile: "${filename}_portable.zip"
}
}
stage('Upload Archives') {
steps {
azureUpload blobProperties: [cacheControl: '', contentEncoding: '', contentLanguage: '', contentType: '', detectContentType: true], containerName: 'builds', fileShareName: '', filesPath: '*.zip', storageCredentialId: 'cxblobs-azure-storage', storageType: 'blobstorage', virtualPath: "${branch}/${BUILD_NUMBER}/"
}
}
}
}
}
}
def getBranch() {
return "${env.GIT_BRANCH}";
}
def getFilename() {
return "${env.TAG_NAME}".startsWith('v') ? "${env.TAG_NAME}" : "${env.GIT_COMMIT}"
}
def getUploadPath() {
def branch = "${env.GIT_BRANCH}".replace("/", "__")
def date = "${(new Date()).format( 'dd.MM.yyyy' )}"
return "${env.TAG_NAME}".startsWith('v') ? "${env.CAPFRAMEX_REPO}/${env.TAG_NAME}" : "${env.CAPFRAMEX_REPO}/${branch}/${date}"
}