From 9509a4e938a4fc5727baf2ef800ea9d5238aecc6 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 19 Mar 2018 15:29:15 +0100 Subject: [PATCH] Aggiunto deploy su IIS01/02 --- Jenkinsfile | 52 +++++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2433c29..78f6701 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,7 +9,7 @@ pipeline { steps { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=217']) { + withEnv(['NEXT_BUILD_NUMBER=218']) { // env.versionNumber = VersionNumber(versionNumberString : '1.7.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '1.7.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'CMS-SC' @@ -59,30 +59,32 @@ pipeline { echo 'Testing.. 2 be done...' } } - // stage('Deploy') { - // agent any - // steps { - // script { - // /* DEPLOY condizionale: develop / master */ - // if (env.BRANCH_NAME == "master") { - // /* CAMBIO numero versione in file sorgente!!! */ - // bat "e:\\fart.exe ${WORKSPACE}\\VersGen\\VersGen.cs 1.0.0.0 ${env.versionNumber} || EXIT /B 0" - // bat "e:\\nuget.exe restore ${WORKSPACE}\\XPS_app.sln" - // parallel ( - // IIS01: { - // 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:VisualStudioVersion=14.0 /p:RunCodeAnalysis=false /p:Configuration=IIS01 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ XPS/CMS_SC.csproj" - // }, - // IIS02: { - // 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:VisualStudioVersion=14.0 /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ XPS/CMS_SC.csproj" - // }, - // failFast: false) - // } - // else { - // echo 'Nothing to deploy...' - // } - // } - // } - // } + stage('Deploy') { + agent any + steps { + script { + /* DEPLOY condizionale: develop / master */ + if (env.BRANCH_NAME == "master") { + /* CAMBIO numero versione in file sorgente!!! */ + bat "e:\\fart.exe ${WORKSPACE}\\VersGen\\VersGen.cs 1.0.0.0 ${env.versionNumber} || EXIT /B 0" + bat "e:\\nuget.exe restore ${WORKSPACE}\\XPS_app.sln" + parallel ( + IIS01: { + 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:VisualStudioVersion=14.0 /p:RunCodeAnalysis=false /p:Configuration=Release /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ XPS/XPS.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:VisualStudioVersion=14.0 /p:RunCodeAnalysis=false /p:Configuration=Release /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ XPST/XPST.csproj" + }, + IIS02: { + 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:VisualStudioVersion=14.0 /p:RunCodeAnalysis=false /p:Configuration=Release /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ XPS/XPS.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=IIS02.pubxml /p:VisualStudioVersion=14.0 /p:RunCodeAnalysis=false /p:Configuration=Release /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ XPST/XPST.csproj" + }, + failFast: false) + } + else { + echo 'Nothing to deploy...' + } + } + } + } // stage('Installers') { // agent any // steps {