33
44def ipAddress
55def vmName = " Plugin-VisualStudio-" + UUID . randomUUID(). toString()
6- def msbuildLocation = " \" C:\\ Program Files (x86)\\ Microsoft Visual Studio\\ 2019\\ Professional\\ MSBuild\\ Current\\ Bin\\ MSBuild.exe\" "
6+ def msbuildLocationVS2019 = " \" C:\\ Program Files (x86)\\ Microsoft Visual Studio\\ 2019\\ Enterprise\\ MSBuild\\ Current\\ Bin\\ MSBuild.exe\" "
7+ def msbuildLocationVS2022 = " \" C:\\ Program Files\\ Microsoft Visual Studio\\ 2022\\ Professional\\ MSBuild\\ Current\\ Bin\\ MSBuild.exe\" "
78
89pipeline {
910 parameters {
1011 string(name : " decommissionPeriod" , defaultValue : " 3 hour" , description : " Decommission period" )
11- string (name : " templateName" , defaultValue : " VisualStudio -Template" , description : " Template name, if not specified then \" VisualStudio -Template\" template will be chosen" )
12+ choice (name : " templateName" , choices : [ " VisualStudio2019 -Template" ," VisualStudio2022-Template " ], description : " Template name, if not specified then \" VisualStudio2019 -Template\" template will be chosen" )
1213 booleanParam(name : ' doNotDeleteVM' , defaultValue : false , description : ' If selected, VM will not be deleted after process finished' )
1314 gitParameter branchFilter : ' origin/(.*)' , defaultValue : ' master' , name : ' branch' , type : ' PT_BRANCH'
1415 }
@@ -29,7 +30,13 @@ pipeline {
2930 agent { node { label vmName } }
3031 steps {
3132 script {
32- bat " ${ msbuildLocation} ${ WORKSPACE} \\ ${ JOB_NAME} \\ ci.msbuild /t:CI /p:VisualStudioVersion=\" 16.0\" /p:DeployExtension=false"
33+ if (templateName == " VisualStudio2019-Template" )
34+ {
35+ bat " ${ msbuildLocationVS2019} ${ WORKSPACE} \\ ci.msbuild /t:CI /p:VisualStudioVersion=\" 16.0\" /p:DeployExtension=false"
36+ }
37+ else {
38+ bat " ${ msbuildLocationVS2022} ${ WORKSPACE} \\ ci.msbuild2022 /t:CI /p:VisualStudioVersion=\" 17.0\" /p:DeployExtension=false"
39+ }
3340 }
3441 }
3542 }
@@ -38,8 +45,16 @@ pipeline {
3845 agent { node { label vmName } }
3946 steps {
4047 script {
41- fileOperations([folderRenameOperation(source : " ${ WORKSPACE} \\ ${ JOB_NAME} \\ Artifacts\\ CxViewerVSIX.vsix" , destination : " ${ WORKSPACE} \\ ${ JOB_NAME} \\ Artifacts\\ CxViewerVSIX-9.00.8.vsix" )])
42- kit.Upload_To_Artifactory (" ${ WORKSPACE} \\ ${ JOB_NAME} \\ Artifacts\\ CxViewerVSIX-9.00.8.vsix" , " plugins-release-local/com/checkmarx/visual-studio/" )
48+ if (templateName == " VisualStudio2019-Template" )
49+ {
50+ fileOperations([folderRenameOperation(source : " ${ WORKSPACE} \\ Artifacts\\ CxViewerVSIX-2019.vsix" , destination : " ${ WORKSPACE} \\ Artifacts\\ CxViewerVSIX-9.00.19.vsix" )])
51+ kit.Upload_To_Artifactory (" ${ WORKSPACE} \\ Artifacts\\ CxViewerVSIX-9.00.19.vsix" , " plugins-release-local/com/checkmarx/visual-studio/" )
52+ }
53+ else
54+ {
55+ fileOperations([folderRenameOperation(source : " ${ WORKSPACE} \\ Artifacts\\ CxViewerVSIX-2022.vsix" , destination : " ${ WORKSPACE} \\ Artifacts\\ CxViewerVSIX-9.00.19.vsix" )])
56+ kit.Upload_To_Artifactory (" ${ WORKSPACE} \\ Artifacts\\ CxViewerVSIX-9.00.19.vsix" , " plugins-release-local/com/checkmarx/visual-studio/" )
57+ }
4358 }
4459 }
4560 }
@@ -48,7 +63,7 @@ pipeline {
4863 post {
4964 always {
5065 script {
51- logstashSend failBuild : false , maxLines : 1000
66+ // logstashSend failBuild: false, maxLines: 1000 - commented code due to job failed because of logstashSend plugin not found
5267 if (ipAddress != null ) {
5368 try {
5469 if (doNotDeleteVM == ' true' ) {
0 commit comments