pipeline { agent any stages { stage('Checkout') { steps { /* build delle SteamWare libs! */ /*build 'SteamWare/SteamWareLib'*/ /* copio le libs...*/ step([$class: 'CopyArtifact', fingerprintArtifacts: true, projectName: 'Steamware/SteamWareLib', selector: [$class: 'WorkspaceSelector'], target: '../Steamware/SteamWareLib']) /* provo stash */ stash includes: '*', name: 'STEAMW-STASH' /* ora il progetto vero e proprio... */ /*checkout scm*/ /*echo 'Checkout Git'*/ script { withEnv(['NEXT_BUILD_NUMBER=4027']) { env.versionNumber = VersionNumber(versionNumberString : '${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, versionPrefix: '2.4.') /*env.versionNumber = VersionNumber(versionNumberString : '${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, versionPrefix: '2.4.', overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')*/ } } echo "${env.BUILD_ID}" echo "${env.versionNumber}" } } stage('Build') { steps { parallel ( HOME: { echo 'Build HOME Release' bat "\"${tool 'MSBuild-14.0'}\" HOME\\HOME.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:ProductVersion=${env.versionNumber} /p:OutputPath=bin/ /m" }, ADMIN: { sleep 0 echo 'Build ADMIN Release' bat "\"${tool 'MSBuild-14.0'}\" GPW_Admin\\GPW_Admin.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:ProductVersion=${env.versionNumber} /p:OutputPath=bin/ /m" }, BARCODE: { sleep 1 echo 'Build BARCODE Release' bat "\"${tool 'MSBuild-14.0'}\" GPW_Barcode\\GPW_Barcode.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:ProductVersion=${env.versionNumber} /p:OutputPath=bin/ /m" }, SMART: { sleep 2 echo 'Build SMART Release' bat "\"${tool 'MSBuild-14.0'}\" GPW_Smart\\GPW_Smart.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:ProductVersion=${env.versionNumber} /p:OutputPath=bin/ /m" }, COMMESSE: { sleep 3 echo 'Build COMMESSE Release' bat "\"${tool 'MSBuild-14.0'}\" GPW_Commesse\\GPW_Commesse.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:ProductVersion=${env.versionNumber} /p:OutputPath=bin/ /m" }, failFast: false) } } stage('Test') { steps { echo 'Testing.. 2 be done...' } } stage('Deploy') { steps { parallel ( ADMIN: { /*IIS 01*/ dir("STEAMW-STASH") { unstash "STEAMW-STASH" } bat "\"${tool 'MSBuild-14.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:ProductVersion=${env.versionNumber} /p:OutputPath=bin/ GPW_Admin/GPW_Admin.csproj" /*IIS 02*/ dir("STEAMW-STASH") { unstash "STEAMW-STASH" } bat "\"${tool 'MSBuild-14.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:ProductVersion=${env.versionNumber} /p:OutputPath=bin/ GPW_Admin/GPW_Admin.csproj" }, BCODE: { /* IIS 01 */ dir("STEAMW-STASH") { unstash "STEAMW-STASH" } bat "\"${tool 'MSBuild-14.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:ProductVersion=${env.versionNumber} /p:OutputPath=bin/ GPW_Barcode/GPW_Barcode.csproj" /* IIS02 */ dir("STEAMW-STASH") { unstash "STEAMW-STASH" } bat "\"${tool 'MSBuild-14.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:ProductVersion=${env.versionNumber} /p:OutputPath=bin/ GPW_Barcode/GPW_Barcode.csproj" }, COMM: { /* IIS01 */ dir("STEAMW-STASH") { unstash "STEAMW-STASH" } bat "\"${tool 'MSBuild-14.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:ProductVersion=${env.versionNumber} /p:OutputPath=bin/ GPW_Commesse/GPW_Commesse.csproj" /* IIS02 */ dir("STEAMW-STASH") { unstash "STEAMW-STASH" } bat "\"${tool 'MSBuild-14.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:ProductVersion=${env.versionNumber} /p:OutputPath=bin/ GPW_Commesse/GPW_Commesse.csproj" }, HOME: { /* IIS01 */ dir("STEAMW-STASH") { unstash "STEAMW-STASH" } bat "\"${tool 'MSBuild-14.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:ProductVersion=${env.versionNumber} /p:OutputPath=bin/ HOME/HOME.csproj" /* IIS02 */ dir("STEAMW-STASH") { unstash "STEAMW-STASH" } bat "\"${tool 'MSBuild-14.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:ProductVersion=${env.versionNumber} /p:OutputPath=bin/ HOME/HOME.csproj" }, SMART: { /* IIS01 */ dir("STEAMW-STASH") { unstash "STEAMW-STASH" } bat "\"${tool 'MSBuild-14.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:ProductVersion=${env.versionNumber} /p:OutputPath=bin/ GPW_Smart/GPW_Smart.csproj" /* IIS02 */ dir("STEAMW-STASH") { unstash "STEAMW-STASH" } bat "\"${tool 'MSBuild-14.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:ProductVersion=${env.versionNumber} /p:OutputPath=bin/ GPW_Smart/GPW_Smart.csproj" }, failFast: false) } } /*stage('Deploy Installers') { steps { parallel ( Cli_01: { echo 'Creazione zip 01...' sleep 1 echo 'Copia...' bat "E:\\Jenkins\\exportDropbox.bat TestSam\\Test\\pipeline_test\\lastSuccessfulBuild\\archive\\ScratchTest\\ScratchTest\\bin\\Release TestSam\\CLI_01 Build_${env.versionNumber}" }, Cli_02: { echo 'Creazione zip 02...' sleep 1 echo 'Copia...' bat "E:\\Jenkins\\exportDropbox.bat TestSam\\Test\\pipeline_test\\lastSuccessfulBuild\\archive\\ScratchTest\\ScratchTest\\bin\\Release TestSam\\CLI_02 Build_${env.versionNumber}" }, failFast: false) } }*/ /*stage('Archive') { steps { echo 'Archiviazione build Release' archiveArtifacts artifacts: 'ScratchTest/ScratchTest/bin/Release/**' } }*/ } /*post { always { echo 'I will always say Hello again!' } }*/ }