From dd4dda6ab6c5e6af915e8a283e4ef730c48fd2c8 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Wed, 28 Aug 2019 17:40:59 +0200 Subject: [PATCH] Aggiunto stage build... --- Jenkinsfile | 67 ++++++++++++++++++++++------------------------------- 1 file changed, 28 insertions(+), 39 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b8c2909..3cdf4d3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -37,42 +37,31 @@ pipeline { bat "e:\\nuget.exe restore ${WORKSPACE}\\NKC_WF.sln" } } - // stage('Build') { - // agent any - // steps { - // script { - // properties([buildDiscarder(logRotator(artifactDaysToKeepStr: '180', artifactNumToKeepStr: '30', daysToKeepStr: '360', numToKeepStr: '30')), pipelineTriggers([])]) - // // CAMBIO numero versione + checkout NuGet in file sorgente!!! - // bat "fart.exe VersGen\\VersGen.cs 0.0.0.0 ${env.versionNumber} || EXIT /B 0" - // bat "e:\\nuget.exe restore ${WORKSPACE}\\NKC_WF.sln" - // } - // script { - // /* compilo installers in base al BRANCH del cliente... */ - // if (env.BRANCH_NAME == "develop") { - // parallel ( - // ADM_IO: { - // sleep 2 - // bat "\"${tool 'MSBuild-15.0'}\" MP-ADM/MP-ADM.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" - // bat "\"${tool 'MSBuild-15.0'}\" MP-IO/MP-IO.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" - // }, - // LAND_MON: { - // sleep 4 - // bat "\"${tool 'MSBuild-15.0'}\" MP-LAND/MP-LAND.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" - // bat "\"${tool 'MSBuild-15.0'}\" MP-MON/MP-MON.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" - // }, - // SITE_TAB: { - // sleep 0 - // bat "\"${tool 'MSBuild-15.0'}\" MP-SITE/MP-SITE.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" - // bat "\"${tool 'MSBuild-15.0'}\" MP-TAB/MP-TAB.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" - // }, - // failFast: false) - // } - // else { - // echo 'Niente x Build (limitata a develop)...' - // } - // } - // } - // } + stage('Build') { + agent any + steps { + script { + properties([buildDiscarder(logRotator(artifactDaysToKeepStr: '180', artifactNumToKeepStr: '30', daysToKeepStr: '360', numToKeepStr: '30')), pipelineTriggers([])]) + // CAMBIO numero versione + checkout NuGet in file sorgente!!! + bat "fart.exe VersGen\\VersGen.cs 0.0.0.0 ${env.versionNumber} || EXIT /B 0" + bat "e:\\nuget.exe restore ${WORKSPACE}\\NKC_WF.sln" + } + script { + /* compilo installers in base al BRANCH del cliente... */ + if (env.BRANCH_NAME == "develop") { + parallel ( + NKC_SITE: { + sleep 0 + bat "\"${tool 'MSBuild-15.0'}\" NKC_WF/NKC_WF.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" + }, + failFast: false) + } + else { + echo 'Niente x Build (limitata a develop)...' + } + } + } + } // stage('Deploy') { // agent any // steps { @@ -124,14 +113,14 @@ pipeline { // if(env.enableIIS01 == "Y") // { // // SITE - // 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/ MP-SITE/MP-SITE.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=IIS01 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ NKC_WF/NKC_WF.csproj" // // TAB // 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/ MP-TAB/MP-TAB.csproj" // } // if(env.enableIIS02 == "Y") // { // // SITE - // 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/ MP-SITE/MP-SITE.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=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ NKC_WF/NKC_WF.csproj" // // TAB // 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/ MP-TAB/MP-TAB.csproj" // } @@ -189,7 +178,7 @@ pipeline { // SITE_TAB: { // sleep 0 // // SITE - // 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=Prod /p:PublishProfile=${env.BRANCH_NAME}.pubxml /p:VisualStudioVersion=14.0 /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/${env.BRANCH_NAME}/SITE.zip /p:DeployIisAppPath=\"Default Web Site/MP/SITE\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ MP-SITE/MP-SITE.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=Prod /p:PublishProfile=${env.BRANCH_NAME}.pubxml /p:VisualStudioVersion=14.0 /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/${env.BRANCH_NAME}/SITE.zip /p:DeployIisAppPath=\"Default Web Site/MP/SITE\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ NKC_WF/NKC_WF.csproj" // // pubblico su server deploy! // publishToDeployServer("MP-SITE\\", "c:\\inetpub\\wwwroot\\SWS\\MAPO\\", "SITE") // // TAB