Update ci/cd (da provare)

This commit is contained in:
Samuele Locatelli
2024-04-10 11:26:24 +02:00
parent 2b6b0ac610
commit f6ae178ff1
5 changed files with 56 additions and 64 deletions
+53 -60
View File
@@ -1,9 +1,10 @@
variables:
VERS_MAIN: '0.9'
VERS_MAIN: '0.1'
NEW_REL: ''
APP_NAME: ''
APP_CONF: 'Release'
SOL_NAME: ''
INST_NAME: ''
# Step esecuzione script powershell x code obfuscation (tool install + esecuzione)
.obfuscate: &obfuscate
@@ -21,17 +22,33 @@ variables:
}
echo $hasSource
# helper creazione hash files x IIS
# helper x fix version number
.version-fix: &version-fix
- |
$env:VERS_MAIN = Get-Content "MajMin.vers"
$env:NEW_REL = $env:VERS_MAIN+"."+(get-date -format yyMM)+"."+(get-date -format ddHH)
$env:NUM_REL = $env:VERS_MAIN+"."+(get-date -format yyMM)+"."+(get-date -format dHH)
$env:NUM_DEB = $env:VERS_MAIN+"."+(get-date -format yyMM)+"-beta."+(get-date -format dHH)
$env:NEW_COPYRIGHT = "EgalWare @ 2021-" + (get-date -format yyyy)
$contenuto = Get-Content -path 'VersGen\VersGen.cs' -Raw
$newContenuto = $contenuto -replace '0.0.0.0', $env:NEW_REL
$newContenuto = $newContenuto -replace 'EgalWare © 2021', $env:NEW_COPYRIGHT
$newContenuto | Set-Content -Path 'VersGen\VersGen.cs'
# display versioni generate
$resoconto = "Effettuato fix file VersGen | release v: " + $env:NUM_REL + " | debug v: " + $env:NUM_DEB;
Write-Output $resoconto;
echo "Replace completati"
# helper creazione hash files x Nexus
.hashBuild: &hashBuild
- |
$Target = "$env:APP_NAME\Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip"
$Target = "$env:APP_NAME\Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".msi"
$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 x send su NEXUS x pack
@@ -41,16 +58,18 @@ variables:
$currentDate = get-date -format yyMM;
$currentTime = get-date -format ddHH;
$fileVers = $env:APP_NAME + "\Resources\VersNum.txt"
$VersNumb = Get-Content $fileVers
echo "Curr Version: $VersNumb"
$VersNumb = Get-Content $fileVers
if($CI_COMMIT_BRANCH -eq "main")
{
$version = "stable"
$fileVers = $env:NUM_REL
}
else
{
$version = "unstable"
$fileVers = $env:NUM_DEB
}
echo "Curr Version: $VersNumb | $version"
$File2Send = Get-ChildItem("$env:APP_NAME\Releases\" + $CI_COMMIT_BRANCH + "\*")
ForEach ($File in $File2Send) {
$FileName = Split-Path $File -leaf
@@ -58,9 +77,9 @@ variables:
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:APP_NAME/$version/ARCHIVE/$VersNumb/$FileName
echo "mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:APP_NAME/$version/LAST/$FileName"
}
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "$env:APP_NAME\Resources\manifest.xml" https://nexus.steamware.net/repository/SWS/$env:APP_NAME/$version/LAST/manifest.xml
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "$env:APP_NAME\Resources\ChangeLog.html" https://nexus.steamware.net/repository/SWS/$env:APP_NAME/$version/LAST/ChangeLog.html
#mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "$env:APP_NAME\Resources\manifest.xml" https://nexus.steamware.net/repository/SWS/$env:APP_NAME/$version/LAST/manifest.xml
#mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "$env:APP_NAME\Resources\ChangeLog.html" https://nexus.steamware.net/repository/SWS/$env:APP_NAME/$version/LAST/ChangeLog.html
# helper creazione files zip x app console
.artifactZipper: &artifactZipper
- |
@@ -86,7 +105,7 @@ variables:
stages:
- build
# - staging
# - deploy
- deploy
# - pack
#--------- BUILD --------- #
@@ -100,45 +119,10 @@ Runner:build:
before_script:
- *nuget-fix
- dotnet restore $env:SOL_NAME.sln
- *version-fix
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
# DECODER:build:
# stage: build
# tags:
# - win
# variables:
# APP_NAME: MP.MONO.DECODER
# before_script:
# - *nuget-fix
# - dotnet restore MP.MONO.ALL.sln
# script:
# - dotnet build $env:APP_NAME/$env:APP_NAME.csproj
# SIM:build:
# stage: build
# tags:
# - win
# variables:
# APP_NAME: MP.MONO.SIM
# before_script:
# - *nuget-fix
# - dotnet restore MP.MONO.ALL.sln
# script:
# - dotnet build $env:APP_NAME/$env:APP_NAME.csproj
# UI:build:
# stage: build
# tags:
# - win
# variables:
# APP_NAME: MP.MONO.UI
# before_script:
# - *nuget-fix
# - dotnet restore MP.MONO.ALL.sln
# script:
# - dotnet build $env:APP_NAME/$env:APP_NAME.csproj
# #--------- Staging --------- #
# UI:staging:
# stage: staging
@@ -153,20 +137,29 @@ Runner:build:
# - dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
# #--------- Deploy --------- #
# UI:deploy:
# stage: deploy
# tags:
# - win
# variables:
# APP_NAME: MP.MONO.UI
# only:
# - main
# needs: ["UI:build"]
# script:
# # IIS02
# - dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
# # IIS04
# - dotnet publish -p:PublishProfile=IIS04.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true $env:APP_NAME/$env:APP_NAME.csproj
Runner:deploy:
stage: deploy
tags:
- win
variables:
APP_NAME: Maat.Runner
SOL_NAME: Maat.Runner
INST_NAME: Maat.Installer
only:
- main
needs: ["Runner:build"]
before_script:
- *nuget-fix
- dotnet restore $env:SOL_NAME.sln
- *version-fix
script:
# pubblicazione come singleApp
- dotnet publish -p:PublishProfile=SingleApp.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:APP_NAME/$env:APP_NAME.csproj
# creazione installer
- dotnet build $env:INST_NAME/$env:INST_NAME.csproj
#- *artifactZipper
- *hashBuild
- *nexusUpload
# #--------- PACK --------- #
# ADAPTER:packDebug:
+1 -1
View File
@@ -65,7 +65,7 @@
Return="check"
Impersonate="no" />
<!--Sequenza install: prima rimuove (se ci fosse9 poi reinstalla/avvia-->
<!--Sequenza install: prima rimuove (se ci fosse) poi reinstalla/avvia-->
<InstallExecuteSequence>
<Custom Action="RunPSscriptUninstall" Before="RemoveFiles" Condition="Installed OR REMOVE"></Custom>
<Custom Action="RunPSscript" After="InstallFiles" Condition="NOT REMOVE"></Custom>
+1 -1
View File
@@ -1 +1 @@
1.0.
1.1.
+1 -2
View File
@@ -135,7 +135,6 @@ in particolare è risultato necessario aggiungere un file di conf x nuget nel pr
|----------|------------|---------------------------------------------------------------------------------------|
| 0.9.2404 | 2024.04.04 | Prima versione, inizio documentazione e inizio sw Runner da rendere servizio con nssm |
| 1.0.2404 | 2024.04.06 | Versione installata su IIS01 in manuale x test esecuzione task da DB |
| 1.1.2404 | 2024.04.10 | Versione Funzionante con task powershell x install/remove servizio (IIS01) |
BIN
View File
Binary file not shown.