From 92395261e6ccdfca54de9d6986de0c2651d228dc Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Fri, 21 Sep 2018 21:33:02 +0200 Subject: [PATCH] aggiunta task build in Jenkinsfile... --- Jenkinsfile | 72 ++++++++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2a64713..24d97ad 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,9 +17,9 @@ pipeline { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=51']) { - // env.versionNumber = VersionNumber(versionNumberString : '1.1.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) - env.versionNumber = VersionNumber(versionNumberString : '1.1.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') + withEnv(['NEXT_BUILD_NUMBER=52']) { + // env.versionNumber = VersionNumber(versionNumberString : '1.1.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2018-01-01', skipFailedBuilds: true) + env.versionNumber = VersionNumber(versionNumberString : '1.1.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2018-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'C.TRACK' } } @@ -37,42 +37,42 @@ pipeline { bat "e:\\nuget.exe restore ${WORKSPACE}\\C-TRACK.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 "e:\\fart.exe VersGen\\VersGen.cs 1.0.0.0 ${env.versionNumber} || EXIT /B 0" - // bat "e:\\nuget.exe restore ${WORKSPACE}\\B2BCONDOMINI.sln" - // } - // script { - // /* compilo installers in base al BRANCH del cliente... */ - // if (env.BRANCH_NAME == "develop") { - // parallel ( - // ADM: { - // sleep 5 - // bat "\"${tool 'MSBuild-15.0'}\" ADM/ADM.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" - // }, - // PUB: { - // sleep 0 - // bat "\"${tool 'MSBuild-15.0'}\" PUB/PUB.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 "e:\\fart.exe VersGen\\VersGen.cs 1.0.0.0 ${env.versionNumber} || EXIT /B 0" + bat "e:\\nuget.exe restore ${WORKSPACE}\\C-TRACK.sln" + } + script { + /* compilo installers in base al BRANCH del cliente... */ + if (env.BRANCH_NAME == "develop") { + parallel ( + // ADM: { + // sleep 5 + // bat "\"${tool 'MSBuild-15.0'}\" ADM/ADM.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" + // }, + PUB: { + sleep 0 + bat "\"${tool 'MSBuild-15.0'}\" C-TRACK/C-TRACK.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 { // script { // // CAMBIO numero versione + checkout NuGet in file sorgente!!! // bat "e:\\fart.exe VersGen\\VersGen.cs 1.0.0.0 ${env.versionNumber} || EXIT /B 0" - // bat "e:\\nuget.exe restore ${WORKSPACE}\\B2BCONDOMINI.sln" + // bat "e:\\nuget.exe restore ${WORKSPACE}\\C-TRACK.sln" // } // script { // /* DEPLOY condizionale: develop / master / demo_ovh */ @@ -82,14 +82,14 @@ pipeline { // if(env.enableIIS01 == "Y") // { // sleep 0 - // 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=15.0 /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ PUB/PUB.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=15.0 /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ C-TRACK/C-TRACK.csproj" // } // }, // PUB_IIS02: { // if(env.enableIIS02 == "Y") // { // sleep 0 - // 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=15.0 /p:RunCodeAnalysis=false /p:Configuration=IIS01 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ PUB/PUB.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=15.0 /p:RunCodeAnalysis=false /p:Configuration=IIS01 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ C-TRACK/C-TRACK.csproj" // } // }, // failFast: false) @@ -98,7 +98,7 @@ pipeline { // parallel ( // PUB_PROD: { // sleep 0 - // 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=OVH-prod.pubxml /p:VisualStudioVersion=15.0 /p:RunCodeAnalysis=false /p:Configuration=OVH /p:username=WPROD01\\Steamware /p:Password=viaD@nte16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ PUB/PUB.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=OVH-prod.pubxml /p:VisualStudioVersion=15.0 /p:RunCodeAnalysis=false /p:Configuration=OVH /p:username=WPROD01\\Steamware /p:Password=viaD@nte16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ C-TRACK/C-TRACK.csproj" // }, // failFast: false) // }