From 1eaf12f1722094556db16be34800083516c0dc2d Mon Sep 17 00:00:00 2001 From: Pawel Rzepecki Date: Thu, 23 Jul 2026 08:31:42 +0200 Subject: [PATCH 1/9] remove commit from package name - validation requirement --- ci/build_test_release.groovy | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ci/build_test_release.groovy b/ci/build_test_release.groovy index e9657419c6..2e63584c21 100644 --- a/ci/build_test_release.groovy +++ b/ci/build_test_release.groovy @@ -14,7 +14,6 @@ pipeline { steps { script { def buildstamp = new Date().format('yyyyMMddHHmmss') - def shortCommit = bat(script: "git rev-parse --short=8 HEAD", returnStdout: true).trim().readLines().last() echo "Buildstamp: ${buildstamp}" echo "PRODUCT_VERSION: ${env.PRODUCT_VERSION}" echo "RELEASE_TAG: ${env.RELEASE_TAG}" @@ -38,7 +37,7 @@ pipeline { } else { python_suffix = "off" } - def packageName = "ovms_windows_${env.PRODUCT_VERSION}_${env.RELEASE_TAG}_${shortCommit}_python_${python_suffix}.zip" + def packageName = "ovms_windows_${env.PRODUCT_VERSION}_${env.RELEASE_TAG}_python_${python_suffix}.zip" def status = bat(returnStatus:true, script: "net use w: /delete /y 2>nul & net use w: \\\\10.102.76.118\\data\\cv_bench_cache\\OVMS_do_not_remove\\ovms_artefacts\\") if (status != 0) { error "Failed to map network drive. Status code: ${status}" From e7883b918d1cd17ff195e924593ff5bf73cb4ca3 Mon Sep 17 00:00:00 2001 From: Pawel Rzepecki Date: Thu, 23 Jul 2026 08:49:03 +0200 Subject: [PATCH 2/9] adding step to push to share signed artifacts --- ci/build_test_release.groovy | 85 +++++++++++++++++++++--------------- 1 file changed, 50 insertions(+), 35 deletions(-) diff --git a/ci/build_test_release.groovy b/ci/build_test_release.groovy index 2e63584c21..142b1b7fa7 100644 --- a/ci/build_test_release.groovy +++ b/ci/build_test_release.groovy @@ -30,41 +30,6 @@ pipeline { if (env.RUN_TESTS == "1") { windows.unit_test() } - def safeBranchName = env.BRANCH_NAME.replaceAll('/', '_') - def python_suffix = "" - if (env.OVMS_PYTHON_ENABLED == "1") { - python_suffix = "on" - } else { - python_suffix = "off" - } - def packageName = "ovms_windows_${env.PRODUCT_VERSION}_${env.RELEASE_TAG}_python_${python_suffix}.zip" - def status = bat(returnStatus:true, script: "net use w: /delete /y 2>nul & net use w: \\\\10.102.76.118\\data\\cv_bench_cache\\OVMS_do_not_remove\\ovms_artefacts\\") - if (status != 0) { - error "Failed to map network drive. Status code: ${status}" - } - def destPath = "w:\\${env.PRODUCT_VERSION}\\${env.RELEASE_TAG}\\windows" - def latestPath = "${destPath}\\latest" - - status = bat(returnStatus:true, script: "if not exist \"${destPath}\\${buildstamp}\" mkdir \"${destPath}\\${buildstamp}\"") - if (status != 0) { - error "Failed to create directory. Status code: ${status}" - } - status = bat(returnStatus:true, script: "copy /Y \"${env.WORKSPACE}\\dist\\windows\\ovms.zip\" \"${destPath}\\${buildstamp}\\${packageName}\"") - if (status != 0) { - error "Failed to copy file. Status code: ${status}" - } - status = bat(returnStatus:true, script: "if exist \"${latestPath}\" rmdir /S /Q \"${latestPath}\"") - if (status != 0) { - error "Failed to remove directory. Status code: ${status}" - } - status = bat(returnStatus:true, script: "mkdir \"${latestPath}\"") - if (status != 0) { - error "Failed to create directory. Status code: ${status}" - } - status = bat(returnStatus:true, script: "copy /Y \"${env.WORKSPACE}\\dist\\windows\\ovms.zip\" \"${latestPath}\\${packageName}\"") - if (status != 0) { - error "Failed to copy file. Status code: ${status}" - } } finally { windows.archive_build_artifacts() windows.archive_test_artifacts() @@ -141,7 +106,57 @@ pipeline { error "Cannot load ci/loadWin.groovy file." } } + } } + stage ("Promote package"){ + steps { + script { + def windows = load 'ci/loadWin.groovy' + if (windows != null) { + def safeBranchName = env.BRANCH_NAME.replaceAll('/', '_') + def python_suffix = "" + if (env.OVMS_PYTHON_ENABLED == "1") { + python_suffix = "on" + } else { + python_suffix = "off" + } + def packageName = "ovms_windows_${env.PRODUCT_VERSION}_${env.RELEASE_TAG}_python_${python_suffix}.zip" + def sourceFile = "ovms.zip" + if (env.SIGN_FILES == "true" && env.SIGN_USER_PASSWORD != "") { + sourceFile = "ovms_windows_python_${python_suffix}.zip" + } + def status = bat(returnStatus:true, script: "net use w: /delete /y 2>nul & net use w: \\\\10.102.76.118\\data\\cv_bench_cache\\OVMS_do_not_remove\\ovms_artefacts\\") + if (status != 0) { + error "Failed to map network drive. Status code: ${status}" + } + def destPath = "w:\\${env.PRODUCT_VERSION}\\${env.RELEASE_TAG}\\windows" + def latestPath = "${destPath}\\latest" + + status = bat(returnStatus:true, script: "if not exist \"${destPath}\\${buildstamp}\" mkdir \"${destPath}\\${buildstamp}\"") + if (status != 0) { + error "Failed to create directory. Status code: ${status}" + } + status = bat(returnStatus:true, script: "copy /Y \"${env.WORKSPACE}\\dist\\windows\\${sourceFile}\" \"${destPath}\\${buildstamp}\\${packageName}\"") + if (status != 0) { + error "Failed to copy file. Status code: ${status}" + } + status = bat(returnStatus:true, script: "if exist \"${latestPath}\" rmdir /S /Q \"${latestPath}\"") + if (status != 0) { + error "Failed to remove directory. Status code: ${status}" + } + status = bat(returnStatus:true, script: "mkdir \"${latestPath}\"") + if (status != 0) { + error "Failed to create directory. Status code: ${status}" + } + status = bat(returnStatus:true, script: "copy /Y \"${env.WORKSPACE}\\dist\\windows\\${sourceFile}\" \"${latestPath}\\${packageName}\"") + if (status != 0) { + error "Failed to copy file. Status code: ${status}" + } + } else { + error "Cannot load ci/loadWin.groovy file." + } + } + } } } } From 27fada47b1b89b72566d9d34cad8152f65af939a Mon Sep 17 00:00:00 2001 From: Pawel Rzepecki Date: Thu, 23 Jul 2026 09:17:37 +0200 Subject: [PATCH 3/9] not failing the pipeline on signing fail --- ci/build_test_release.groovy | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ci/build_test_release.groovy b/ci/build_test_release.groovy index 142b1b7fa7..a528a3dabe 100644 --- a/ci/build_test_release.groovy +++ b/ci/build_test_release.groovy @@ -60,6 +60,7 @@ pipeline { stage ("BDBA scans"){ when { expression { env.BDBA_SCAN == "true" } } steps { + catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') { script { def windows = load 'ci/loadWin.groovy' if (windows != null) { @@ -79,11 +80,13 @@ pipeline { error "Cannot load ci/loadWin.groovy file." } } + } } } stage ("Signing files"){ when { expression { env.SIGN_FILES == "true" && env.SIGN_USER_PASSWORD != "" } } steps { + catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') { echo "OVMS_PYTHON_ENABLED: ${env.OVMS_PYTHON_ENABLED}" script { if (env.RELEASE_TYPE == "RELEASE") { @@ -106,6 +109,7 @@ pipeline { error "Cannot load ci/loadWin.groovy file." } } + } } } stage ("Promote package"){ From 00dec4dd694cf5f54b7adaafeadea657c8f7f4ea Mon Sep 17 00:00:00 2001 From: Pawel Rzepecki Date: Thu, 23 Jul 2026 09:52:47 +0200 Subject: [PATCH 4/9] buildstamp fix --- ci/build_test_release.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/build_test_release.groovy b/ci/build_test_release.groovy index a528a3dabe..f4df8072ae 100644 --- a/ci/build_test_release.groovy +++ b/ci/build_test_release.groovy @@ -13,8 +13,8 @@ pipeline { when { expression { env.PACKAGE_URL == "" } } steps { script { - def buildstamp = new Date().format('yyyyMMddHHmmss') - echo "Buildstamp: ${buildstamp}" + env.BUILDSTAMP = new Date().format('yyyyMMddHHmmss') + echo "Buildstamp: ${env.BUILDSTAMP}" echo "PRODUCT_VERSION: ${env.PRODUCT_VERSION}" echo "RELEASE_TAG: ${env.RELEASE_TAG}" echo "JOB_BASE_NAME: ${env.JOB_BASE_NAME}" @@ -136,11 +136,11 @@ pipeline { def destPath = "w:\\${env.PRODUCT_VERSION}\\${env.RELEASE_TAG}\\windows" def latestPath = "${destPath}\\latest" - status = bat(returnStatus:true, script: "if not exist \"${destPath}\\${buildstamp}\" mkdir \"${destPath}\\${buildstamp}\"") + status = bat(returnStatus:true, script: "if not exist \"${destPath}\\${env.BUILDSTAMP}\" mkdir \"${destPath}\\${env.BUILDSTAMP}\"") if (status != 0) { error "Failed to create directory. Status code: ${status}" } - status = bat(returnStatus:true, script: "copy /Y \"${env.WORKSPACE}\\dist\\windows\\${sourceFile}\" \"${destPath}\\${buildstamp}\\${packageName}\"") + status = bat(returnStatus:true, script: "copy /Y \"${env.WORKSPACE}\\dist\\windows\\${sourceFile}\" \"${destPath}\\${env.BUILDSTAMP}\\${packageName}\"") if (status != 0) { error "Failed to copy file. Status code: ${status}" } From e3f31b8418b6540cddb5a306bc77a76f9495fe35 Mon Sep 17 00:00:00 2001 From: Pawel Rzepecki Date: Thu, 23 Jul 2026 10:33:16 +0200 Subject: [PATCH 5/9] adding coping of sha256 files --- ci/build_test_release.groovy | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ci/build_test_release.groovy b/ci/build_test_release.groovy index f4df8072ae..00152f9e53 100644 --- a/ci/build_test_release.groovy +++ b/ci/build_test_release.groovy @@ -127,7 +127,12 @@ pipeline { def packageName = "ovms_windows_${env.PRODUCT_VERSION}_${env.RELEASE_TAG}_python_${python_suffix}.zip" def sourceFile = "ovms.zip" if (env.SIGN_FILES == "true" && env.SIGN_USER_PASSWORD != "") { - sourceFile = "ovms_windows_python_${python_suffix}.zip" + def signedFiles = "${env.WORKSPACE}\\dist\\windows\\ovms_windows_python_${python_suffix}.zip" + if (fileExists(signedFiles)) { + sourceFile = "ovms_windows_python_${python_suffix}.zip" + } else { + echo "WARNING: Signed file not found, falling back to unsigned ovms.zip" + } } def status = bat(returnStatus:true, script: "net use w: /delete /y 2>nul & net use w: \\\\10.102.76.118\\data\\cv_bench_cache\\OVMS_do_not_remove\\ovms_artefacts\\") if (status != 0) { @@ -144,6 +149,10 @@ pipeline { if (status != 0) { error "Failed to copy file. Status code: ${status}" } + status = bat(returnStatus:true, script: "copy /Y \"${env.WORKSPACE}\\dist\\windows\\${sourceFile}.sha256\" \"${destPath}\\${env.BUILDSTAMP}\\${packageName}.sha256\"") + if (status != 0) { + error "Failed to copy sha256 file. Status code: ${status}" + } status = bat(returnStatus:true, script: "if exist \"${latestPath}\" rmdir /S /Q \"${latestPath}\"") if (status != 0) { error "Failed to remove directory. Status code: ${status}" @@ -156,6 +165,10 @@ pipeline { if (status != 0) { error "Failed to copy file. Status code: ${status}" } + status = bat(returnStatus:true, script: "copy /Y \"${env.WORKSPACE}\\dist\\windows\\${sourceFile}.sha256\" \"${latestPath}\\${packageName}.sha256\"") + if (status != 0) { + error "Failed to copy sha256 file. Status code: ${status}" + } } else { error "Cannot load ci/loadWin.groovy file." } From b9dc552bc9618390dd854d7349ba7add43f72c5d Mon Sep 17 00:00:00 2001 From: Pawel Rzepecki Date: Thu, 23 Jul 2026 11:39:36 +0200 Subject: [PATCH 6/9] sha256 fix --- ci/build_test_release.groovy | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ci/build_test_release.groovy b/ci/build_test_release.groovy index 00152f9e53..4ad7cceff3 100644 --- a/ci/build_test_release.groovy +++ b/ci/build_test_release.groovy @@ -126,10 +126,12 @@ pipeline { } def packageName = "ovms_windows_${env.PRODUCT_VERSION}_${env.RELEASE_TAG}_python_${python_suffix}.zip" def sourceFile = "ovms.zip" + def shaFile = "" if (env.SIGN_FILES == "true" && env.SIGN_USER_PASSWORD != "") { def signedFiles = "${env.WORKSPACE}\\dist\\windows\\ovms_windows_python_${python_suffix}.zip" if (fileExists(signedFiles)) { sourceFile = "ovms_windows_python_${python_suffix}.zip" + shaFile = "ovms_windows_python_${python_suffix}.zip.sha256" } else { echo "WARNING: Signed file not found, falling back to unsigned ovms.zip" } @@ -165,9 +167,11 @@ pipeline { if (status != 0) { error "Failed to copy file. Status code: ${status}" } - status = bat(returnStatus:true, script: "copy /Y \"${env.WORKSPACE}\\dist\\windows\\${sourceFile}.sha256\" \"${latestPath}\\${packageName}.sha256\"") - if (status != 0) { - error "Failed to copy sha256 file. Status code: ${status}" + if (shaFile != "") { + status = bat(returnStatus:true, script: "copy /Y \"${env.WORKSPACE}\\dist\\windows\\${shaFile}\" \"${latestPath}\\${packageName}.sha256\"") + if (status != 0) { + error "Failed to copy sha256 file. Status code: ${status}" + } } } else { error "Cannot load ci/loadWin.groovy file." From 8b7658ef7412e779c5f20ab458fef3e390a23a96 Mon Sep 17 00:00:00 2001 From: Pawel Rzepecki Date: Thu, 23 Jul 2026 12:50:20 +0200 Subject: [PATCH 7/9] shafile fix --- ci/build_test_release.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_test_release.groovy b/ci/build_test_release.groovy index 4ad7cceff3..bca5a31bed 100644 --- a/ci/build_test_release.groovy +++ b/ci/build_test_release.groovy @@ -167,7 +167,7 @@ pipeline { if (status != 0) { error "Failed to copy file. Status code: ${status}" } - if (shaFile != "") { + if (shaFile != "" && fileExists("${env.WORKSPACE}\\dist\\windows\\${shaFile}")) { status = bat(returnStatus:true, script: "copy /Y \"${env.WORKSPACE}\\dist\\windows\\${shaFile}\" \"${latestPath}\\${packageName}.sha256\"") if (status != 0) { error "Failed to copy sha256 file. Status code: ${status}" From 189110980c2d1f68d4b7a27ed29f6b51f4796c3e Mon Sep 17 00:00:00 2001 From: Pawel Rzepecki Date: Thu, 23 Jul 2026 15:39:19 +0200 Subject: [PATCH 8/9] fix --- ci/build_test_release.groovy | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ci/build_test_release.groovy b/ci/build_test_release.groovy index bca5a31bed..0e93bc6963 100644 --- a/ci/build_test_release.groovy +++ b/ci/build_test_release.groovy @@ -151,10 +151,6 @@ pipeline { if (status != 0) { error "Failed to copy file. Status code: ${status}" } - status = bat(returnStatus:true, script: "copy /Y \"${env.WORKSPACE}\\dist\\windows\\${sourceFile}.sha256\" \"${destPath}\\${env.BUILDSTAMP}\\${packageName}.sha256\"") - if (status != 0) { - error "Failed to copy sha256 file. Status code: ${status}" - } status = bat(returnStatus:true, script: "if exist \"${latestPath}\" rmdir /S /Q \"${latestPath}\"") if (status != 0) { error "Failed to remove directory. Status code: ${status}" From c57f44803af06cd3cafb2d7f58a73aaa9a1081e6 Mon Sep 17 00:00:00 2001 From: Pawel Rzepecki Date: Thu, 23 Jul 2026 16:04:31 +0200 Subject: [PATCH 9/9] copilot's review --- ci/build_test_release.groovy | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ci/build_test_release.groovy b/ci/build_test_release.groovy index 0e93bc6963..47cf083eeb 100644 --- a/ci/build_test_release.groovy +++ b/ci/build_test_release.groovy @@ -115,9 +115,12 @@ pipeline { stage ("Promote package"){ steps { script { + if (!env.BUILDSTAMP?.trim()) { + env.BUILDSTAMP = new Date().format('yyyyMMddHHmmss') + } + echo "Buildstamp: ${env.BUILDSTAMP}" def windows = load 'ci/loadWin.groovy' if (windows != null) { - def safeBranchName = env.BRANCH_NAME.replaceAll('/', '_') def python_suffix = "" if (env.OVMS_PYTHON_ENABLED == "1") { python_suffix = "on"