aggiunta task build in Jenkinsfile...

This commit is contained in:
Samuele E. Locatelli
2018-09-21 21:33:02 +02:00
parent bd389a4d5e
commit 92395261e6
Vendored
+36 -36
View File
@@ -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)
// }