172 lines
No EOL
7.6 KiB
Groovy
172 lines
No EOL
7.6 KiB
Groovy
pipeline {
|
|
agent { label "${AGENT_LABEL}" }
|
|
stages {
|
|
stage ('Cleaning Test_Output') {
|
|
steps{
|
|
bat'''if exist %WORKSPACE%\\Test_Output rmdir /s /q %WORKSPACE%\\Test_Output'''
|
|
}
|
|
}
|
|
stage ('Cleaning imports') {
|
|
steps{
|
|
bat'''if exist %WORKSPACE%\\imports rmdir /s /q %WORKSPACE%\\imports'''
|
|
}
|
|
}
|
|
stage('Clean workspace') {
|
|
when {
|
|
expression {
|
|
"${CLEAN_WORKSPACE}" == "true"
|
|
}
|
|
}
|
|
steps {
|
|
cleanWs()
|
|
}
|
|
}
|
|
stage("checkout python"){
|
|
steps{
|
|
checkout([$class: 'GitSCM',
|
|
branches: [[name: 'origin/3.6.3_windows']],
|
|
doGenerateSubmoduleConfigurations: false,
|
|
extensions: [[$class: 'CleanBeforeCheckout'], [$class: 'RelativeTargetDirectory', relativeTargetDir: 'python']],
|
|
submoduleCfg: [], userRemoteConfigs: [[url: 'git@hydra:tools/python.git']]])
|
|
script{
|
|
env.PYTHON = "${WORKSPACE}/python/ver/python.exe"
|
|
}
|
|
}
|
|
}
|
|
stage('Checkout source') {
|
|
steps {
|
|
checkout([$class: 'GitSCM',
|
|
branches: [[name: 'origin/${TEST_BRANCH}']],
|
|
doGenerateSubmoduleConfigurations: false,
|
|
extensions: [[$class: 'CleanBeforeCheckout'], [$class: 'RelativeTargetDirectory', relativeTargetDir: 'testscripts']],
|
|
submoduleCfg: [], userRemoteConfigs: [[url: 'git@hydra:gis/atlaskiosksdk_test.git']]])
|
|
}
|
|
}
|
|
stage('Checkout GisCore') {
|
|
steps {
|
|
checkout([$class: 'GitSCM',
|
|
branches: [[name: 'origin/${GISCORE_BRANCH}']],
|
|
doGenerateSubmoduleConfigurations: false,
|
|
extensions: [[$class: 'CleanBeforeCheckout'], [$class: 'RelativeTargetDirectory', relativeTargetDir: 'GisCore']],
|
|
submoduleCfg: [], userRemoteConfigs: [[url: 'git@hydra:gistest/giscorelite.git']]])
|
|
}
|
|
}
|
|
stage('Checkout test utilites') {
|
|
steps {
|
|
checkout([$class: 'GitSCM',
|
|
branches: [[name: 'origin/master']],
|
|
doGenerateSubmoduleConfigurations: false,
|
|
extensions: [[$class: 'CleanBeforeCheckout'], [$class: 'RelativeTargetDirectory', relativeTargetDir: 'Utilities']],
|
|
submoduleCfg: [], userRemoteConfigs: [[url: 'git@hydra:gistest/Utilities.git']]])
|
|
}
|
|
}
|
|
stage("Clean imports") {
|
|
steps {
|
|
script {
|
|
env.IMPORTSPATH = "${WORKSPACE}/imports"
|
|
}
|
|
dir("${IMPORTSPATH}") {
|
|
deleteDir()
|
|
}
|
|
}
|
|
}
|
|
stage("Clean exports") {
|
|
steps {
|
|
dir("${WORKSPACE}/uilogs") {
|
|
deleteDir()
|
|
}
|
|
dir("${WORKSPACE}/version") {
|
|
deleteDir()
|
|
}
|
|
dir("${WORKSPACE}/pipeline") {
|
|
deleteDir()
|
|
}
|
|
}
|
|
}
|
|
stage('Import artifacts') {
|
|
steps {
|
|
script {
|
|
MCS = "${IMPORTSPATH}/mcs"
|
|
echo "Obtaining MCS artifacts from ${MCS_BINARIES_JOB} job and placing at folder: ${MCS}"
|
|
copyArtifacts filter: 'build/publish/**', projectName: "${MCS_BINARIES_JOB}", selector: lastSuccessful(), target: "${MCS}"
|
|
copyArtifacts filter: 'bin/x64/Release/Engine - Render.dll,bin/x64/Release/TBarCode11_x64.dll,bin/x64/Release/GIS Utility - Toolbox.dll,bin/x64/Release/zlib1.dll,bin/x64/Release/TECIT.TBarCode.dll', flatten: true, projectName: "${PRINT_SERVER_RENDER_FILES}", selector: lastSuccessful(), target: "${MCS}/build/publish/"
|
|
|
|
ATLAS = "${IMPORTSPATH}/atlas"
|
|
echo "Obtaining Atlas artifacts from ${ATLAS_BINARIES_JOB} job and placing at folder: ${ATLAS}"
|
|
copyArtifacts filter: 'bin/**,LocalisationSDK/**,version/**', projectName: "${ATLAS_BINARIES_JOB}", selector: lastSuccessful(), target: "${ATLAS}"
|
|
|
|
KIOSK = "${IMPORTSPATH}/kiosk"
|
|
echo "Obtaining Atlas KIOSK artifacts from ${ATLAS_BINARIES_JOB} job and placing at folder: ${KIOSK}"
|
|
copyArtifacts filter: 'binKiosk/**,LocalisationSDK/**,version/**', projectName: "${ATLAS_BINARIES_JOB}", selector: lastSuccessful(), target: "${KIOSK}"
|
|
}
|
|
}
|
|
|
|
}
|
|
stage ('Copy the kiosk tool files for Atlas Production') {
|
|
steps {
|
|
script {
|
|
bat '''
|
|
"%WORKSPACE%/testscripts/UITests/SetupScripts/copy_atlas_production.bat"
|
|
'''
|
|
}
|
|
}
|
|
}
|
|
stage('Save environment variable(s) to file for TestExecute bug') {
|
|
steps {
|
|
script {
|
|
bat '''
|
|
set WORKSPACE > "%SystemRoot%/Temp/environment-variables-from-jenkins.txt"
|
|
'''
|
|
}
|
|
}
|
|
}
|
|
stage('Create a VPIRender.Server.bat') {
|
|
steps {
|
|
script {
|
|
bat '''
|
|
echo "C:/Program Files/dotnet/dotnet.exe" "%WORKSPACE%/imports/mcs/build/publish/VpiRender.Server.dll" --owner localhost:5000 > "%WORKSPACE%/imports/mcs/build/publish/VpiRender.Server.bat"
|
|
'''
|
|
}
|
|
}
|
|
}
|
|
stage('Check available TE Licences'){
|
|
steps{
|
|
script {
|
|
res = build(job: "Check_TE_Licence", propagate: false).result
|
|
if (res != 'SUCCESS') {
|
|
currentBuild.result = 'FAILED'
|
|
error "No more available Test Execute licences. Stopping pipeline."
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
stage('Test loop') {
|
|
steps {
|
|
script {
|
|
failureCount = 0
|
|
String[] tests
|
|
powershell(returnStdout: true, script: '$names = @("dotnet", "Atlas Professional for Print Server", "Atlas Professional", "GIS Print Server 2", "AtlasKioskSDK", "pythonw"); foreach ($item in $names) {Get-Process -Name $item | Stop-Process}')
|
|
testcompletetest generateMHT: true, launchType: 'lcTags', project: "AtlasMCSProject", suite: "testscripts/UITests/AtlasTestSuite/AtlasTestSuite.pjs", tags: "${TAG}", useTCService: true, userName: 'jenkins_user', userPassword: 'ramshorn42', useActiveSession: true, executorType: "TE", timeout: '14400', useTimeout: true, actionOnErrors: 'MAKE_FAILED'
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
post {
|
|
always {
|
|
bat " %WORKSPACE%\\python\\ver\\python.exe %WORKSPACE%\\testscripts\\UITests\\Utils\\HistoryStructure.py --url ${env.BUILD_URL} --ws_path ${env.WORKSPACE}"
|
|
}
|
|
failure {
|
|
bat " %WORKSPACE%\\python\\ver\\python.exe %WORKSPACE%\\Utilities\\sendEmail\\emailnotification.py -t TC -j ${env.BUILD_URL} -n ${env.JOB_NAME} -s FAILED"
|
|
}
|
|
success {
|
|
|
|
bat " %WORKSPACE%\\python\\ver\\python.exe %WORKSPACE%\\Utilities\\sendEmail\\emailnotification.py -t TC -j ${env.BUILD_URL} -n ${env.JOB_NAME} -s SUCCESS"
|
|
}
|
|
unstable {
|
|
bat " %WORKSPACE%\\python\\ver\\python.exe %WORKSPACE%\\Utilities\\sendEmail\\emailnotification.py -t TC -j ${env.BUILD_URL} -n ${env.JOB_NAME} -s FAILED"
|
|
|
|
}
|
|
}
|
|
} |