From 646cc2f16f6df737f2573ae23370b39eef163554 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Mon, 14 Oct 2019 11:28:29 +0200 Subject: [PATCH] Fix nuget restore? --- Jenkinsfile | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c25532e..1f76ac9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -231,7 +231,17 @@ 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 Add -Name \"Steamware Nexus\" -Source http://nexus.steamware.net/repository/nuget-group" - bat "e:\\nuget.exe restore ${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 setapikey fe387daa-d07c-3207-877e-96c8be1be91b -source http://nexus.steamware.net/repository/nuget-group" + bat "e:\\nuget.exe restore ${solutionFile}" } \ No newline at end of file