Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 40 additions & 6 deletions ci/build_test_release.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ pipeline {
when { expression { env.PACKAGE_URL == "" } }
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}"
echo "JOB_BASE_NAME: ${env.JOB_BASE_NAME}"
echo "WORKSPACE: ${env.WORKSPACE}"
echo "OVMS_PYTHON_ENABLED: ${env.OVMS_PYTHON_ENABLED}"
Expand All @@ -23,16 +28,45 @@ pipeline {
windows.install_dependencies()
windows.clean()
windows.build()
windows.unit_test()
if (env.RUN_TESTS == "1") {
windows.unit_test()
}
def safeBranchName = env.BRANCH_NAME.replaceAll('/', '_')
Comment thread
przepeck marked this conversation as resolved.
def python_presence = ""
def python_suffix = ""
if (env.OVMS_PYTHON_ENABLED == "1") {
python_presence = "with_python"
python_suffix = "on"
} else {
python_presence = "without_python"
python_suffix = "off"
}
def packageName = "ovms_windows_${env.PRODUCT_VERSION}_${env.RELEASE_TAG}_${shortCommit}_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}"
}
bat(returnStatus:true, script: "ECHO F | xcopy /Y /E ${env.WORKSPACE}\\dist\\windows\\ovms.zip \\\\${env.OV_SHARE_05_IP}\\data\\cv_bench_cache\\OVMS_do_not_remove\\ovms-windows-${python_presence}-${safeBranchName}-latest.zip")
} finally {
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()
}
Expand Down