From 487426ca44340bf355a2a519359f4311dee43002 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 3 Sep 2024 15:33:08 +0200 Subject: [PATCH] Update yaml x CI/CD di nuget fix --- .gitlab-ci.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e6606bc8..597614a8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,13 +15,22 @@ 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 - if ($hasSource -eq 0) { - C:\Tools\nuget.exe sources Add -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"$IIS_PWD`"" - } else { - C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"$IIS_PWD`"" + 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`"" } - echo $hasSource + $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 + } + dotnet nuget add source https://nexus.steamware.net/repository/nuget-group-3/index.json -n "Steamware Nexus" -u nugetUser -p $NEXUS_PASSWD --store-password-in-clear-text + echo "Steamware Nexus Source added" # helper creazione hash files x IIS .hashBuild: &hashBuild