diff --git a/Jenkinsfile b/Jenkinsfile index 17b316e..46fba1a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,7 @@ pipeline { steps { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=665']) { + withEnv(['NEXT_BUILD_NUMBER=667']) { // env.versionNumber = VersionNumber(versionNumberString : '3.2.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '3.2.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'SteamWareLib' @@ -39,6 +39,55 @@ pipeline { } } } + stage('Test') { + steps { + echo 'Testing.. 2 be done...' + } + } + stage('Deploy') { + agent any + steps { + // in primis compilo a seconda del branch... TUTTO tranne develop... + script { + // calcolo il config... + if (env.BRANCH_NAME == "develop") { + env.config = "Debug" + } + else if (env.BRANCH_NAME == "master") { + env.config = "Release" + } + // procedo solo se NON si tratta di commit in ramo UnitTesting... + if (env.BRANCH_NAME != "UnitTesting") { + // CAMBIO numero versione + checkout NuGet in file sorgente!!! + bat "e:\\fart.exe SteamWareLib\\SteamWare.cs 1.0.0.0 ${env.versionNumber} || EXIT /B 0" + bat "e:\\nuget.exe restore ${WORKSPACE}\\SteamWare.sln" + // BUILD! + bat "\"${tool 'MSBuild-16.0'}\" SteamWareLib\\SteamWare.csproj -target:Build /p:Configuration=${env.config} /p:Platform=\"Any CPU\" /p:OutputPath=bin/${env.config} /m" + // creo package NuGet... + bat "e:\\nuget.exe pack ${WORKSPACE}\\SteamWareLib\\SteamWareLib.csproj -properties Configuration=${env.config}" + } + else + { + echo 'Nessun Deploy x UnitTesting' + } + } + // ora mi occupo delle operazioni di invio a NEXUS... + script { + if (env.BRANCH_NAME == "develop") { + // lancio upload con nuget! + echo 'Start upload with nuget push' + bat "e:\\nuget setapikey fe387daa-d07c-3207-877e-96c8be1be91b -source http://nexus.steamware.net/repository/nuget-hosted" + bat "e:\\nuget.exe push SteamWareLib.${env.versionNumber}-beta.nupkg -Source http://nexus.steamware.net/repository/nuget-hosted" + } + else if (env.BRANCH_NAME == "master") { + // lancio upload con nuget! + echo 'Start upload with nuget push' + bat "e:\\nuget setapikey fe387daa-d07c-3207-877e-96c8be1be91b -source http://nexus.steamware.net/repository/nuget-hosted" + bat "e:\\nuget.exe push SteamWareLib.${env.versionNumber}.nupkg -Source http://nexus.steamware.net/repository/nuget-hosted" + } + } + } + } } post { success {