diff --git a/Jenkinsfile b/Jenkinsfile index ee73ccc..d57b9b7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,7 +20,8 @@ pipeline { } // 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" + //bat "e:\\nuget.exe restore ${WORKSPACE}\\SteamWare.sln" + fixNuget("${WORKSPACE}\\SteamWare.sln") } } stage('Build') { @@ -30,7 +31,8 @@ pipeline { properties([buildDiscarder(logRotator(artifactDaysToKeepStr: '180', artifactNumToKeepStr: '30', daysToKeepStr: '360', numToKeepStr: '30')), pipelineTriggers([])]) // 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" + // bat "e:\\nuget.exe restore ${WORKSPACE}\\SteamWare.sln" + fixNuget("${WORKSPACE}\\SteamWare.sln") } script { parallel ( @@ -74,7 +76,8 @@ pipeline { // 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:\\fart.exe SteamWareLib\\SteamWare.csproj 1.0.0.0 ${env.packVers} || EXIT /B 0" - bat "e:\\nuget.exe restore ${WORKSPACE}\\SteamWare.sln" + //bat "e:\\nuget.exe restore ${WORKSPACE}\\SteamWare.sln" + fixNuget("${WORKSPACE}\\SteamWare.sln") // elimino vecchie build... bat "del /f /q *.nupkg" parallel ( @@ -91,7 +94,7 @@ pipeline { bat "e:\\nuget.exe pack ${WORKSPACE}\\SteamWare.Reports\\SteamWare.Reports.csproj -properties Configuration=${env.config} -Version ${env.packVers}" }, LOGGER: { - // BUILD Reports lib! + // BUILD Logger lib! bat "\"${tool 'MSBuild-16.0'}\" SteamWare.Logger\\SteamWare.Logger.csproj -target:Build /p:Configuration=${env.config} /p:Platform=\"Any CPU\" /p:OutputPath=bin/${env.config} /m" // creo package NuGet... con version in modo da fare ANCHE le beta bat "e:\\nuget.exe pack ${WORKSPACE}\\SteamWare.Logger\\SteamWare.Logger.csproj -properties Configuration=${env.config} -Version ${env.packVers}" @@ -165,3 +168,18 @@ def sendSlack(status, colorCode) { "Modifiche:\n " + getChangeString() + "\n\n Verifica build: <${env.BUILD_URL}|Apri>" + "\n" ) } +// funzione x fix pacchetti nuget da NOSTRO repo Nexus con proxy +def fixNuget(solutionFile) { + // bat "e:\\nuget setapikey fe387daa-d07c-3207-877e-96c8be1be91b -source http://nexus.steamware.net/repository/nuget-group" + // solo la prima volta va aggiunta... + hasSource = bat "e:\\nuget sources list | find \"Steamware\" /C" + if (hasSource == "0") + { + bat "e:\\nuget sources Add -Name \"Steamware Nexus\" -Source http://nexus.steamware.net/repository/nuget-group -username \"nugetUser\" -password \"viaDante16\"" + } + else + { + bat "e:\\nuget sources Update -Name \"Steamware Nexus\" -Source http://nexus.steamware.net/repository/nuget-group -username \"nugetUser\" -password \"viaDante16\"" + } + bat "e:\\nuget.exe restore ${solutionFile}" +} \ No newline at end of file