From 30fe894d088e34747bf32eba135ec08f740526a3 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Wed, 25 Oct 2017 14:43:59 +0200 Subject: [PATCH] typo fix in jenkinsfile --- Jenkinsfile | 139 ++++++++++++++++++++++++++-------------------------- 1 file changed, 70 insertions(+), 69 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8ff4ec40..23f8653b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,65 +1,65 @@ pipeline { - agent none - 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']) + agent none + 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=66']) { - // env.versionNumber = VersionNumber(versionNumberString : '0.10.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) - env.versionNumber = VersionNumber(versionNumberString : '0.10.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') - env.APP_NAME = 'MAPO-IOB-WIN' - } - } - 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\\VersGen.cs 1.0.0.0 ${env.versionNumber} || EXIT /B 0" + /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ + script { + withEnv(['NEXT_BUILD_NUMBER=66']) { + // env.versionNumber = VersionNumber(versionNumberString : '0.10.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) + env.versionNumber = VersionNumber(versionNumberString : '0.10.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') + env.APP_NAME = 'MAPO-IOB-WIN' + } + } + 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\\VersGen.cs 1.0.0.0 ${env.versionNumber} || EXIT /B 0" + } + } + stage('Build') { + agent any + 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\\VersGen.cs 1.0.0.0 ${env.versionNumber} || EXIT /B 0" + // restore nuget packages + bat "e:\\nuget.exe restore ${WORKSPACE}\\IOB-WIN.sln" + // BUILD! + bat "\"${tool 'MSBuild-14.0'}\" IOB-WIN/IOB-WIN.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" } + else { + echo 'Nothing to Build...' + } + } + } } - stage('Build') { - agent any - 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\\VersGen.cs 1.0.0.0 ${env.versionNumber} || EXIT /B 0" - // restore nuget packages - bat "e:\\nuget.exe restore ${WORKSPACE}\\IOB-WIN.sln" - // BUILD! - bat "\"${tool 'MSBuild-14.0'}\" IOB-WIN/IOB-WIN.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" - } - else { - echo 'Nothing to Build...' - } - } - } - } - stage('Test') { - steps { + stage('Test') { + steps { echo 'Testing.. 2 be done...' - } - } - stage('Deploy') { - agent any - steps { + } + } + stage('Deploy') { + agent any + steps { // in primis compilo a seconda del branch... TUTTO tranne develop... - script { + script { // CAMBIO numero versione in file sorgente!!! bat "fart.exe VersGen\\VersGen.cs 1.0.0.0 ${env.versionNumber} || EXIT /B 0" // restore nuget packages @@ -68,7 +68,7 @@ pipeline { bat "\"${tool 'MSBuild-14.0'}\" IOB-WIN/IOB-WIN.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m" } // ora mi occupo delle operazioni di compressione e copia... - script { + script { // elimino files conf personalizzata per ogni install... bat "RD /S /Q IOB-WIN\\bin\\DATA" // manifest.xml: aggiorno versNumber ed URL del branch di update... @@ -89,18 +89,19 @@ pipeline { bat "e:\\7za.exe a -tzip ${WORKSPACE}\\Releases\\${env.BRANCH_NAME}\\MAPO-IOB-WIN.zip ${WORKSPACE}\\IOB-WIN\\bin\\*" // copio bat "xcopy /y Releases\\${env.BRANCH_NAME}\\MAPO-IOB-WIN.zip c:\\inetpub\\wwwroot\\SWS\\MAPO-IOB-WIN\\${env.BRANCH_NAME}\\ " - } - } - } - post { - success { - mail to:"samuele@steamware.net", subject:"SUCCESS: ${currentBuild.fullDisplayName}", body: "Build passed." - } - failure { - mail to:"samuele@steamware.net", subject:"FAILURE: ${currentBuild.fullDisplayName}", body: "Build failed." - } - unstable { - mail to:"samuele@steamware.net", subject:"UNSTABLE: ${currentBuild.fullDisplayName}", body: "Build is unstable." } + } } + } + post { + success { + mail to:"samuele@steamware.net", subject:"SUCCESS: ${currentBuild.fullDisplayName}", body: "Build passed." + } + failure { + mail to:"samuele@steamware.net", subject:"FAILURE: ${currentBuild.fullDisplayName}", body: "Build failed." + } + unstable { + mail to:"samuele@steamware.net", subject:"UNSTABLE: ${currentBuild.fullDisplayName}", body: "Build is unstable." + } + } } \ No newline at end of file