diff --git a/Jenkinsfile b/Jenkinsfile index 615b6ed3..7a62cf17 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,6 +5,7 @@ pipeline { EMAIL_RECIPIENTS = 'samuele@steamware.net' enableIIS01 = 'Y' enableIIS02 = 'Y' + singleProj = ['ADM','IO','LAND','MAG','MON','SITE','TAB'] } stages { stage('Checkout') { @@ -59,9 +60,17 @@ pipeline { bat "\"${tool 'MSBuild-16.0'}\" /p:m=8 MP-LAND/MP-LAND.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" bat "\"${tool 'MSBuild-16.0'}\" /p:m=8 MP-MON/MP-MON.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" bat "\"${tool 'MSBuild-16.0'}\" /p:m=8 MP-TAB/MP-TAB.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" + bat "\"${tool 'MSBuild-16.0'}\" /p:m=8 MP-MAG/MP-MAG.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" }, failFast: false) - } + } + else if (env.singleProj.contains(env.BRANCH_NAME) { + parallel ( + ALL: { + bat "\"${tool 'MSBuild-16.0'}\" /p:m=8 MP-${env.BRANCH_NAME}/MP-${env.BRANCH_NAME}.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" + }, + failFast: false) + } else { echo 'Niente x Build (limitata a develop)...' } @@ -104,11 +113,13 @@ pipeline { bat "\"${tool 'MSBuild-16.0'}\" \"/p:m=8 /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:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ MP-MON/MP-MON.csproj" // TAB bat "\"${tool 'MSBuild-16.0'}\" \"/p:m=8 /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:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ MP-TAB/MP-TAB.csproj" + // MAG + bat "\"${tool 'MSBuild-16.0'}\" \"/p:m=8 /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:RunCodeAnalysis=false /p:Configuration=Release /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ MP-MAG/MP-MAG.csproj" } }, failFast: false) } - if (env.BRANCH_NAME == "beta") { + else if (env.BRANCH_NAME == "beta") { parallel ( ALL: { sleep 2 @@ -132,6 +143,8 @@ pipeline { bat "\"${tool 'MSBuild-16.0'}\" \"/p:m=8 /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:RunCodeAnalysis=false /p:Configuration=IIS01 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ MP-MON/MP-MON.csproj" // TAB bat "\"${tool 'MSBuild-16.0'}\" \"/p:m=8 /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:RunCodeAnalysis=false /p:Configuration=IIS01 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ MP-TAB/MP-TAB.csproj" + // MAG + bat "\"${tool 'MSBuild-16.0'}\" \"/p:m=8 /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:RunCodeAnalysis=false /p:Configuration=Release /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ MP-MAG/MP-MAG.csproj" } }, failFast: false) @@ -152,6 +165,13 @@ pipeline { bat "e:\\nuget setapikey fe387daa-d07c-3207-877e-96c8be1be91b -source http://nexus.steamware.net/repository/nuget-hosted" bat "e:\\nuget.exe push MapoSDK.${env.packVers}.nupkg -Source http://nexus.steamware.net/repository/nuget-hosted" } + // else if (env.singleProj.contains(env.BRANCH_NAME) { + // parallel ( + // ALL: { + // bat "\"${tool 'MSBuild-16.0'}\" \"/p:m=8 /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:RunCodeAnalysis=false /p:Configuration=Release /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ MP-${env.BRANCH_NAME}/MP-${env.BRANCH_NAME}.csproj" + // }, + // failFast: false) + // } else { echo 'Nothing to deploy...' } @@ -180,28 +200,38 @@ pipeline { bat "\"${tool 'MSBuild-16.0'}\" \"/p:m=8 /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:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/${env.BRANCH_NAME}/ADM.zip /p:DeployIisAppPath=\"Default Web Site/MP/ADM\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ MP-ADM/MP-ADM.csproj" // pubblico su server deploy! publishToDeployServer("MP-ADM\\", "c:\\inetpub\\wwwroot\\SWS\\MAPO\\", "ADM") + // IO bat "\"${tool 'MSBuild-16.0'}\" \"/p:m=8 /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:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/${env.BRANCH_NAME}/IO.zip /p:DeployIisAppPath=\"Default Web Site/MP/IO\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ MP-IO/MP-IO.csproj" // pubblico su server deploy! publishToDeployServer("MP-IO\\", "c:\\inetpub\\wwwroot\\SWS\\MAPO\\", "IO") + // SITE bat "\"${tool 'MSBuild-16.0'}\" \"/p:m=8 /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: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" // pubblico su server deploy! publishToDeployServer("MP-SITE\\", "c:\\inetpub\\wwwroot\\SWS\\MAPO\\", "SITE") + // }, // LAND_MON_TAB: { // LAND bat "\"${tool 'MSBuild-16.0'}\" \"/p:m=8 /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:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/${env.BRANCH_NAME}/LAND.zip /p:DeployIisAppPath=\"Default Web Site/MP/LAND\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ MP-LAND/MP-LAND.csproj" // pubblico su server deploy! publishToDeployServer("MP-LAND\\", "c:\\inetpub\\wwwroot\\SWS\\MAPO\\", "LAND") + // MON bat "\"${tool 'MSBuild-16.0'}\" \"/p:m=8 /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:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/${env.BRANCH_NAME}/MON.zip /p:DeployIisAppPath=\"Default Web Site/MP/MON\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ MP-MON/MP-MON.csproj" // pubblico su server deploy! - publishToDeployServer("MP-MON\\", "c:\\inetpub\\wwwroot\\SWS\\MAPO\\", "MON") + publishToDeployServer("MP-MON\\", "c:\\inetpub\\wwwroot\\SWS\\MAPO\\", "MON") + // TAB bat "\"${tool 'MSBuild-16.0'}\" \"/p:m=8 /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:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/${env.BRANCH_NAME}/TAB.zip /p:DeployIisAppPath=\"Default Web Site/MP/TAB\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ MP-TAB/MP-TAB.csproj" // pubblico su server deploy! publishToDeployServer("MP-TAB\\", "c:\\inetpub\\wwwroot\\SWS\\MAPO\\", "TAB") + + // MAG + bat "\"${tool 'MSBuild-16.0'}\" \"/p:m=8 /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:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/${env.BRANCH_NAME}/MAG.zip /p:DeployIisAppPath=\"Default Web Site/MP/MAG\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ MP-MAG/MP-MAG.csproj" + // pubblico su server deploy! + publishToDeployServer("MP-MAG\\", "c:\\inetpub\\wwwroot\\SWS\\MAPO\\", "MAG") }, failFast: false) } @@ -258,6 +288,12 @@ pipeline { classifier: "${env.classifier}", file: "MP-TAB\\ReleaseClienti\\${env.BRANCH_NAME}\\TAB.zip", type: 'zip' + ], + [ + artifactId: 'MP-MAG', + classifier: "${env.classifier}", + file: "MP-MAG\\ReleaseClienti\\${env.BRANCH_NAME}\\MAG.zip", + type: 'zip' ] ], credentialsId: 'bc9d8e92-4302-3266-817f-7b58501d12d5', diff --git a/gitSpread.bat b/gitSpread.bat index cfbe0b31..96c93fc9 100644 --- a/gitSpread.bat +++ b/gitSpread.bat @@ -1,10 +1,10 @@ REM Script di replica su altri rami di un branch git REM l'argomento รจ il replication level: -REM 0 = solo locale -REM 1 = locale + ramo current remoto -REM 2 = .. + develop/master remoto -REM 3 = .. + stable (install) remoto -REM 4 = locale + full remoto +REM 0 = solo locale dev/beta +REM 1 = locale i vari "dev" + dev/beta/current remoto +REM 2 = .. + dev remoto +REM 3 = .. + APP/SDK remoto +REM 4 = locale + full (master/stable) remoto ECHO off set baseBranch=%1 @@ -12,22 +12,27 @@ set pushRemote=%2 git push . %baseBranch%:beta git push . %baseBranch%:develop -git push . %baseBranch%:ES3 -git push . %baseBranch%:Giancarlo -git push . %baseBranch%:master -git push . %baseBranch%:MongoDb -git push . %baseBranch%:SDK -git push . %baseBranch%:stable REM Faccio push remoto condizionale +if %pushRemote% GTR 0 ( git push . %baseBranch%:ES3 ) +if %pushRemote% GTR 0 ( git push . %baseBranch%:Giancarlo ) +if %pushRemote% GTR 0 ( git push . %baseBranch%:MongoDb ) if %pushRemote% GTR 0 ( git push gitlab.steamware %baseBranch%:%baseBranch% ) if %pushRemote% GTR 0 ( git push gitlab.steamware %baseBranch%:beta ) -if %pushRemote% GTR 1 ( git push gitlab.steamware %baseBranch%:develop ) -if %pushRemote% GTR 1 ( git push gitlab.steamware %baseBranch%:SDK ) +if %pushRemote% GTR 0 ( git push gitlab.steamware %baseBranch%:develop ) + +if %pushRemote% GTR 1 ( git push . %baseBranch%:MAG ) +if %pushRemote% GTR 1 ( git push . %baseBranch%:SDK ) +if %pushRemote% GTR 1 ( git push gitlab.steamware %baseBranch%:ES3 ) +if %pushRemote% GTR 1 ( git push gitlab.steamware %baseBranch%:Giancarlo ) if %pushRemote% GTR 1 ( git push gitlab.steamware %baseBranch%:MongoDb ) -if %pushRemote% GTR 2 ( git push gitlab.steamware %baseBranch%:master ) -if %pushRemote% GTR 2 ( git push gitlab.steamware %baseBranch%:stable ) -if %pushRemote% GTR 2 ( git push gitlab.steamware %baseBranch%:ES3 ) -if %pushRemote% GTR 2 ( git push gitlab.steamware %baseBranch%:Giancarlo ) + +if %pushRemote% GTR 2 ( git push . %baseBranch%:master ) +if %pushRemote% GTR 2 ( git push . %baseBranch%:stable ) +if %pushRemote% GTR 2 ( git push gitlab.steamware %baseBranch%:MAG ) +if %pushRemote% GTR 2 ( git push gitlab.steamware %baseBranch%:SDK ) + +if %pushRemote% GTR 3 ( git push gitlab.steamware %baseBranch%:master ) +if %pushRemote% GTR 3 ( git push gitlab.steamware %baseBranch%:stable ) ECHO on \ No newline at end of file