From 0ba63c17c9dbbb634987310588f6ce8afbd7e18e Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 14 Nov 2024 09:30:34 +0100 Subject: [PATCH] Modifica elenco step fix SRC --- .gitlab-ci.yml | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e78bf629..ee0706d0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,17 +24,35 @@ variables: # helper x fix pacchetti nuget da repo locale nexus.steamware.net .nuget-fix: &nuget-fix - | - $hasSource = C:\Tools\nuget.exe sources list | find "`"Steamware Nexus`"" /C - echo "Start nuget-fix: found $hasSource to remove" - if ($hasSource -ne 0) { - C:\Tools\nuget.exe sources Add -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"$NEXUS_PASSWD`"" - echo "Nuget src removed..." - } else { - C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"$NEXUS_PASSWD`"" - echo "Nuget src Added!" + echo "esecuzione Nuget FIX steps" + dotnet nuget list source + $hasSource = dotnet nuget list source | Select-String -Pattern "Steamware Nexus Proxy" + if (! [String]::IsNullOrWhiteSpace($hasSource)) { + dotnet nuget remove source "`"Steamware Nexus Proxy`"" } - $hasSource = C:\Tools\nuget.exe sources list | find "`"Steamware Nexus`"" /C - echo "Nuget src fix complete: now $hasSource src present" + $hasSource = dotnet nuget list source | Select-String -Pattern "Steamware Nexus" + if (! [String]::IsNullOrWhiteSpace($hasSource)) { + dotnet nuget remove source "`"Steamware Nexus`"" + } + $hasSource = dotnet nuget list source | Select-String -Pattern "nexus-proxy-v3" + if (! [String]::IsNullOrWhiteSpace($hasSource)) { + dotnet nuget remove source nexus-proxy-v3 + } + $hasSource = dotnet nuget list source | Select-String -Pattern "nexus-hosted" + if (! [String]::IsNullOrWhiteSpace($hasSource)) { + dotnet nuget remove source nexus-hosted + } + $hasSource = dotnet nuget list source | Select-String -Pattern "Microsoft Visual Studio Offline Packages" + if (! [String]::IsNullOrWhiteSpace($hasSource)) { + dotnet nuget remove source 'Microsoft Visual Studio Offline Packages' + } + echo "Situazione sorgenti post remove:" + dotnet nuget list source + dotnet nuget add source https://nexus.steamware.net/repository/nuget-proxy-v3/index.json -n nexus-proxy-v3 -u nugetUser -p $NEXUS_PASSWD --store-password-in-clear-text + dotnet nuget add source https://nexus.steamware.net/repository/nuget-hosted/ -n nexus-hosted -u nugetUser -p $NEXUS_PASSWD --store-password-in-clear-text + $hasSource = dotnet nuget list source + echo "Situazione sorgenti FINALE:" + dotnet nuget list source # helper x fix version number .version-fix: &version-fix