Files
MoonPro.net/Jenkinsfile
T
2017-11-08 16:05:36 +01:00

287 lines
20 KiB
Groovy

pipeline {
agent none
environment {
EMAIL_RECIPIENTS = 'samuele@steamware.net'
}
stages {
stage('Checkout') {
agent any
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'])
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
withEnv(['NEXT_BUILD_NUMBER=634']) {
// env.versionNumber = VersionNumber(versionNumberString : '4.8.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
env.versionNumber = VersionNumber(versionNumberString : '4.8.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
env.APP_NAME = 'MAPO'
}
}
script {
currentBuild.displayName = "${env.versionNumber}"
if (env.BRANCH_NAME == "develop" || env.BRANCH_NAME.contains("DEMO")) {
currentBuild.description = "TEST ${env.versionNumber}"
}
else {
currentBuild.description = "BUILD ${env.versionNumber}"
}
}
/* CAMBIO numero versione in file sorgente!!! */
bat "fart.exe VersGen\\MoonPro.cs 1.0.0.0 ${env.versionNumber} || EXIT /B 0"
}
}
stage('Build') {
agent any
properties([buildDiscarder(logRotator(artifactDaysToKeepStr: '30', artifactNumToKeepStr: '30', daysToKeepStr: '30', numToKeepStr: '30')), pipelineTriggers([])])
steps {
script {
/* compilo installers in base al BRANCH del cliente... */
if (env.BRANCH_NAME == "develop") {
/* CAMBIO numero versione in file sorgente!!! */
bat "fart.exe VersGen\\MoonPro.cs 1.0.0.0 ${env.versionNumber} || EXIT /B 0"
parallel (
LANDING: {
sleep 5
bat "\"${tool 'MSBuild-14.0'}\" MP/MP.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m"
},
ADMIN: {
sleep 0
bat "\"${tool 'MSBuild-14.0'}\" MP-Admin/MP-Admin.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m"
},
IO: {
sleep 4
bat "\"${tool 'MSBuild-14.0'}\" MP-IO/MP-IO.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m"
},
MON: {
sleep 3
bat "\"${tool 'MSBuild-14.0'}\" MP-MON/MP-MON.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m"
},
SITE: {
sleep 1
bat "\"${tool 'MSBuild-14.0'}\" MP-Site/MP-Site.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m"
},
TABLET: {
sleep 2
bat "\"${tool 'MSBuild-14.0'}\" MP-Tablet/MP-Tablet.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m"
},
failFast: false)
}
else {
echo 'Nothing to Build...'
}
}
}
}
stage('Test') {
steps {
echo 'Testing.. 2 be done...'
}
}
stage('Deploy') {
agent any
steps {
script {
/* DEPLOY condizionale: develop / master / demo_ovh */
if (env.BRANCH_NAME == "master") {
/* CAMBIO numero versione in file sorgente!!! */
bat "fart.exe VersGen\\MoonPro.cs 1.0.0.0 ${env.versionNumber} || EXIT /B 0"
parallel (
LANDING: {
sleep 0
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:OutputPath=bin/ MP/MP.csproj"
sleep 1
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:OutputPath=bin/ MP/MP.csproj"
},
ADMIN: {
sleep 2
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:OutputPath=bin/ MP-Admin/MP-Admin.csproj"
sleep 3
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:OutputPath=bin/ MP-Admin/MP-Admin.csproj"
},
IO: {
sleep 4
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:OutputPath=bin/ MP-IO/MP-IO.csproj"
sleep 5
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:OutputPath=bin/ MP-IO/MP-IO.csproj"
},
MON: {
sleep 6
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:OutputPath=bin/ MP-MON/MP-MON.csproj"
sleep 7
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:OutputPath=bin/ MP-MON/MP-MON.csproj"
},
SITE: {
sleep 1
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:OutputPath=bin/ MP-Site/MP-Site.csproj"
sleep 1
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:OutputPath=bin/ MP-Site/MP-Site.csproj"
},
TABLET: {
sleep 8
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:OutputPath=bin/ MP-Tablet/MP-Tablet.csproj"
sleep 9
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:OutputPath=bin/ MP-Tablet/MP-Tablet.csproj"
},
failFast: false)
}
if (env.BRANCH_NAME == "OVH-DEMO") {
/* CAMBIO numero versione in file sorgente!!! */
bat "fart.exe VersGen\\MoonPro.cs 1.0.0.0 ${env.versionNumber} || EXIT /B 0"
parallel (
// LANDING: {
// sleep 5
// 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:OutputPath=bin/ MP/MP.csproj"
// },
// ADMIN: {
// sleep 0
// 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:OutputPath=bin/ MP-Admin/MP-Admin.csproj"
// },
// IO: {
// sleep 4
// 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:OutputPath=bin/ MP-IO/MP-IO.csproj"
// },
// MON: {
// sleep 3
// 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:OutputPath=bin/ MP-MON/MP-MON.csproj"
// },
// SITE: {
// sleep 1
// 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:OutputPath=bin/ MP-Site/MP-Site.csproj"
// },
// TABLET: {
// sleep 2
// 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:OutputPath=bin/ MP-Tablet/MP-Tablet.csproj"
// },
failFast: false)
}
else {
echo 'Nothing to deploy...'
}
}
}
}
stage('Installers') {
agent any
steps {
// in primis compilo a seconda del branch... TUTTO tranne develop...
script {
// CAMBIO numero versione in file sorgente!!!
bat "fart.exe VersGen\\MoonPro.cs 1.0.0.0 ${env.versionNumber} || EXIT /B 0"
// restore nuget packages
bat "e:\\nuget.exe restore ${WORKSPACE}\\MAPO.sln"
}
// ora mi occupo delle operazioni di compressione e copia...
script {
/* compilo installers in base al BRANCH del cliente... */
if (env.BRANCH_NAME == "master" || env.BRANCH_NAME.contains("DEMO")) {
echo 'Questo BRANCH non necessita di installer...'
}
else
{
parallel (
LANDING: {
sleep 5
bat "\"${tool 'MSBuild-14.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=Donati /p:PublishProfile=Donati.pubxml /p:VisualStudioVersion=14.0 /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/Donati/${env.versionNumber}/MP-LAND.zip /p:DeployIisAppPath=\"Default Web Site/MP/LAND\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ MP/MP.csproj"
bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\MP\\ReleaseClienti\\Donati\" \"E:\\Staging\\byProd\\MP\\Donati\\MP-LAND\" "
// dropbox configName: 'Donati', remoteDirectory: 'installers/MP-LAND', removePrefix: 'ReleaseClienti/Donati', sourceFiles: 'ReleaseClienti/Donati/**'
},
ADMIN: {
sleep 0
bat "\"${tool 'MSBuild-14.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=Donati /p:PublishProfile=Donati.pubxml /p:VisualStudioVersion=14.0 /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/Donati/${env.versionNumber}/MP-ADM.zip /p:DeployIisAppPath=\"Default Web Site/MP/ADM\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ MP-Admin/MP-Admin.csproj"
bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\MP-Admin\\ReleaseClienti\\Donati\" \"E:\\Staging\\byProd\\MP\\Donati\\MP-ADM\" "
},
IO: {
sleep 0
bat "\"${tool 'MSBuild-14.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=Donati /p:PublishProfile=Donati.pubxml /p:VisualStudioVersion=14.0 /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/Donati/${env.versionNumber}/MP-IO.zip /p:DeployIisAppPath=\"Default Web Site/MP/IO\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ MP-IO/MP-IO.csproj"
bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\MP-IO\\ReleaseClienti\\Donati\" \"E:\\Staging\\byProd\\MP\\Donati\\MP-IO\" "
},
MON: {
sleep 3
bat "\"${tool 'MSBuild-14.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=Donati /p:PublishProfile=Donati.pubxml /p:VisualStudioVersion=14.0 /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/Donati/${env.versionNumber}/MP-MON.zip /p:DeployIisAppPath=\"Default Web Site/MP/MON\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ MP-MON/MP-MON.csproj"
bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\MP-MON\\ReleaseClienti\\Donati\" \"E:\\Staging\\byProd\\MP\\Donati\\MP-MON\" "
},
SITE: {
sleep 1
bat "\"${tool 'MSBuild-14.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=Donati /p:PublishProfile=Donati.pubxml /p:VisualStudioVersion=14.0 /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/Donati/${env.versionNumber}/MP-SITE.zip /p:DeployIisAppPath=\"Default Web Site/MP/SITE\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ MP-Site/MP-Site.csproj"
bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\MP-Site\\ReleaseClienti\\Donati\" \"E:\\Staging\\byProd\\MP\\Donati\\MP-SITE\" "
},
TABLET: {
sleep 2
// bat "\"${tool 'MSBuild-14.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=Donati /p:PublishProfile=Donati.pubxml /p:VisualStudioVersion=14.0 /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/Donati/${env.versionNumber}/MP-TAB.zip /p:DeployIisAppPath=\"Default Web Site/MP/TAB\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ MP-Tablet/MP-Tablet.csproj"
bat "\"${tool 'MSBuild-14.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=${env.BRANCH_NAME} /p:PublishProfile=${env.BRANCH_NAME}.pubxml /p:VisualStudioVersion=14.0 /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/${env.BRANCH_NAME}/MP-TAB.zip /p:DeployIisAppPath=\"Default Web Site/MP/TAB\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ MP-Tablet/MP-Tablet.csproj"
// SOLO se è tra i branch "cliente" pubblico in dropbox...
if (env.BRANCH_NAME == "Donati") {
bat "E:\\Jenkins\\exportDropbox.bat \"${WORKSPACE}\\MP-Tablet\\ReleaseClienti\\${env.BRANCH_NAME}\" \"E:\\Staging\\byProd\\MP\\${env.BRANCH_NAME}\\MP-TAB\" "
}
// manifest.xml: aggiorno versNumber ed URL del branch di update...
bat "fart.exe MP-Tablet\\Resources\\manifest.xml 1.0.0.0 ${env.versionNumber} || EXIT /B 0"
bat "fart.exe MP-Tablet\\Resources\\manifest.xml {{BRANCHNAME}} ${env.BRANCH_NAME} || EXIT /B 0"
bat "fart.exe MP-Tablet\\Resources\\ChangeLog.html {{CURRENT-REL}} ${env.versionNumber} || EXIT /B 0"
writeFile file: 'MP-Tablet\\changeLog.log', text: "${getChangeString()}"
powershell '(Get-Content MP-Tablet\\Resources\\ChangeLog.html) | ForEach-Object { $_ -replace \"{{LAST-CHANGES}}\", \"${getChangeString()}\" } | Set-Content MP-Tablet\\Resources\\ChangeLog.html'
// copio ed esporto in IIS02 i vari files .xml, .html, .zip
bat "xcopy /y MP-Tablet\\Resources\\manifest.xml c:\\inetpub\\wwwroot\\SWS\\MAPO\\TAB\\${env.BRANCH_NAME}\\ "
bat "xcopy /y MP-Tablet\\Resources\\ChangeLog.html c:\\inetpub\\wwwroot\\SWS\\MAPO\\TAB\\${env.BRANCH_NAME}\\ "
bat "xcopy /y MP-Tablet\\Resources\\logoSteamware.png c:\\inetpub\\wwwroot\\SWS\\MAPO\\TAB\\${env.BRANCH_NAME}\\ "
// salvo copia della versione...
bat "xcopy /y MP-Tablet\\ReleaseClienti\\${env.BRANCH_NAME}\\* E:\\Staging\\byProd\\MP\\${env.BRANCH_NAME}\\MP-TAB\\${env.versionNumber}\\ "
// copio x AutoUpdate deploy
bat "xcopy /y MP-Tablet\\ReleaseClienti\\${env.BRANCH_NAME}\\MP-TAB.zip c:\\inetpub\\wwwroot\\SWS\\MAPO\\TAB\\${env.BRANCH_NAME}\\ "
},
failFast: false)
}
}
}
}
}
post {
success {
sendEmail("Successful")
}
failure {
sendEmail("Failed")
}
unstable {
sendEmail("Unstable")
}
}
}
@NonCPS
def getChangeString() {
MAX_MSG_LEN = 100
def changeString = ""
echo "Gathering SCM changes"
def changeLogSets = currentBuild.changeSets
for (int i = 0; i < changeLogSets.size(); i++) {
def entries = changeLogSets[i].items
for (int j = 0; j < entries.length; j++) {
def entry = entries[j]
truncated_msg = entry.msg.take(MAX_MSG_LEN)
changeString += " - ${truncated_msg} [${entry.author}]\n"
}
}
if (!changeString) {
changeString = " - Nessuna Modifica"
}
return changeString
}
def sendEmail(status) {
mail (
to: "$EMAIL_RECIPIENTS",
subject: "Build $BUILD_NUMBER - " + status + " ($JOB_NAME)",
body: "Modifiche:\n " + getChangeString() + "\n\n Verifica console output: $BUILD_URL/console" + "\n")
}