From 6922c32b7f15775636e89a11e1ec22e6bbb75ad1 Mon Sep 17 00:00:00 2001 From: "Florian Klostermann [Allied Vision]" Date: Thu, 27 Jul 2023 14:15:34 +0200 Subject: [PATCH] Pull request #1: Feature/UNISDK-3114 create jenkins jobs for building micro manager avt device adapter Merge in HSW_SDK/mmcoreanddevices from feature/UNISDK-3114-create-jenkins-jobs-for-building-micro-manager-avt-device-adapter to allied-vision-camera-device-adapter Squashed commit of the following: commit 3ef56cc7e2efbdda688d732476055bfdd318a234 Author: Florian Klostermann Date: Thu Jul 27 14:09:14 2023 +0200 Jenkinsfile fix commit f74b0b65cf5fce2277b17433b612915c51d52eaa Author: Florian Klostermann Date: Thu Jul 27 14:01:23 2023 +0200 fixed Windows Jenkinsfile commit bf1304f3b1afb11a19f32bbdaffd5ec0d80e2a59 Author: Florian Klostermann Date: Thu Jul 27 11:58:32 2023 +0200 Added Windows Jenkinsfile --- .../jenkins/Windows/Jenkinsfile | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 DeviceAdapters/AlliedVisionCamera/jenkins/Windows/Jenkinsfile diff --git a/DeviceAdapters/AlliedVisionCamera/jenkins/Windows/Jenkinsfile b/DeviceAdapters/AlliedVisionCamera/jenkins/Windows/Jenkinsfile new file mode 100644 index 000000000..1e904b62e --- /dev/null +++ b/DeviceAdapters/AlliedVisionCamera/jenkins/Windows/Jenkinsfile @@ -0,0 +1,59 @@ +properties([ + buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '14')), + [$class: 'RebuildSettings', autoRebuild: false, rebuildDisabled: false], + [$class: 'JobLocalConfiguration', changeReasonComment: ''] +]) + +pipeline { + + agent { label 'Host_Software_Windows_Build_Machine2' } + + stages { + + stage("Build") { + steps { + bat label: 'cmake build Release', script: '''CALL %VS2019_VCVARSALL_BAT% amd64 + msbuild micromanager.sln /p:Configuration=Release /p:Platform=x64 -t:AlliedVisionCamera''' + } + } + + stage("Deploy") { + steps { + script { + def buildDir = "build\\Release\\x64" + def deployDir = "MicroManager_AlliedVisionCamera" + + bat label: 'Create Deploy folder', script: """rd /s /q ${deployDir} + mkdir ${deployDir} + copy /Y /V ${buildDir}\\mmgr_dal_AlliedVisionCamera.dll ${deployDir}""" + + withCredentials([usernamePassword(credentialsId: 'jenkins-nexus-user', usernameVariable: 'NEXUS_USER', passwordVariable: 'NEXUS_USER_PW')]) { + bat label: 'Upload to Nexus', script:"""python -m nexus_handler upload --repository hsw_test --group-id avt.hsw.vimba.Win64 --artifact-id MicroManager_AlliedVisionCamera --auto-version --input ${deployDir} --type zip --user %NEXUS_USER% --password "%NEXUS_USER_PW%" """ + } + } + } + } + } + post { + always { + notifyBitbucket(projectKey: "${currentBuild.fullDisplayName}") + } + unstable { + emailext ( + subject: "UNSTABLE: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'", + body: """The build for the job ${env.JOB_NAME} > #${env.BUILD_NUMBER} failed: +Check console output at ${env.BUILD_URL}""", + recipientProviders: [[$class: 'DevelopersRecipientProvider']] + ) + } + failure { + emailext ( + subject: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'", + body: """The Job ${env.JOB_NAME} resulted in an unexpected error during build ${env.BUILD_NUMBER}. + +Check console output at ${env.BUILD_URL}""", + recipientProviders: [[$class: 'DevelopersRecipientProvider']] + ) + } + } +} \ No newline at end of file