diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 947214b..ac37e9b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ variables: NUGET_PATH: 'C:\Tools\nuget.exe' MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe' ASPNET_MERGE_PATH: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools' - VERS_MAIN: '1.2' + VERS_MAIN: '1.8' NEW_REL: '' NEXUS_PATH: 'XPS' APP_NAME: 'XPS' @@ -26,19 +26,14 @@ variables: .version-fix: &version-fix - | # Esecuzione fix numero versione x pack nuget - $fileNameAss = ".\$env:APP_NAME\Properties\AssemblyInfo.cs"; - $find = "assembly: AssemblyVersion"; - $riga = Select-String $fileNameAss -Pattern $find; - # recupero il valore della versione release/debug - $idxVers = $riga.ToString().IndexOf("AssemblyVersion("); - $currRelease = $riga.ToString().Substring($idxVers).Replace("AssemblyVersion(","").Replace(")]","").Replace("""",""); + $fileName = ".\VersGen\VersGen.cs"; # calcolo nuova - $env:NEW_REL = $env:VERS_MAIN+"."+(get-date –format yyMM)+"."+(get-date –format ddHH) + $env:NEW_REL = $env:VERS_MAIN+"."+(get-date –format yyMM)+"."+(get-date –format dHH) echo "New vers: $env:NEW_REL" # aggiorno file - $contenuto = Get-Content -path $fileNameAss -Raw - $newContenuto = $contenuto -replace $currRelease, $env:NEW_REL - $newContenuto | Set-Content -path $fileNameAss + $contenuto = Get-Content -path $fileName -Raw + $newContenuto = $contenuto -replace '1.0.0.0', $env:NEW_REL + $newContenuto | Set-Content -path $fileName # helper creazione hash files .hashBuild: &hashBuild @@ -145,7 +140,7 @@ XPST:IIS01:deploy: - *version-fix script: - '& "$env:MSBUILD_PATH" /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS01.pubxml /p:RunCodeAnalysis=false /p:Configuration=Release /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ /verbosity:minimal $env:APP_NAME/$env:APP_NAME.csproj' - needs: ["XPS:build"] + needs: ["XPST:build"] # XPS:IIS02:deploy: