forked from rstudio/rstudio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.windows
94 lines (91 loc) · 4.13 KB
/
Jenkinsfile.windows
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
pipeline {
agent { label 'windows-v1.4' }
options {
timestamps()
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '100'))
}
parameters {
string(name: 'RSTUDIO_VERSION_MAJOR', defaultValue: '1', description: 'RStudio Major Version')
string(name: 'RSTUDIO_VERSION_MINOR', defaultValue: '1', description: 'RStudio Minor Version')
string(name: 'RSTUDIO_VERSION_PATCH', defaultValue: '0', description: 'RStudio Patch Version')
string(name: 'RSTUDIO_VERSION_SUFFIX', defaultValue: '0', description: 'RStudio Pro Suffix Version')
string(name: 'SLACK_CHANNEL', defaultValue: '#rstudio', description: 'Slack channel to publish build message.')
}
stages {
stage('dependencies') {
steps {
withCredentials([usernameColonPassword(credentialsId: 'github-rstudio-jenkins', variable: "GITHUB_LOGIN")]) {
bat 'cd dependencies/windows && set RSTUDIO_GITHUB_LOGIN=$GITHUB_LOGIN && set RSTUDIO_SKIP_QT=1 && install-dependencies.cmd && cd ../..'
}
}
}
stage('build'){
steps {
script {
bat 'cd package/win32 && set "PACKAGE_OS=Windows" && make-package.bat clean && cd ../..'
}
}
}
stage('tests'){
steps {
script {
try {
bat 'cd package/win32/build/src/cpp && rstudio-tests.bat --scope core'
}
catch(err){
currentBuild.result = "UNSTABLE"
}
}
}
}
stage('sign') {
steps {
script {
withCredentials([file(credentialsId: 'ide-windows-signing-pfx', variable: 'pfx-file'), string(credentialsId: 'ide-pfx-passphrase', variable: 'pfx-passphrase')]) {
bat '"C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.17134.0\\x86\\signtool" sign /f %pfx-file% /p %pfx-passphrase% /v /ac package\\win32\\cert\\After_10-10-10_MSCV-VSClass3.cer /n "RStudio, Inc." /t http://timestamp.VeriSign.com/scripts/timstamp.dll package\\win32\\build\\RStudio-%RSTUDIO_VERSION_MAJOR%.%RSTUDIO_VERSION_MINOR%.%RSTUDIO_VERSION_PATCH%-RelWithDebInfo.exe'
bat '"C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.17134.0\\x86\\signtool" verify /v /kp package\\win32\\build\\RStudio-%RSTUDIO_VERSION_MAJOR%.%RSTUDIO_VERSION_MINOR%.%RSTUDIO_VERSION_PATCH%-RelWithDebInfo.exe'
}
}
}
}
stage('upload debug symbols') {
steps {
script {
// convert the PDB symbols to breakpad format (PDB not supported by Sentry)
bat '''
cd package\\win32\\build
FOR /F %%G IN ('dir /s /b *.pdb') DO (..\\..\\..\\dependencies\\windows\\breakpad-tools-windows\\dump_syms %%G > %%G.sym)
'''
// upload the breakpad symbols
withCredentials([string(credentialsId: 'ide-sentry-api-key', variable: 'SENTRY_API_KEY')]){
bat "cd package\\win32\\build\\src\\cpp && ..\\..\\..\\..\\..\\dependencies\\windows\\sentry-cli.exe --auth-token %SENTRY_API_KEY% upload-dif --org rstudio --project ide-backend -t breakpad ."
}
}
}
}
stage('upload') {
steps {
script {
// windows docker container cannot reach instance-metadata endpoint. supply credentials at upload.
withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', credentialsId: 'jenkins-aws']]) {
bat 'aws s3 cp package\\win32\\build\\RStudio-%RSTUDIO_VERSION_MAJOR%.%RSTUDIO_VERSION_MINOR%.%RSTUDIO_VERSION_PATCH%-RelWithDebInfo.exe s3://rstudio-ide-build/desktop/windows/RStudio-%RSTUDIO_VERSION_MAJOR%.%RSTUDIO_VERSION_MINOR%.%RSTUDIO_VERSION_PATCH%.exe'
bat 'aws s3 cp package\\win32\\build\\RStudio-%RSTUDIO_VERSION_MAJOR%.%RSTUDIO_VERSION_MINOR%.%RSTUDIO_VERSION_PATCH%-RelWithDebInfo.zip s3://rstudio-ide-build/desktop/windows/RStudio-%RSTUDIO_VERSION_MAJOR%.%RSTUDIO_VERSION_MINOR%.%RSTUDIO_VERSION_PATCH%.zip'
}
}
}
}
}
post {
always {
script {
try {
deleteDir()
} catch(err) {
print "Unable to clean up build directory: ${err.toString()}"
}
sendNotifications slack_channel: SLACK_CHANNEL
}
}
}
}