diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c01c2414..2aedaaf6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,6 +19,28 @@ variables: C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source http://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`"" } echo $hasSource +# helper pulizia files zip +.cleanup-zip: &cleanup-zip + - | + $env:OUTPUT_DIR = "Releases\" + $CI_COMMIT_BRANCH + "\*" + if ((Test-Path $env:OUTPUT_DIR)) + { + Remove-Item $env:OUTPUT_DIR -Force -Recurse -ErrorAction Ignore + } + echo "Clening ZIP dir: $env:OUTPUT_DIR" + +# helper creazione files zip +.zipper: &zipper + - | + $7zipPath = $env:ProgramFiles+"\7-Zip\7z.exe" + if (-not (Test-Path -Path $7zipPath -PathType Leaf)) { + throw "7 zip file '$7zipPath' not found" + } + Set-Alias 7zip $7zipPath + $Target = "Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip" + $Source = "Publish\" + $CI_COMMIT_BRANCH + "\*" + 7zip a -tzip $Target $Source + echo "called ZIP $Source --> $Target" # helper creazione hash files .hashBuild: &hashBuild @@ -107,12 +129,16 @@ staging: - develop - master needs: ["build"] - # before_script: - # - *nuget-fix - # - dotnet restore + before_script: + # - *nuget-fix + # - dotnet restore + # - '& "$env:NUGET_PATH" restore LPA.sln' # path alla solution corrente + # - *version-fix + - *cleanup-zip script: - - dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -c Release -o ./Releases/$CI_COMMIT_BRANCH MP.Stats/MP.Stats.csproj + - dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -c Release -o ./Publish/$CI_COMMIT_BRANCH MP.Stats/MP.Stats.csproj # da fare qui il deploy su nexus... + - *zipper - *hashBuild - *nexusUpload