From 2c6f4522cd8cbee6a8396d47ab75dcb28bdf67b6 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Fri, 27 Sep 2019 14:13:56 +0200 Subject: [PATCH] update jenkinsfile... --- Jenkinsfile | 469 +++++++++++++++++++++++++++---------------------- VersGen/GPW.cs | 8 +- VersGen/GPW.tt | 10 +- 3 files changed, 269 insertions(+), 218 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3afca1e..e62b6b9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,9 +5,9 @@ pipeline { enableIIS02 = 'N' } stages { - stage('Checkout') { + stage('Checkout') { agent any - steps { + steps { /* build delle SteamWare libs! */ /*build 'SteamWare/SteamWareLib'*/ /* copio le libs...*/ @@ -16,8 +16,8 @@ pipeline { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { withEnv(['NEXT_BUILD_NUMBER=4062']) { - env.versionNumber = VersionNumber(versionNumberString : '${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) - /*env.versionNumber = VersionNumber(versionNumberString : '${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')*/ + // env.versionNumber = VersionNumber(versionNumberString : '${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) + env.versionNumber = VersionNumber(versionNumberString : '${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'GPW' } } @@ -30,199 +30,199 @@ pipeline { currentBuild.description = "TEST ${env.versionNumber}" } } - /* CAMBIO numero versione in file sorgente!!! */ - bat "fart.exe VersGen\\GPW.cs 999.0 ${env.versionNumber} || EXIT /B 0" - } - } - stage('Build') { - agent any - steps { - parallel ( - HOME: { - sleep 2 - bat "\"${tool 'MSBuild-15.0'}\" HOME\\HOME.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" - }, - ADMIN: { - bat "\"${tool 'MSBuild-15.0'}\" GPW_Smart\\GPW_Smart.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" - }, - BARCODE: { - sleep 1 - bat "\"${tool 'MSBuild-15.0'}\" GPW_Barcode\\GPW_Barcode.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" - }, - SMART: { - sleep 1 - bat "\"${tool 'MSBuild-15.0'}\" GPW_Smart\\GPW_Smart.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" - }, - COMMESSE: { - bat "\"${tool 'MSBuild-15.0'}\" GPW_Commesse\\GPW_Commesse.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" - }, - failFast: false) - } - } - stage('Test') { - steps { - echo 'Testing.. 2 be done...' - } - } - stage('Deploy') { - agent any - steps { - script { - if (env.BRANCH_NAME == "master") { - /* CAMBIO numero versione in file sorgente!!! */ - bat "fart.exe VersGen\\GPW.cs 999.0 ${env.versionNumber} || EXIT /B 0" - parallel ( - ADMIN: { - if(env.enableIIS02 == "Y") - { - sleep 1 - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS02.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ GPW_Admin/GPW_Admin.csproj" - } - sleep 1 - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS01.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS01 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ GPW_Admin/GPW_Admin.csproj" - }, - BCODE: { - sleep 3 - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS01.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS01 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ GPW_Barcode/GPW_Barcode.csproj" - if(env.enableIIS02 == "Y") - { - sleep 1 - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS02.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ GPW_Barcode/GPW_Barcode.csproj" - } - }, - COMM: { - if(env.enableIIS02 == "Y") - { - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS02.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ GPW_Commesse/GPW_Commesse.csproj" - } - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS01.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS01 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ GPW_Commesse/GPW_Commesse.csproj" - }, - HOME: { - sleep 4 - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS01.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS01 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ HOME/HOME.csproj" - if(env.enableIIS02 == "Y") - { - sleep 1 - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS02.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ HOME/HOME.csproj" - } - }, - SMART: { - sleep 2 - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS01.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS01 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ GPW_Smart/GPW_Smart.csproj" - if(env.enableIIS02 == "Y") - { - sleep 1 - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS02.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ GPW_Smart/GPW_Smart.csproj" - } - }, - failFast: false) - } - else { - echo 'Nothing to deploy...' - } - } - } - } - stage('Installers') { - agent any - steps { - script { - /* compilo installers in base al BRANCH del cliente... */ - if (env.BRANCH_NAME == "SPS") { - /* CAMBIO numero versione in file sorgente!!! */ - bat "fart.exe VersGen\\GPW.cs 999.0 ${env.versionNumber} || EXIT /B 0" - parallel ( - HOME: { - sleep 4 - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/SPS_TEST/${env.versionNumber}/HOME.zip /p:DeployIisAppPath=\"Default Web Site/GPW_TEST/HOME\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ HOME/HOME.csproj" - sleep 1 - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/SPS_PROD/${env.versionNumber}/HOME.zip /p:DeployIisAppPath=\"Default Web Site/GPW/HOME\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ HOME/HOME.csproj" - /*echo 'Copia SPS'*/ - bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\HOME\\ReleaseClienti\" \"E:\\Staging\\byProd\\GPW\\SPS\\HOME\" " - }, - ADMIN: { - sleep 2 - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/SPS_TEST/${env.versionNumber}/GPW_Admin.zip /p:DeployIisAppPath=\"Default Web Site/GPW_TEST/ADMIN\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=SPS_GPW_TEST;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Admin/GPW_Admin.csproj" - sleep 1 - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/SPS_PROD/${env.versionNumber}/GPW_Admin.zip /p:DeployIisAppPath=\"Default Web Site/GPW/ADMIN\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=SPS_GPW;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Admin/GPW_Admin.csproj" - /*echo 'Copia SPS'*/ - bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\GPW_Admin\\ReleaseClienti\" \"E:\\Staging\\byProd\\GPW\\SPS\\ADMIN\" " - }, - BCODE: { - sleep 3 - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/SPS_TEST/${env.versionNumber}/GPW_Barcode.zip /p:DeployIisAppPath=\"Default Web Site/GPW_TEST/BCODE\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=SPS_GPW_TEST;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Barcode/GPW_Barcode.csproj" - sleep 1 - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/SPS_PROD/${env.versionNumber}/GPW_Barcode.zip /p:DeployIisAppPath=\"Default Web Site/GPW/BCODE\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=SPS_GPW;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Barcode/GPW_Barcode.csproj" - /*echo 'Copia SPS'*/ - bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\GPW_Barcode\\ReleaseClienti\" \"E:\\Staging\\byProd\\GPW\\SPS\\BCODE\" " - }, - COMM: { - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/SPS_TEST/${env.versionNumber}/GPW_Commesse.zip /p:DeployIisAppPath=\"Default Web Site/GPW_TEST/WRKLG\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=SPS_GPW_TEST;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Commesse/GPW_Commesse.csproj" - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/SPS_PROD/${env.versionNumber}/GPW_Commesse.zip /p:DeployIisAppPath=\"Default Web Site/GPW/WRKLG\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=SPS_GPW;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Commesse/GPW_Commesse.csproj" - /*echo 'Copia SPS'*/ - bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\GPW_Commesse\\ReleaseClienti\" \"E:\\Staging\\byProd\\GPW\\SPS\\COMM\" " - }, - SMART: { - sleep 1 - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/SPS_TEST/${env.versionNumber}/GPW_Smart.zip /p:DeployIisAppPath=\"Default Web Site/GPW_TEST/SMART\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=SPS_GPW_TEST;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Smart/GPW_Smart.csproj" - sleep 1 - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/SPS_PROD/${env.versionNumber}/GPW_Smart.zip /p:DeployIisAppPath=\"Default Web Site/GPW/SMART\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=SPS_GPW;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Smart/GPW_Smart.csproj" - /*echo 'Copia SPS'*/ - bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\GPW_Smart\\ReleaseClienti\" \"E:\\Staging\\byProd\\GPW\\SPS\\SMART\" " - }, - failFast: false) - } - else if (env.BRANCH_NAME == "ETS") { - /* CAMBIO numero versione in file sorgente!!! */ - bat "fart.exe VersGen\\GPW.cs 999.0 ${env.versionNumber} || EXIT /B 0" - parallel ( - HOME: { - sleep 4 - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=ETS /p:PublishProfile=ETS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/ETS_TEST/${env.versionNumber}/HOME.zip /p:DeployIisAppPath=\"Default Web Site/GPW_TEST/HOME\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ HOME/HOME.csproj" - sleep 4 - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=ETS /p:PublishProfile=ETS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/ETS_PROD/${env.versionNumber}/HOME.zip /p:DeployIisAppPath=\"Default Web Site/GPW/HOME\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ HOME/HOME.csproj" - /*echo 'Copia ETS'*/ - bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\HOME\\ReleaseClienti\" \"E:\\Staging\\byProd\\GPW\\ETS\\HOME\" " - }, - ADMIN: { - sleep 2 - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=ETS /p:PublishProfile=ETS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/ETS_TEST/${env.versionNumber}/GPW_Admin.zip /p:DeployIisAppPath=\"Default Web Site/GPW_TEST/ADMIN\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=ETS_GPW_TEST;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Admin/GPW_Admin.csproj" - sleep 2 - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=ETS /p:PublishProfile=ETS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/ETS_PROD/${env.versionNumber}/GPW_Admin.zip /p:DeployIisAppPath=\"Default Web Site/GPW/ADMIN\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=ETS_GPW;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Admin/GPW_Admin.csproj" - /*echo 'Copia ETS'*/ - bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\GPW_Admin\\ReleaseClienti\" \"E:\\Staging\\byProd\\GPW\\ETS\\ADMIN\" " - }, - BCODE: { - sleep 3 - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=ETS /p:PublishProfile=ETS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/ETS_TEST/${env.versionNumber}/GPW_Barcode.zip /p:DeployIisAppPath=\"Default Web Site/GPW_TEST/BCODE\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=ETS_GPW_TEST;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Barcode/GPW_Barcode.csproj" - sleep 3 - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=ETS /p:PublishProfile=ETS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/ETS_PROD/${env.versionNumber}/GPW_Barcode.zip /p:DeployIisAppPath=\"Default Web Site/GPW/BCODE\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=ETS_GPW;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Barcode/GPW_Barcode.csproj" - /*echo 'Copia ETS'*/ - bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\GPW_Barcode\\ReleaseClienti\" \"E:\\Staging\\byProd\\GPW\\ETS\\BCODE\" " - }, - COMM: { - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=ETS /p:PublishProfile=ETS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/ETS_TEST/${env.versionNumber}/GPW_Commesse.zip /p:DeployIisAppPath=\"Default Web Site/GPW_TEST/WRKLG\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=ETS_GPW_TEST;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Commesse/GPW_Commesse.csproj" - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=ETS /p:PublishProfile=ETS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/ETS_PROD/${env.versionNumber}/GPW_Commesse.zip /p:DeployIisAppPath=\"Default Web Site/GPW/WRKLG\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=ETS_GPW;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Commesse/GPW_Commesse.csproj" - /*echo 'Copia ETS'*/ - bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\GPW_Commesse\\ReleaseClienti\" \"E:\\Staging\\byProd\\GPW\\ETS\\COMM\" " - }, - SMART: { - sleep 1 - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=ETS /p:PublishProfile=ETS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/ETS_TEST/${env.versionNumber}/GPW_Smart.zip /p:DeployIisAppPath=\"Default Web Site/GPW_TEST/SMART\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=ETS_GPW_TEST;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Smart/GPW_Smart.csproj" - sleep 1 - bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=ETS /p:PublishProfile=ETS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/ETS_PROD/${env.versionNumber}/GPW_Smart.zip /p:DeployIisAppPath=\"Default Web Site/GPW/SMART\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=ETS_GPW;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Smart/GPW_Smart.csproj" - /*echo 'Copia ETS'*/ - bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\GPW_Smart\\ReleaseClienti\" \"E:\\Staging\\byProd\\GPW\\ETS\\SMART\" " - }, - failFast: false) - } - else{ - echo 'Questo BRANCH non necessita di installer...' - } - } + bat "e:\\fart.exe VersGen\\GPW.cs 0.0.0.0 ${env.versionNumber} || EXIT /B 0" + bat "e:\\nuget.exe restore ${WORKSPACE}\\GPW.sln" } } + // stage('Build') { + // agent any + // steps { + // parallel ( + // HOME: { + // sleep 2 + // bat "\"${tool 'MSBuild-15.0'}\" HOME\\HOME.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" + // }, + // ADMIN: { + // bat "\"${tool 'MSBuild-15.0'}\" GPW_Smart\\GPW_Smart.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" + // }, + // BARCODE: { + // sleep 1 + // bat "\"${tool 'MSBuild-15.0'}\" GPW_Barcode\\GPW_Barcode.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" + // }, + // SMART: { + // sleep 1 + // bat "\"${tool 'MSBuild-15.0'}\" GPW_Smart\\GPW_Smart.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" + // }, + // COMMESSE: { + // bat "\"${tool 'MSBuild-15.0'}\" GPW_Commesse\\GPW_Commesse.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" + // }, + // failFast: false) + // } + // } + // stage('Test') { + // steps { + // echo 'Testing.. 2 be done...' + // } + // } + // stage('Deploy') { + // agent any + // steps { + // script { + // if (env.BRANCH_NAME == "master") { + // /* CAMBIO numero versione in file sorgente!!! */ + // bat "e:\\fart.exe VersGen\\GPW.cs 0.0.0.0 ${env.versionNumber} || EXIT /B 0" + // parallel ( + // ADMIN: { + // if(env.enableIIS02 == "Y") + // { + // sleep 1 + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS02.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ GPW_Admin/GPW_Admin.csproj" + // } + // sleep 1 + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS01.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS01 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ GPW_Admin/GPW_Admin.csproj" + // }, + // BCODE: { + // sleep 3 + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS01.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS01 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ GPW_Barcode/GPW_Barcode.csproj" + // if(env.enableIIS02 == "Y") + // { + // sleep 1 + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS02.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ GPW_Barcode/GPW_Barcode.csproj" + // } + // }, + // COMM: { + // if(env.enableIIS02 == "Y") + // { + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS02.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ GPW_Commesse/GPW_Commesse.csproj" + // } + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS01.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS01 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ GPW_Commesse/GPW_Commesse.csproj" + // }, + // HOME: { + // sleep 4 + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS01.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS01 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ HOME/HOME.csproj" + // if(env.enableIIS02 == "Y") + // { + // sleep 1 + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS02.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ HOME/HOME.csproj" + // } + // }, + // SMART: { + // sleep 2 + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS01.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS01 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ GPW_Smart/GPW_Smart.csproj" + // if(env.enableIIS02 == "Y") + // { + // sleep 1 + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS02.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ GPW_Smart/GPW_Smart.csproj" + // } + // }, + // failFast: false) + // } + // else { + // echo 'Nothing to deploy...' + // } + // } + // } + // } + // stage('Installers') { + // agent any + // steps { + // script { + // /* compilo installers in base al BRANCH del cliente... */ + // if (env.BRANCH_NAME == "SPS") { + // /* CAMBIO numero versione in file sorgente!!! */ + // bat "e:\\fart.exe VersGen\\GPW.cs 0.0.0.0 ${env.versionNumber} || EXIT /B 0" + // parallel ( + // HOME: { + // sleep 4 + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/SPS_TEST/${env.versionNumber}/HOME.zip /p:DeployIisAppPath=\"Default Web Site/GPW_TEST/HOME\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ HOME/HOME.csproj" + // sleep 1 + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/SPS_PROD/${env.versionNumber}/HOME.zip /p:DeployIisAppPath=\"Default Web Site/GPW/HOME\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ HOME/HOME.csproj" + // /*echo 'Copia SPS'*/ + // bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\HOME\\ReleaseClienti\" \"E:\\Staging\\byProd\\GPW\\SPS\\HOME\" " + // }, + // ADMIN: { + // sleep 2 + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/SPS_TEST/${env.versionNumber}/GPW_Admin.zip /p:DeployIisAppPath=\"Default Web Site/GPW_TEST/ADMIN\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=SPS_GPW_TEST;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Admin/GPW_Admin.csproj" + // sleep 1 + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/SPS_PROD/${env.versionNumber}/GPW_Admin.zip /p:DeployIisAppPath=\"Default Web Site/GPW/ADMIN\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=SPS_GPW;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Admin/GPW_Admin.csproj" + // /*echo 'Copia SPS'*/ + // bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\GPW_Admin\\ReleaseClienti\" \"E:\\Staging\\byProd\\GPW\\SPS\\ADMIN\" " + // }, + // BCODE: { + // sleep 3 + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/SPS_TEST/${env.versionNumber}/GPW_Barcode.zip /p:DeployIisAppPath=\"Default Web Site/GPW_TEST/BCODE\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=SPS_GPW_TEST;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Barcode/GPW_Barcode.csproj" + // sleep 1 + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/SPS_PROD/${env.versionNumber}/GPW_Barcode.zip /p:DeployIisAppPath=\"Default Web Site/GPW/BCODE\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=SPS_GPW;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Barcode/GPW_Barcode.csproj" + // /*echo 'Copia SPS'*/ + // bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\GPW_Barcode\\ReleaseClienti\" \"E:\\Staging\\byProd\\GPW\\SPS\\BCODE\" " + // }, + // COMM: { + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/SPS_TEST/${env.versionNumber}/GPW_Commesse.zip /p:DeployIisAppPath=\"Default Web Site/GPW_TEST/WRKLG\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=SPS_GPW_TEST;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Commesse/GPW_Commesse.csproj" + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/SPS_PROD/${env.versionNumber}/GPW_Commesse.zip /p:DeployIisAppPath=\"Default Web Site/GPW/WRKLG\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=SPS_GPW;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Commesse/GPW_Commesse.csproj" + // /*echo 'Copia SPS'*/ + // bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\GPW_Commesse\\ReleaseClienti\" \"E:\\Staging\\byProd\\GPW\\SPS\\COMM\" " + // }, + // SMART: { + // sleep 1 + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/SPS_TEST/${env.versionNumber}/GPW_Smart.zip /p:DeployIisAppPath=\"Default Web Site/GPW_TEST/SMART\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=SPS_GPW_TEST;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Smart/GPW_Smart.csproj" + // sleep 1 + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/SPS_PROD/${env.versionNumber}/GPW_Smart.zip /p:DeployIisAppPath=\"Default Web Site/GPW/SMART\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=SPS_GPW;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Smart/GPW_Smart.csproj" + // /*echo 'Copia SPS'*/ + // bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\GPW_Smart\\ReleaseClienti\" \"E:\\Staging\\byProd\\GPW\\SPS\\SMART\" " + // }, + // failFast: false) + // } + // else if (env.BRANCH_NAME == "ETS") { + // /* CAMBIO numero versione in file sorgente!!! */ + // bat "e:\\fart.exe VersGen\\GPW.cs 0.0.0.0 ${env.versionNumber} || EXIT /B 0" + // parallel ( + // HOME: { + // sleep 4 + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=ETS /p:PublishProfile=ETS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/ETS_TEST/${env.versionNumber}/HOME.zip /p:DeployIisAppPath=\"Default Web Site/GPW_TEST/HOME\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ HOME/HOME.csproj" + // sleep 4 + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=ETS /p:PublishProfile=ETS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/ETS_PROD/${env.versionNumber}/HOME.zip /p:DeployIisAppPath=\"Default Web Site/GPW/HOME\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ HOME/HOME.csproj" + // /*echo 'Copia ETS'*/ + // bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\HOME\\ReleaseClienti\" \"E:\\Staging\\byProd\\GPW\\ETS\\HOME\" " + // }, + // ADMIN: { + // sleep 2 + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=ETS /p:PublishProfile=ETS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/ETS_TEST/${env.versionNumber}/GPW_Admin.zip /p:DeployIisAppPath=\"Default Web Site/GPW_TEST/ADMIN\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=ETS_GPW_TEST;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Admin/GPW_Admin.csproj" + // sleep 2 + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=ETS /p:PublishProfile=ETS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/ETS_PROD/${env.versionNumber}/GPW_Admin.zip /p:DeployIisAppPath=\"Default Web Site/GPW/ADMIN\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=ETS_GPW;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Admin/GPW_Admin.csproj" + // /*echo 'Copia ETS'*/ + // bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\GPW_Admin\\ReleaseClienti\" \"E:\\Staging\\byProd\\GPW\\ETS\\ADMIN\" " + // }, + // BCODE: { + // sleep 3 + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=ETS /p:PublishProfile=ETS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/ETS_TEST/${env.versionNumber}/GPW_Barcode.zip /p:DeployIisAppPath=\"Default Web Site/GPW_TEST/BCODE\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=ETS_GPW_TEST;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Barcode/GPW_Barcode.csproj" + // sleep 3 + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=ETS /p:PublishProfile=ETS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/ETS_PROD/${env.versionNumber}/GPW_Barcode.zip /p:DeployIisAppPath=\"Default Web Site/GPW/BCODE\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=ETS_GPW;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Barcode/GPW_Barcode.csproj" + // /*echo 'Copia ETS'*/ + // bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\GPW_Barcode\\ReleaseClienti\" \"E:\\Staging\\byProd\\GPW\\ETS\\BCODE\" " + // }, + // COMM: { + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=ETS /p:PublishProfile=ETS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/ETS_TEST/${env.versionNumber}/GPW_Commesse.zip /p:DeployIisAppPath=\"Default Web Site/GPW_TEST/WRKLG\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=ETS_GPW_TEST;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Commesse/GPW_Commesse.csproj" + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=ETS /p:PublishProfile=ETS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/ETS_PROD/${env.versionNumber}/GPW_Commesse.zip /p:DeployIisAppPath=\"Default Web Site/GPW/WRKLG\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=ETS_GPW;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Commesse/GPW_Commesse.csproj" + // /*echo 'Copia ETS'*/ + // bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\GPW_Commesse\\ReleaseClienti\" \"E:\\Staging\\byProd\\GPW\\ETS\\COMM\" " + // }, + // SMART: { + // sleep 1 + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=ETS /p:PublishProfile=ETS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/ETS_TEST/${env.versionNumber}/GPW_Smart.zip /p:DeployIisAppPath=\"Default Web Site/GPW_TEST/SMART\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=ETS_GPW_TEST;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Smart/GPW_Smart.csproj" + // sleep 1 + // bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=ETS /p:PublishProfile=ETS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/ETS_PROD/${env.versionNumber}/GPW_Smart.zip /p:DeployIisAppPath=\"Default Web Site/GPW/SMART\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ /p:TargetConnectionString=\"Data Source=W2012FS\\SQLEXPRESS;Initial Catalog=ETS_GPW;Persist Security Info=True;User ID=sa;Password=steamware\" GPW_Smart/GPW_Smart.csproj" + // /*echo 'Copia ETS'*/ + // bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\GPW_Smart\\ReleaseClienti\" \"E:\\Staging\\byProd\\GPW\\ETS\\SMART\" " + // }, + // failFast: false) + // } + // else{ + // echo 'Questo BRANCH non necessita di installer...' + // } + // } + // } + // } /*stage('Archive') { steps { echo 'Archiviazione build Release' @@ -231,17 +231,72 @@ pipeline { }*/ } post { - success { - mail to:"samuele@steamware.net", subject:"SUCCESS: ${currentBuild.fullDisplayName}", body: "Build passed." - } - failure { - mail to:"samuele@steamware.net", subject:"FAILURE: ${currentBuild.fullDisplayName}", body: "Build failed." - } - unstable { - mail to:"samuele@steamware.net", subject:"UNSTABLE: ${currentBuild.fullDisplayName}", body: "Build is unstable." - } - /*changed { - mail to:"samuele@steamware.net", subject:"CHANGED: ${currentBuild.fullDisplayName}", body: "Build status changed." - }*/ + success { + sendSlack("Successful", "good") + } + failure { + sendSlack("Failed", "danger") + } + unstable { + sendSlack("Unstable", "warning") + } } -} \ No newline at end of file +} + + +// Funzione x pubblicazione su server IIS di deploy +def publishToDeployServer(prjPath, iisPath, packName) { + echo "Richiesto esecuzione publishToDeployServer con parametri: " + prjPath + " | " + iisPath + " | " + packName + // inizio copiando files di base da area VersGen... + bat "xcopy /y VersGen\\ChangeLog.html " + prjPath + "Resources\\ChangeLog.html " + bat "xcopy /y VersGen\\logoSteamware.png " + prjPath + "Resources\\logoSteamware.png " + bat "xcopy /y VersGen\\manifest.xml " + prjPath + "Resources\\manifest.xml " + // manifest.xml: aggiorno versNumber ed URL del branch di update... + bat "e:\\fart.exe " + prjPath + "Resources\\manifest.xml 0.0.0.0 ${env.versionNumber} || EXIT /B 0" + bat "e:\\fart.exe " + prjPath + "Resources\\manifest.xml {{BRANCHNAME}} ${env.BRANCH_NAME} || EXIT /B 0" + bat "e:\\fart.exe " + prjPath + "Resources\\manifest.xml {{PACKNAME}} " + packName + " || EXIT /B 0" + bat "e:\\fart.exe " + prjPath + "Resources\\ChangeLog.html {{CURRENT-REL}} ${env.versionNumber} || EXIT /B 0" + writeFile file: prjPath + 'changeLog.log', text: "${getChangeString()}" + powershell '(Get-Content ' + prjPath + 'Resources\\ChangeLog.html) | ForEach-Object { $_ -replace \"{{LAST-CHANGES}}\", \"${getChangeString()}\" } | Set-Content ' + prjPath + 'Resources\\ChangeLog.html' + // copio ed esporto in IIS02 i vari files .xml, .html, .zip + bat "xcopy /y " + prjPath + "Resources\\manifest.xml " + iisPath + packName + "\\${env.BRANCH_NAME}\\ " + bat "xcopy /y " + prjPath + "Resources\\ChangeLog.html " + iisPath + packName + "\\${env.BRANCH_NAME}\\ " + bat "xcopy /y " + prjPath + "Resources\\logoSteamware.png " + iisPath + packName + "\\${env.BRANCH_NAME}\\ " + // salvo copia della versione... + bat "xcopy /y " + prjPath + "\\ReleaseClienti\\${env.BRANCH_NAME}\\* E:\\Staging\\byProd\\MP\\${env.BRANCH_NAME}\\" + packName + "\\${env.versionNumber}\\ " + // copio x AutoUpdate deploy + bat "xcopy /y " + prjPath + "\\ReleaseClienti\\${env.BRANCH_NAME}\\" + packName + ".zip " + iisPath + packName + "\\${env.BRANCH_NAME}\\ " +} +@NonCPS +// Funzione x recupero changeLog +def getChangeString() { + MAX_MSG_LEN = 100 + def changeString = "" + + echo "Gathering SCM changes" + def changeLogSets = currentBuild.changeSets + for (int i = 0; i < changeLogSets.size(); i++) { + def entries = changeLogSets[i].items + for (int j = 0; j < entries.length; j++) { + def entry = entries[j] + truncated_msg = entry.msg.take(MAX_MSG_LEN) + changeString += " - ${truncated_msg} [${entry.author}]\n" + } + } + + if (!changeString) { + changeString = " - Nessuna Modifica" + } + return changeString +} + +// Funzione x invio slack +def sendSlack(status, colorCode) { + slackSend ( + color: colorCode, + channel: "#GPW-dev", + failOnError: false, + message: "${env.JOB_NAME} ${env.versionNumber} | " + status + ": Build ${env.BUILD_NUMBER}\n\n" + + "Modifiche:\n " + getChangeString() + "\n\n Verifica build: <${env.BUILD_URL}|Apri>" + "\n" + ) +} diff --git a/VersGen/GPW.cs b/VersGen/GPW.cs index db6562f..4490af0 100644 --- a/VersGen/GPW.cs +++ b/VersGen/GPW.cs @@ -5,7 +5,7 @@ using System.Reflection; -[assembly: AssemblyVersion("2.4.999.0")] -[assembly: AssemblyFileVersion("2.4.999.0")] -[assembly: AssemblyCopyright("Steamware © 2007-2017")] -[assembly: AssemblyCompany("Steamware")] +[assembly: AssemblyVersion("0.0.0.0")] +[assembly: AssemblyFileVersion("0.0.0.0")] +[assembly: AssemblyCopyright("Steamware © 2007-2019")] +[assembly: AssemblyCompany("Steamware")] \ No newline at end of file diff --git a/VersGen/GPW.tt b/VersGen/GPW.tt index 7c59783..911b291 100644 --- a/VersGen/GPW.tt +++ b/VersGen/GPW.tt @@ -6,11 +6,7 @@ using System.Reflection; -[assembly: AssemblyVersion("2.4.999.<#= this.RevisionNumber #>")] -[assembly: AssemblyFileVersion("2.4.999.<#= this.RevisionNumber #>")] +[assembly: AssemblyVersion("0.0.0.0")] +[assembly: AssemblyFileVersion("0.0.0.0")] [assembly: AssemblyCopyright("Steamware © 2007-<#= DateTime.Now.Year #>")] -[assembly: AssemblyCompany("Steamware")] -<#+ -// Major.Minor.Build.RevisionNumber - int RevisionNumber = 0; //(int)(DateTime.UtcNow - new DateTime(2006,1,1)).TotalDays; -#> \ No newline at end of file +[assembly: AssemblyCompany("Steamware")] \ No newline at end of file