-
Notifications
You must be signed in to change notification settings - Fork 11
/
Jenkinsfile
454 lines (446 loc) · 28.8 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
/*
* Copyright (c) 2021, 2023, Oracle and/or its affiliates.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/
pipeline {
agent { label 'ol8' }
options {
timeout(time: 480, unit: 'MINUTES')
}
environment {
WKTUI_PROXY = "${env.ORACLE_HTTP_PROXY}"
ELECTRON_GET_USE_PROXY = "true"
GLOBAL_AGENT_HTTPS_PROXY = "${WKTUI_PROXY}"
WKTUI_DEV_PROXY = "${WKTUI_PROXY}"
WKTUI_BUILD_EMAIL = sh(returnStdout: true, script: "echo ${env.WKTUI_BUILD_NOTIFY_EMAIL} | sed -e 's/^[[:space:]]*//'")
WKTUI_PROXY_HOST = "${env.ORACLE_HTTP_PROXY_HOST}"
WKTUI_PROXY_PORT = "${env.ORACLE_HTTP_PROXY_PORT}"
npm_registry = "${env.ARTIFACTORY_NPM_REPO}"
npm_noproxy = "${env.ORACLE_NO_PROXY}"
node_version = "18.20.2"
project_name = "$JOB_NAME"
version_prefix = sh(returnStdout: true, script: 'cat electron/package.json | grep version | awk \'match($0, /[0-9]+.[0-9]+.[0-9]+/) { print substr( $0, RSTART, RLENGTH )}\'').trim()
version_number = VersionNumber([versionNumberString: '-${BUILD_YEAR}${BUILD_MONTH,XX}${BUILD_DAY,XX}${BUILDS_TODAY_Z,XX}', versionPrefix: "${version_prefix}"])
git_url = "${env.GIT_URL}"
git_creds = "wktui-orahub-creds"
downstream_job_name = "wktui-sign"
TAG_NAME = sh(returnStdout: true, script: '/usr/bin/git describe --abbrev=0 --tags').trim()
is_release = "true"
sonarscanner_version = '4.7.0.2747'
sonarscanner_zip_file = "sonar-scanner-cli-${sonarscanner_version}.zip"
sonarscanner_download_url = "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/${sonarscanner_zip_file}"
sonar_org = 'oracle'
sonar_project_key = "${sonar_org}_weblogic-toolkit-ui"
}
stages {
stage('Compute file version number') {
when {
not {
tag "v${version_prefix}"
}
}
steps {
script {
version_number = version_number.replaceFirst(version_prefix, version_prefix + '-SNAPSHOT')
is_release = "false"
}
echo "file version number = ${version_number}"
}
}
stage('Parallel Builds') {
failFast true
parallel {
stage('Linux Build') {
agent { label 'ol8' }
options {
timeout(time: 300, unit: 'MINUTES')
}
environment {
linux_node_dir_name = "node-v${node_version}-linux-x64"
linux_node_installer = "${linux_node_dir_name}.tar.gz"
linux_node_url = "https://nodejs.org/dist/v${node_version}/${linux_node_installer}"
linux_node_dir = "${WORKSPACE}/${linux_node_dir_name}"
linux_node_exe = "${linux_node_dir}/bin/node"
linux_npm_modules_dir = "${linux_node_dir}/lib"
linux_npm_exe = "${linux_node_dir}/bin/npm"
sonarscanner_install_dir = "${WORKSPACE}/sonar-scanner-${sonarscanner_version}"
sonarscanner_exe = "${sonarscanner_install_dir}/bin/sonar-scanner"
}
stages {
stage('Linux Echo Environment') {
steps {
sh 'env|sort'
sh 'which rpmbuild'
echo "file version = ${version_number}"
echo "is_release = ${is_release}"
sh 'yum list installed'
}
}
stage('Linux Checkout') {
steps {
checkout([$class: 'GitSCM', branches: [[name: "${GIT_COMMIT}"]],
doGenerateSubmoduleConfigurations: false,
extensions: [], submoduleCfg: [],
userRemoteConfigs: [[credentialsId: "${git_creds}", url: "${git_url}"]]])
sh 'echo ${version_number} > ${WORKSPACE}/WKTUI_VERSION.txt'
}
}
stage('Linux Node.js Installation') {
steps {
sh 'curl -x ${WKTUI_PROXY} ${linux_node_url} --output /tmp/${linux_node_installer}'
sh 'tar xzf /tmp/${linux_node_installer}'
}
}
stage('Linux Node.js Configuration') {
steps {
echo 'Removing any existing .npm cache directory'
sh 'rm -rf ~/.npm ${WORKSPACE}/.npm'
echo 'Removing all existing .npmrc files'
sh 'rm -f ~/.npmrc ${WORKSPACE}/.npmrc ${WORKSPACE}/webui/.npmrc ${WORKSPACE}/electron/.npmrc'
echo 'Creating .npmrc configuration file'
sh 'echo registry=${npm_registry} > ${WORKSPACE}/.npmrc'
sh 'echo noproxy=${npm_noproxy} >> ${WORKSPACE}/.npmrc'
sh 'echo cache=${WORKSPACE}/.npm >> ${WORKSPACE}/.npmrc'
sh 'mkdir ${WORKSPACE}/.npm'
echo 'New .npmrc file contents'
sh 'cat ${WORKSPACE}/.npmrc'
echo 'Copying .npmrc file to project subdirectories'
sh 'cp ${WORKSPACE}/.npmrc ${WORKSPACE}/webui/.npmrc'
sh 'cp ${WORKSPACE}/.npmrc ${WORKSPACE}/electron/.npmrc'
}
}
stage('Linux Install Project Dependencies') {
steps {
sh 'cat ${WORKSPACE}/webui/.npmrc'
sh 'cd ${WORKSPACE}/webui; PATH="${linux_node_dir}/bin:$PATH" ${linux_npm_exe} install; cd ${WORKSPACE}'
sh 'cat ${WORKSPACE}/electron/.npmrc'
sh 'cd ${WORKSPACE}/electron; PATH="${linux_node_dir}/bin:$PATH" HTTPS_PROXY=${ORACLE_HTTP_PROXY} ${linux_npm_exe} install; cd ${WORKSPACE}'
}
}
stage('Linux Install Tools Dependencies') {
steps {
sh 'cd ${WORKSPACE}/electron; PATH="${linux_node_dir}/bin:$PATH" ${linux_npm_exe} run install-tools; cd ${WORKSPACE}'
}
}
stage('Install SonarScanner') {
steps {
sh "curl -x ${WKTUI_PROXY} ${sonarscanner_download_url} --output ${WORKSPACE}/${sonarscanner_zip_file}"
sh "unzip ${WORKSPACE}/${sonarscanner_zip_file}"
sh "rm -f ${WORKSPACE}/${sonarscanner_zip_file}"
}
}
stage('Linux Run Unit Tests with Coverage') {
steps {
sh 'cd ${WORKSPACE}/electron; PATH="${linux_node_dir}/bin:$PATH" ${linux_npm_exe} run coverage; cd ${WORKSPACE}'
sh 'cd ${WORKSPACE}/webui; PATH="${linux_node_dir}/bin:$PATH" ${linux_npm_exe} run coverage; cd ${WORKSPACE}'
}
}
/*
stage('Run Sonar Analysis') {
tools {
jdk "JDK 11.0.9"
}
environment {
sonarscanner_config_file = "${sonarscanner_install_dir}/conf/sonar-scanner.properties"
electron_coverage = "${WORKSPACE}/electron/coverage/lcov.info"
webui_coverage = "${WORKSPACE}/webui/coverage/lcov.info"
electron_sources = "${WORKSPACE}/electron"
webui_sources = "${WORKSPACE}/webui"
wktui_sources = "${electron_sources},${webui_sources}"
lcov_report_paths = "${electron_coverage},${webui_coverage}"
}
steps {
echo "JAVA_HOME = ${JAVA_HOME}"
sh "which java"
sh "java -version"
withSonarQubeEnv('SonarCloud') {
sh """
echo "sonar.host.url=${SONAR_HOST_URL}" >> ${sonarscanner_config_file}
echo "sonar.sourceEncoding=UTF-8" >> ${sonarscanner_config_file}
echo "sonar.organization=${sonar_org}" >> ${sonarscanner_config_file}
echo "sonar.projectKey=${sonar_project_key}" >> ${sonarscanner_config_file}
echo "sonar.projectVersion=${version_prefix}" >> ${sonarscanner_config_file}
echo "sonar.javascript.lcov.reportPaths=${lcov_report_paths}" >> ${sonarscanner_config_file}
echo "sonar.c.file.suffixes=-" >> ${sonarscanner_config_file}
echo "sonar.cpp.file.suffixes=-" >> ${sonarscanner_config_file}
echo "sonar.objc.file.suffixes=-" >> ${sonarscanner_config_file}
echo "sonar.sources=${wktui_sources}" >> ${sonarscanner_config_file}
cat "${sonarscanner_config_file}"
PATH="${linux_node_dir}/bin:${PATH}"; export PATH
SONAR_SCANNER_OPTS="-server -Dhttps.proxyHost=${WKTUI_PROXY_HOST} -Dhttps.proxyPort=${WKTUI_PROXY_PORT} -Dsonar.login=${SONAR_AUTH_TOKEN}"
export SONAR_SCANNER_OPTS
${sonarscanner_exe}
"""
}
}
}
*/
stage('Linux Run eslint') {
// No need to run this on other platforms since the results will be the same...
steps {
sh 'cd ${WORKSPACE}/electron; PATH="${linux_node_dir}/bin:$PATH" ${linux_npm_exe} run eslint; cd ${WORKSPACE}'
sh 'cd ${WORKSPACE}/webui; PATH="${linux_node_dir}/bin:$PATH" ${linux_npm_exe} run eslint; cd ${WORKSPACE}'
}
}
stage('Zip Quickstart Files') {
steps {
sh 'cd ${WORKSPACE}/samples; zip -r ${WORKSPACE}/quickstart.zip quickstart; cd ${WORKSPACE}'
sh 'cd ${WORKSPACE}/samples; tar zcf ${WORKSPACE}/quickstart.tar.gz quickstart; cd ${WORKSPACE}'
archiveArtifacts "quickstart.*"
}
}
stage('Linux Build Installers') {
steps {
sh 'cd ${WORKSPACE}/electron; PATH="${linux_node_dir}/bin:$PATH" ${linux_npm_exe} run build; cd ${WORKSPACE}'
archiveArtifacts "dist/wktui*.*"
archiveArtifacts "dist/*.AppImage"
archiveArtifacts "dist/latest-linux.yml"
}
}
}
}
stage('MacOS Build') {
agent { label('macosx&&!wls-hudson-mac') }
options {
timeout(time: 300, unit: 'MINUTES')
}
environment {
mac_node_dir_name = "node-v${node_version}-darwin-x64"
mac_node_installer = "node-v${node_version}-darwin-x64.tar.gz"
mac_node_url = "https://nodejs.org/dist/v${node_version}/${mac_node_installer}"
mac_node_dir = "${WORKSPACE}/${mac_node_dir_name}"
mac_node_exe = "${mac_node_dir}/bin/node"
mac_npm_modules_dir = "${mac_node_dir}/lib"
mac_npm_exe = "${mac_node_dir}/bin/npm"
}
stages {
stage('MacOS Echo Environment') {
steps {
sh 'env|sort'
echo "file version = ${version_number}"
echo "is_release = ${is_release}"
sh "uname -a"
}
}
stage('MacOS Checkout') {
steps {
checkout([$class: 'GitSCM', branches: [[name: "${GIT_COMMIT}"]],
doGenerateSubmoduleConfigurations: false,
extensions: [], submoduleCfg: [],
userRemoteConfigs: [[credentialsId: "${git_creds}", url: "${git_url}"]]])
sh 'echo ${version_number} > ${WORKSPACE}/WKTUI_VERSION.txt'
}
}
stage('MacOS Node.js Installation') {
steps {
sh 'curl -x ${WKTUI_PROXY} ${mac_node_url} --output /tmp/${mac_node_installer}'
sh 'tar zxf /tmp/${mac_node_installer}'
}
}
stage('MacOS Node.js Configuration') {
steps {
echo 'Removing any existing .npm cache directory'
sh 'rm -rf ~/.npm ${WORKSPACE}/.npm'
echo 'Removing all existing .npmrc files'
sh 'rm -f ~/.npmrc ${WORKSPACE}/.npmrc ${WORKSPACE}/webui/.npmrc ${WORKSPACE}/electron/.npmrc'
echo 'Creating .npmrc configuration file'
sh 'echo registry=${npm_registry} > ${WORKSPACE}/.npmrc'
sh 'echo noproxy=${npm_noproxy} >> ${WORKSPACE}/.npmrc'
sh 'echo cache=${WORKSPACE}/.npm >> ${WORKSPACE}/.npmrc'
sh 'mkdir ${WORKSPACE}/.npm'
echo 'New .npmrc file contents'
sh 'cat ${WORKSPACE}/.npmrc'
echo 'Copying .npmrc file to project subdirectories'
sh 'cp ${WORKSPACE}/.npmrc ${WORKSPACE}/webui/.npmrc'
sh 'cp ${WORKSPACE}/.npmrc ${WORKSPACE}/electron/.npmrc'
}
}
stage('MacOS Install Project Dependencies') {
steps {
sh 'cat ${WORKSPACE}/webui/.npmrc'
sh 'cd ${WORKSPACE}/webui; PATH="${mac_node_dir}/bin:$PATH" ${mac_npm_exe} install; cd ${WORKSPACE}'
sh 'cat ${WORKSPACE}/electron/.npmrc'
sh 'cd ${WORKSPACE}/electron; PATH="${mac_node_dir}/bin:$PATH" HTTPS_PROXY=${ORACLE_HTTP_PROXY} ${mac_npm_exe} install; cd ${WORKSPACE}'
}
}
stage('MacOS Install Tools Dependencies') {
steps {
sh 'cd ${WORKSPACE}/electron; PATH="${mac_node_dir}/bin:$PATH" ${mac_npm_exe} run install-tools; cd ${WORKSPACE}'
}
}
stage('MacOS Run Unit Tests') {
steps {
// On MacOS, the keychain needs to be unlocked when the tests are run...
// We have disabled the tests on the Jenkins MacOS environment so no need
// to do any of this keychain manipulation...
//
// sh 'security list-keychains'
// sh 'security create-keychain -p "" temporary'
// sh 'security default-keychain -s temporary'
// sh 'security unlock-keychain -p "" temporary'
// sh 'security set-keychain-settings -lut 7200 temporary'
sh 'cd ${WORKSPACE}/electron; PATH="${mac_node_dir}/bin:$PATH" ${mac_npm_exe} test; cd ${WORKSPACE}'
sh 'cd ${WORKSPACE}/webui; PATH="${mac_node_dir}/bin:$PATH" ${mac_npm_exe} test; cd ${WORKSPACE}'
}
// post {
// always {
// sh 'security delete-keychain temporary'
// }
// }
}
stage('MacOS Build Installers') {
// WDT 4.0 introduced a dependency on JLine, which depends on the jansi JAR file that
// includes native code. The Apple notarization process chokes on this jar because its
// contains an unsigned native code library. Since JLine is only used by modelHelp and
// modelHelp currently isn't used by WKTUI, we are going to delete the jansi.jar file from
// the WKTUI build to allow the Apple notarization process to succeed.
//
// Even if we sign the code properly for the release, any updates of WDT from within WKTUI
// will download new versions directly from GitHub that are not signed, which would prevent
// JLine from working from within WKTUI. If we ever need to make this work correctly within
// WKTUI, we should have the WDT build/release process sign the native code in the jansi JAR
// the WDT installer includes so that WKTUI would never have an unsigned version of the JAR.
//
steps {
sh '''
cd "${WORKSPACE}/electron"
PATH="${mac_node_dir}/bin:$PATH" HTTPS_PROXY=${WKTUI_PROXY} CSC_IDENTITY_AUTO_DISCOVERY=false ${mac_npm_exe} run build:jet
PATH="${mac_node_dir}/bin:$PATH" HTTPS_PROXY=${WKTUI_PROXY} CSC_IDENTITY_AUTO_DISCOVERY=false ${mac_npm_exe} run install-tools
rm "${WORKSPACE}/tools/weblogic-deploy/lib/jansi-2.4.1.jar"
PATH="${mac_node_dir}/bin:$PATH" HTTPS_PROXY=${WKTUI_PROXY} CSC_IDENTITY_AUTO_DISCOVERY=false ${mac_npm_exe} run build:installer -- --mac --x64 --arm64
cd "${WORKSPACE}"
'''
archiveArtifacts 'dist/*.dmg'
archiveArtifacts 'dist/*.zip'
archiveArtifacts "dist/*.blockmap"
archiveArtifacts "dist/latest-mac.yml"
sh 'ditto -c -k --sequesterRsrc --keepParent "$WORKSPACE/dist/mac/WebLogic Kubernetes Toolkit UI.app" "WebLogic Kubernetes Toolkit UI.app.zip"'
archiveArtifacts "WebLogic Kubernetes Toolkit UI.app.zip"
sh 'ditto -c -k --sequesterRsrc --keepParent "$WORKSPACE/dist/mac-arm64/WebLogic Kubernetes Toolkit UI.app" "WebLogic Kubernetes Toolkit UI.arm64.app.zip"'
archiveArtifacts "WebLogic Kubernetes Toolkit UI.arm64.app.zip"
}
}
}
}
stage('Windows Build') {
agent { label 'windows'}
options {
timeout(time: 300, unit: 'MINUTES')
}
environment {
windows_node_dir_name = "node-v${node_version}-win-x64"
windows_node_installer = "node-v${node_version}-win-x64.zip"
windows_node_url = "https://nodejs.org/dist/v${node_version}/${windows_node_installer}"
windows_node_dir = "${WORKSPACE}\\${windows_node_dir_name}"
windows_node_exe = "${windows_node_dir}\\node"
windows_npm_modules_dir = "${windows_node_dir}"
windows_npm_exe = "${windows_node_dir}\\npm"
windows_git_path = "C:\\jenkins\\tools\\git\\PortableGit\\bin"
}
stages {
stage('Windows Echo Environment') {
steps {
bat 'set'
echo "file version = ${version_number}"
echo "is_release = ${is_release}"
}
}
stage('Windows Checkout') {
steps {
checkout([$class: 'GitSCM', branches: [[name: "${GIT_COMMIT}"]],
doGenerateSubmoduleConfigurations: false,
extensions: [], submoduleCfg: [],
userRemoteConfigs: [[credentialsId: "${git_creds}", url: "${git_url}"]]])
bat 'echo %version_number% > "%WORKSPACE%/WKTUI_VERSION.txt"'
}
}
stage('Windows Node.js Installation') {
steps {
powershell '''
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12;
$ProgressPreference = "SilentlyContinue";
Invoke-WebRequest -Proxy "$env:WKTUI_PROXY" -Uri "$env:windows_node_url" -OutFile "$env:TEMP\\$env:windows_node_installer";
$ProgressPreference = "Continue"
'''
bat 'unzip -q "%TEMP%\\%windows_node_installer%"'
}
}
stage('Windows Node.js Configuration') {
steps {
echo 'Removing any existing npm-cache directory'
powershell 'Remove-Item "$env:APPDATA\\npm-cache" -Force -Recurse -ErrorAction SilentlyContinue'
powershell 'Remove-Item "$env:WORKSPACE\\npm-cache" -Force -Recurse -ErrorAction SilentlyContinue'
echo 'Removing all existing .npmrc files'
powershell 'Remove-Item -Force "$env:USERPROFILE\\.npmrc", "$env:WORKSPACE\\.npmrc", "$env:WORKSPACE\\webui\\.npmrc", "$env:WORKSPACE\\electron\\.npmrc" -ErrorAction SilentlyContinue'
echo 'Creating .npmrc configuration file'
bat 'echo registry=%npm_registry% > "%WORKSPACE%\\.npmrc"'
bat 'echo noproxy=%npm_noproxy% >> "%WORKSPACE%\\.npmrc"'
bat 'echo cache=%WORKSPACE%\\npm-cache >> "%WORKSPACE%\\.npmrc"'
bat 'mkdir "%WORKSPACE%\\npm-cache"'
echo 'New .npmrc file contents'
bat 'type "%WORKSPACE%\\.npmrc"'
echo 'Copying .npmrc file to project subdirectories'
bat 'copy /Y "%WORKSPACE%\\.npmrc" "%WORKSPACE%\\webui\\.npmrc"'
bat 'copy /Y "%WORKSPACE%\\.npmrc" "%WORKSPACE%\\electron\\.npmrc"'
}
}
stage('Windows Install Project Dependencies') {
steps {
bat 'cd "%WORKSPACE%\\electron" & set "PATH=%windows_node_dir%;%PATH%" & set HTTPS_PROXY=%ORACLE_HTTP_PROXY% & "%windows_npm_exe%" install & cd "%WORKSPACE%"'
bat 'cd "%WORKSPACE%\\webui" & set "PATH=%windows_node_dir%;%PATH%" & "%windows_npm_exe%" install & cd "%WORKSPACE%"'
}
}
stage('Windows Install Tools Dependencies') {
steps {
bat 'cd "%WORKSPACE%\\electron" & set "PATH=%windows_node_dir%;%PATH%" & "%windows_npm_exe%" run install-tools & cd "%WORKSPACE%"'
}
}
stage('Windows Run Unit Tests') {
steps {
bat 'cd "%WORKSPACE%\\electron" & set "PATH=%windows_node_dir%;%PATH%" & "%windows_npm_exe%" test & cd "%WORKSPACE%"'
bat 'cd "%WORKSPACE%\\webui" & set "PATH=%windows_node_dir%;%PATH%" & "%windows_npm_exe%" test & cd "%WORKSPACE%"'
}
}
stage('Windows Build Installers') {
steps {
bat 'cd "%WORKSPACE%\\electron" & set "PATH=%windows_node_dir%;%PATH%" & set "HTTPS_PROXY=%WKTUI_PROXY%" & "%windows_npm_exe%" run build & cd "%WORKSPACE%"'
// bat 'cd "%WORKSPACE%\\webui" & set "PATH=%windows_node_dir%;%PATH%" & set "HTTPS_PROXY=%WKTUI_PROXY%" & "node_modules\\.bin\\ojet" build web --release & cd "%WORKSPACE%"'
// bat 'cd "%WORKSPACE%\\electron" & set "PATH=%windows_node_dir%;%PATH%" & set "HTTPS_PROXY=%WKTUI_PROXY%" & "%windows_node_exe%" scripts/installTools.js & cd "%WORKSPACE%"'
// bat 'cd "%WORKSPACE%\\electron" & set "PATH=%windows_node_dir%;%PATH%" & set "HTTPS_PROXY=%WKTUI_PROXY%" & "node_modules\\.bin\\electron-builder" -p never & cd "%WORKSPACE%"'
archiveArtifacts 'dist/*.exe'
archiveArtifacts "dist/*.blockmap"
archiveArtifacts "dist/latest.yml"
}
}
}
}
}
}
stage('Call sync job') {
steps {
build job: 'wkt-sync'
}
}
stage('Call Downstream Job') {
steps {
build job: "${downstream_job_name}", propagate: false, parameters: [
string(name: "wktui_git_commit", value: "${GIT_COMMIT}"),
string(name: "parent_job_name", value: "${JOB_NAME}"),
string(name: "parent_release_version", value: "${version_prefix}"),
string(name: "parent_build_version", value: "${version_number}"),
string(name: "parent_job_number", value: "${BUILD_NUMBER}"),
string(name: "is_release", value: "${is_release}"),
string(name: "node_version", value: "${node_version}")
]
}
}
}
post {
failure {
echo "mail to address is ${WKTUI_BUILD_EMAIL}"
mail to: "${WKTUI_BUILD_EMAIL}", from: '[email protected]',
subject: "WKTUI: ${env.JOB_NAME} - Failed",
body: "Job Failed - \"${env.JOB_NAME}\" build: ${env.BUILD_NUMBER}\n\nView the log at:\n ${env.BUILD_URL}\n"
}
}
}