diff --git a/Jenkinsfile b/Jenkinsfile index fa418cb..373f5cc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -40,9 +40,6 @@ pipeline { bat "e:\\fart.exe VersGen\\VersGen.cs 1.0.0.0 ${env.versionNumber} || EXIT /B 0" // checkout NuGet in file sorgente!!! fixNuget("${WORKSPACE}\\C-TRACK.sln") - // bat "e:\\nuget setapikey fe387daa-d07c-3207-877e-96c8be1be91b -source http://nexus.steamware.net/repository/nuget-group" - // bat "e:\\nuget sources Add -Name "Steamware Nexus" -Source http://nexus.steamware.net/repository/nuget-group" - // bat "e:\\nuget.exe restore ${WORKSPACE}\\C-TRACK.sln" } } stage('Build') { @@ -217,8 +214,15 @@ def sendSlack(status, colorCode) { // 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" - // bat "e:\\nuget sources Remove -Name \"Steamware Nexus\" " - // bat "e:\\nuget sources Add -Name \"Steamware Nexus\" -Source http://nexus.steamware.net/repository/nuget-group" - bat "e:\\nuget sources Update -Name \"Steamware Nexus\" -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" + } + else + { + bat "e:\\nuget sources Update -Name \"Steamware Nexus\" -Source http://nexus.steamware.net/repository/nuget-group" + } bat "e:\\nuget.exe restore ${solutionFile}" } \ No newline at end of file