Fix yaml x componenti nuspec

This commit is contained in:
Samuele Locatelli
2024-08-07 08:29:41 +02:00
parent ba91bd9edb
commit fcd1f16071
+26 -13
View File
@@ -39,19 +39,6 @@ variables:
#cd "$env:APP_NAME\bin\publish\net6.0"
# # helper creazione hash files x EXE
# .hashBuildExe: &hashBuildExe
# - |
# $Target = "$env:APP_NAME\Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip"
# $MD5 = Get-FileHash $Target -Algorithm MD5
# $SHA1 = Get-FileHash $Target -Algorithm SHA1
# New-Item $Target".md5"
# New-Item $Target".sha1"
# $MD5.Hash | Set-Content -Path $Target".md5"
# $SHA1.Hash | Set-Content -Path $Target".sha1"
# echo "Created HASH files for $Target"
# helper creazione hash files x IIS
.hashBuild: &hashBuild
- |
@@ -110,6 +97,32 @@ variables:
Write-Output $resoconto;
echo "Replace completati"
# helper x fix nuspec file
.nuspec-fix: &nuspec-fix
- |
echo "Modifica dati file nuspec Release"
$currRelease = $env:NUM_REL
$currDebug = $env:NUM_DEB
$find = "<version>(.|\n)*?</version>";
$fileNameRel = "$env:APP_NAME.Release.nuspec";
$replRel = "<version>" + $currRelease + "</version>";
$nuspDataRel = Get-Content $fileNameRel;
$nuspDataRelUpd = $nuspDataRel -replace $find, $replRel;
$nuspDataRelUpd = $nuspDataRelUpd -replace "#copyright#", $replCopy;
$nuspDataRelUpd = $nuspDataRelUpd -replace "#releaseNotes#", "Build $adesso";
Set-Content -Path $fileNameRel -Value $nuspDataRelUpd;
echo "Modifica dati file nuspec Debug"
$fileNameDeb = "$env:APP_NAME.Debug.nuspec";
$replDeb = "<version>" + $currDebug + "</version>";
$nuspDataDeb = Get-Content $fileNameDeb;
$nuspDataDebUpd = $nuspDataDeb -replace $find, $replDeb;
$nuspDataDebUpd = $nuspDataDebUpd -replace "#copyright#", $replCopy;
$nuspDataDebUpd = $nuspDataDebUpd -replace "#releaseNotes#", "Build $adesso";
Set-Content -Path $fileNameDeb -Value $nuspDataDebUpd;
echo "replace completati"
stages:
- build
- deploy