1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-11-23 22:05:15 +02:00
Files
OpenIntegrations/ci/edt_build
Anton Titovets d93f798816 Fastfix
2025-11-06 10:32:23 +03:00

83 lines
3.2 KiB
Plaintext
Vendored

pipeline {
agent { label 'windows' }
stages {
stage('Initialize') {
steps {
script {
def config = readJSON file: './service/local_vars.json'
env.ONEC_PATH = config.onec_path
env.EDT_RU = config.edt_ru_path
env.EDT_EN = config.edt_en_path
env.IB_RU = config.ib_ru_name
env.IB_EN = config.ib_en_name
env.SRV = config.server_name
}
}
}
stage('Build') {
steps {
script {
bat encoding: 'UTF-8', script: "chcp 65001 >nul && 1cedtcli -data \"${env.EDT_RU}\" -command export --project ./src/ru/OPI --configuration-files ./build/OPI_RU"
bat encoding: 'UTF-8', script: "chcp 65001 >nul && 1cedtcli -data \"${env.EDT_EN}\" -command export --project ./src/en/OPI --configuration-files ./build/OPI_EN"
}
}
}
stage('Update') {
steps {
script {
timeout(time: 2, unit: 'MINUTES') {
bat encoding: 'UTF-8', script: "chcp 65001 >nul && \"${env.ONEC_PATH}\" DESIGNER /IBName \"${env.IB_RU}\" /LoadConfigFromFiles ./build/OPI_RU -Extension OpenIntegrations"
}
timeout(time: 2, unit: 'MINUTES') {
bat encoding: 'UTF-8', script: "chcp 65001 >nul && \"${env.ONEC_PATH}\" DESIGNER /IBName \"${env.IB_EN}\" /LoadConfigFromFiles ./build/OPI_EN -Extension OpenIntegrations"
}
}
}
}
stage('Hash check') {
steps {
script {
def tests = [
['BuildCheckRu', './service/yaxunit_conf/ru/BuildCheck.json', ],
['BuildCheckEn', './service/yaxunit_conf/en/BuildCheck.json'],
]
for (test in tests) {
runLibraryTest(test[0], test[1], env.ONEC_PATH, test[2])
}
}
}
}
}
}
def runLibraryTest(String libraryName, String configPath, String oneCPath, String ibName) {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
script {
def ibConn = "Srvr=\"${env.SRV}\";Ref=\"${ibName}\";"
bat encoding: 'UTF-8', script: "\"${oneCPath}\" /IBConnectionString \"${ibConn}\" /C\"RunUnitTests=${configPath}\""
}
timeout(time: 60, unit: 'MINUTES') {
waitUntil {
fileExists "./test_results/${libraryName}.code"
}
}
if (fileExists("./test_results/${libraryName}.report")) {
def reportContent = readFile("./test_results/${libraryName}.report")
echo "=== ${libraryName} report content ==="
echo reportContent
} else {
echo "WARNING: ${libraryName}.report not found"
}
def exitCode = readFile("./test_results/${libraryName}.code").trim().replaceAll(/[^0-9]/, '')
echo "Exit code: ${exitCode}"
if (exitCode != '0') {
error "Tests ${libraryName} failed (exit code: ${exitCode})"
}
}
}