diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..5903778 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,87 @@ +variables: + VERS_MAIN: '0.9' + NEW_REL: '' + APP_NAME: 'SMGen' + SOL_NAME: 'SMGen' + +# helper x fix pacchetti nuget da repo locale nexus.steamware.net +.nuget-fix: &nuget-fix + - | + 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`"" + } + $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" + + + +stages: + - build + - staging + - deploy + +# ---------- BUILD ---------- +SMGen:build: + stage: build + tags: + - win + variables: + APP_NAME: SMGen + SOL_NAME: SMGen + before_script: + - *nuget-fix + - dotnet restore "$env:SOL_NAME.sln" + script: + - dotnet build $env:APP_NAME/$env:APP_NAME.csproj + + +# ---------- STAGING ---------- +SMGen:staging: + stage: staging + tags: + - win + variables: + APP_NAME: SMGen + SOL_NAME: SMGen + only: + - develop + needs: ["SMGen:build"] + before_script: + - *nuget-fix + - dotnet restore "$env:SOL_NAME.sln" + script: + - dotnet build $env:APP_NAME/$env:APP_NAME.csproj + - dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj + +# ---------- DEPLOY ---------- +SMGen:deploy: + stage: deploy + tags: + - win + environment: + name: production + url: https://office.egalware.com/MP/SMGEN + variables: + APP_NAME: SMGen + SOL_NAME: SMGen + only: + - main + needs: ["SMGen:build"] + before_script: + - *nuget-fix + - dotnet restore "$env:SOL_NAME.sln" + script: + - dotnet build $env:APP_NAME/$env:APP_NAME.csproj + # IIS PROD + - dotnet publish -p:PublishProfile=IIS-PROD.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj diff --git a/Resources/LogoEgw.png b/Resources/LogoEgw.png new file mode 100644 index 0000000..8d5a7c1 Binary files /dev/null and b/Resources/LogoEgw.png differ diff --git a/Resources/MainVers.txt b/Resources/MainVers.txt new file mode 100644 index 0000000..3e205f2 --- /dev/null +++ b/Resources/MainVers.txt @@ -0,0 +1 @@ +0.8. diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt new file mode 100644 index 0000000..22a1406 --- /dev/null +++ b/Resources/VersNum.txt @@ -0,0 +1 @@ +0.8.2307.2416 diff --git a/SMGen/.config/dotnet-tools.json b/SMGen/.config/dotnet-tools.json new file mode 100644 index 0000000..b0e38ab --- /dev/null +++ b/SMGen/.config/dotnet-tools.json @@ -0,0 +1,5 @@ +{ + "version": 1, + "isRoot": true, + "tools": {} +} \ No newline at end of file diff --git a/SMGen/Properties/PublishProfiles/IIS-PROD.pubxml b/SMGen/Properties/PublishProfiles/IIS-PROD.pubxml new file mode 100644 index 0000000..65cbd9c --- /dev/null +++ b/SMGen/Properties/PublishProfiles/IIS-PROD.pubxml @@ -0,0 +1,26 @@ + + + + + MSDeploy + true + Release + Any CPU + https://office.egalware.com/MP/SMGEN/ + false + false + https://iis04.egalware.com:8172/MsDeploy.axd + office.egalware.com/MP/SMGEN + + false + WMSVC + true + true + jenkins + <_SavePWD>true + <_TargetId>IISWebDeploy + net6.0 + + \ No newline at end of file diff --git a/SMGen/Properties/PublishProfiles/IIS-PROD.pubxml.user b/SMGen/Properties/PublishProfiles/IIS-PROD.pubxml.user new file mode 100644 index 0000000..8ed7f0e --- /dev/null +++ b/SMGen/Properties/PublishProfiles/IIS-PROD.pubxml.user @@ -0,0 +1,12 @@ + + + + + True|2023-07-24T14:24:14.2770302Z;True|2023-07-24T16:23:20.6455643+02:00;True|2023-05-22T15:35:59.9735292+02:00;False|2023-05-22T15:33:39.4808724+02:00;True|2023-05-11T17:36:48.1468628+02:00; + + + AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAHBJL+AjnSkKKQcJBrmvYDwAAAAACAAAAAAADZgAAwAAAABAAAABqHjtCI4r9HP4to5TPRtU/AAAAAASAAACgAAAAEAAAAGWTrj6ykvtUZnIZTp5COsMYAAAAHkol9Zhdo3QCFNYyIvyJViyIyNSW1oNCFAAAAEvXT2wDdsDBGFpVXvR5NVA172tk + + \ No newline at end of file diff --git a/SMGen/Properties/PublishProfiles/IIS01.pubxml b/SMGen/Properties/PublishProfiles/IIS01.pubxml new file mode 100644 index 0000000..5058917 --- /dev/null +++ b/SMGen/Properties/PublishProfiles/IIS01.pubxml @@ -0,0 +1,26 @@ + + + + + MSDeploy + true + Release + Any CPU + https://iis01.egalware.com/MP/SMGEN/ + false + false + https://iis01.egalware.com:8172/MsDeploy.axd + Default Web Site/MP/SMGEN + + false + WMSVC + true + true + jenkins + <_SavePWD>true + <_TargetId>IISWebDeploy + net6.0 + + \ No newline at end of file diff --git a/SMGen/Properties/PublishProfiles/IIS01.pubxml.user b/SMGen/Properties/PublishProfiles/IIS01.pubxml.user new file mode 100644 index 0000000..3b2c371 --- /dev/null +++ b/SMGen/Properties/PublishProfiles/IIS01.pubxml.user @@ -0,0 +1,13 @@ + + + + + + AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAHBJL+AjnSkKKQcJBrmvYDwAAAAACAAAAAAADZgAAwAAAABAAAABEZeATgyzATbSQPONruxZ3AAAAAASAAACgAAAAEAAAAOUpb0A/7aezHDT3vKuP+soYAAAAPs13cFfi0CJUSv0cE5GdPLNFBpttx9LHFAAAAHna4yYnHTKs3srVf3z0EW0hjQZb + True|2023-07-24T14:12:23.8712346Z;True|2023-05-11T11:56:02.0835509+02:00;True|2023-05-11T11:03:19.0009531+02:00;True|2023-04-17T19:22:41.9460631+02:00; + + + \ No newline at end of file diff --git a/SMGen/SMGen.csproj b/SMGen/SMGen.csproj index 1b8dea2..c7abf54 100644 --- a/SMGen/SMGen.csproj +++ b/SMGen/SMGen.csproj @@ -4,14 +4,22 @@ net6.0 enable enable + State Machine Generator + 0.8.2307.2416 + + <_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS01.pubxml" /> + + + + diff --git a/SMGen/post-build.ps1 b/SMGen/post-build.ps1 new file mode 100644 index 0000000..13e8b26 --- /dev/null +++ b/SMGen/post-build.ps1 @@ -0,0 +1,15 @@ +param([string]$ProjectDir, [string]$ProjectPath); + +$MainVers="..\Resources\MainVers.txt" +$FileVers="..\Resources\VersNum.txt" +$MajMin=Get-Content $MainVers +$currentDate = get-date -format yyMM; +$currentTime = get-date -format ddHH; +$find = "(.|\n)*?"; +$currRelNum=$MajMin + $currentDate +"." + $currentTime +$replace = "" + $MajMin + $currentDate +"." + $currentTime + ""; +$csproj = Get-Content $ProjectPath +$csprojUpdated = $csproj -replace $find, $replace + +Set-Content -Path $ProjectPath -Value $csprojUpdated +Set-Content -Path $FileVers -Value $currRelNum