diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 97e5eda..8ff83c5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -132,98 +132,98 @@ WDC.UI:staging: - 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 ---------- -# WDC.Api:deploy: -# stage: deploy -# tags: -# - win -# environment: -# name: production -# url: https://seriate.egalware.com/GPW/WDC.UI -# variables: -# APP_NAME: WebDoorCreator.API -# SOL_NAME: WebDoorCreator.UI -# only: -# - main -# needs: ["WDC.Api:build"] -# before_script: -# - *nuget-fix -# - dotnet restore "$env:SOL_NAME.sln" -# script: -# - dotnet build $env:APP_NAME/$env:APP_NAME.csproj -# # # IIS 02 -# # - dotnet publish -p:PublishProfile=IIS02.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 -# # 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 +# ---------- DEPLOY ---------- +WDC.Api:deploy: + stage: deploy + tags: + - win + environment: + name: production + url: https://seriate.egalware.com/GPW/WDC.UI + variables: + APP_NAME: WebDoorCreator.API + SOL_NAME: WebDoorCreator.UI + only: + - main + needs: ["WDC.Api:build"] + before_script: + - *nuget-fix + - dotnet restore "$env:SOL_NAME.sln" + script: + - dotnet build $env:APP_NAME/$env:APP_NAME.csproj + # IIS 02 + - dotnet publish -p:PublishProfile=IIS02.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 + # 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 -# WDC.UI:deploy: -# stage: deploy -# tags: -# - win -# variables: -# APP_NAME: WebDoorCreator.UI -# SOL_NAME: WebDoorCreator.UI -# only: -# - main -# needs: ["WDC.UI:build"] -# before_script: -# - *nuget-fix -# - dotnet restore "$env:SOL_NAME.sln" -# script: -# - dotnet build $env:APP_NAME/$env:APP_NAME.csproj -# # IIS EXT -# - dotnet publish -p:PublishProfile=IIS-EXT.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 -# # IIS INT -# - dotnet publish -p:PublishProfile=IIS-INT.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 +WDC.UI:deploy: + stage: deploy + tags: + - win + variables: + APP_NAME: WebDoorCreator.UI + SOL_NAME: WebDoorCreator.UI + only: + - main + needs: ["WDC.UI:build"] + before_script: + - *nuget-fix + - dotnet restore "$env:SOL_NAME.sln" + script: + - dotnet build $env:APP_NAME/$env:APP_NAME.csproj + # IIS EXT + - dotnet publish -p:PublishProfile=IIS02.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 + # IIS INT + - 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 -# # ---------- RELEASE ---------- -# WDC.Api:release: -# stage: release -# tags: -# - win -# variables: -# APP_NAME: WebDoorCreator.API -# SOL_NAME: WebDoorCreator.UI -# only: -# - main -# except: -# - branches -# needs: ["WDC.Api:build"] -# before_script: -# - *nuget-fix -# - dotnet restore "$env:SOL_NAME.sln" -# artifacts: -# paths: -# - publish/ -# script: -# - dotnet build $env:APP_NAME/$env:APP_NAME.csproj -# - dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:APP_NAME/$env:APP_NAME.csproj -o:publish -p:verbosity=quiet -# # qui il deploy su nexus... -# - *hashBuild -# - *nexusUpload -# # script: -# # - dotnet publish -c Release -o ./publish GPW.WDC.Api/GPW.WDC.Api.csproj +# ---------- RELEASE ---------- +WDC.Api:release: + stage: release + tags: + - win + variables: + APP_NAME: WebDoorCreator.API + SOL_NAME: WebDoorCreator.UI + only: + - main + except: + - branches + needs: ["WDC.Api:build"] + before_script: + - *nuget-fix + - dotnet restore "$env:SOL_NAME.sln" + artifacts: + paths: + - publish/ + script: + - dotnet build $env:APP_NAME/$env:APP_NAME.csproj + - dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:APP_NAME/$env:APP_NAME.csproj -o:publish -p:verbosity=quiet + # qui il deploy su nexus... + - *hashBuild + - *nexusUpload + # script: + # - dotnet publish -c Release -o ./publish GPW.WDC.Api/GPW.WDC.Api.csproj -# WDC.UI:release: -# stage: release -# tags: -# - win -# variables: -# APP_NAME: WebDoorCreator.UI -# SOL_NAME: WebDoorCreator.UI -# only: -# - main -# except: -# - branches -# needs: ["WDC.UI:build"] -# artifacts: -# paths: -# - publish/ -# script: -# - dotnet build $env:APP_NAME/$env:APP_NAME.csproj -# - dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:APP_NAME/$env:APP_NAME.csproj -o:publish -p:verbosity=quiet -# # qui il deploy su nexus... -# - *hashBuild -# - *nexusUpload -# # script: -# # - dotnet publish -c Release -o ./publish GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj \ No newline at end of file +WDC.UI:release: + stage: release + tags: + - win + variables: + APP_NAME: WebDoorCreator.UI + SOL_NAME: WebDoorCreator.UI + only: + - main + except: + - branches + needs: ["WDC.UI:build"] + artifacts: + paths: + - publish/ + script: + - dotnet build $env:APP_NAME/$env:APP_NAME.csproj + - dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release $env:APP_NAME/$env:APP_NAME.csproj -o:publish -p:verbosity=quiet + # qui il deploy su nexus... + - *hashBuild + - *nexusUpload + # script: + # - dotnet publish -c Release -o ./publish GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj \ No newline at end of file diff --git a/DemoVB/Form1.vb b/DemoVB/Form1.vb index 6d77037..f91b70e 100644 --- a/DemoVB/Form1.vb +++ b/DemoVB/Form1.vb @@ -27,6 +27,9 @@ Public Class Form1 m_MaxCamInstances = value End Sub + Dim m_ExecutionThread As Thread + Dim m_bExecutionThreadStoped As Boolean = False + Private Sub btnTestPing_Click(sender As Object, e As EventArgs) Handles btnTestPing.Click ' chiamo test ping... risultatoPing = currWDC.testPing @@ -46,6 +49,10 @@ Public Class Form1 Private Sub StopProcess_Click(sender As Object, e As EventArgs) Handles StopProcess.Click m_bStopProcess = True + While Not m_bExecutionThreadStoped + Thread.Sleep(10) + End While + m_ExecutionThread = Nothing End Sub Private Structure MyProc @@ -64,6 +71,7 @@ Public Class Form1 While Not m_bStopProcess + ' se c'e' qualcosa da processare If currWDC.numTask2proc > 0 Then @@ -128,13 +136,158 @@ Public Class Form1 End Sub - Private Sub StartProcess_Click(sender As Object, e As EventArgs) Handles StartProcess.Click - + Private Sub ExecutionProcess() ' recupero Id dei DDF Dim sDdfRoot As String = "c:\EgtData\WebDoor\Ddf" Dim sCurrDdfDir As String = "" Dim nDdfId As Integer = 1 + ' Numero di core logici da utilizzare (minimo tra presenti sul PC e imposti da INI) + Dim nMaxThread As Integer = Math.Min(Environment.ProcessorCount, m_MaxCamInstances) + Dim bStopMainProcess As Boolean = False + Dim n30SecCounter As Integer = 0 + While Not bStopMainProcess + bStopMainProcess = m_bStopProcess + Dim bOk As Boolean = False + While Not bOk + ' ogni 30 secondi + If n30SecCounter = 30 OrElse n30SecCounter = 0 Then + ' verifica connessione + Dim risultatoPing As PingReply = currWDC.testPing + bOk = risultatoPing.Status = IPStatus.Success + If bOk Then + bOk = currWDC.testAlive + End If + Else bOk = True + End If + ' se connessione non ok o processo fermato, fermo i thread + If Not bOk OrElse bStopMainProcess Then + If Not IsNothing(ThreadList) AndAlso ThreadList.Count > 0 AndAlso Not IsNothing(ThreadList(0)) Then + ' li fermo + m_bStopProcess = True + ' verifico siano terminati + Dim bOneNotEnded As Boolean = True + While bOneNotEnded + bOneNotEnded = False + For Each Thread In ThreadList + If Thread.IsAlive Then + bOneNotEnded = True + End If + Next + End While + ' pulisco la lista + For ThreadIndex = 0 To ThreadList.Count - 1 + ThreadList(ThreadIndex) = Nothing + Next + End If + If bStopMainProcess Then + m_bExecutionThreadStoped = True + Return + End If + End If + If Not bOk Then Thread.Sleep(10) + End While + + If bOk AndAlso (IsNothing(ThreadList) OrElse ThreadList.Count = 0 OrElse IsNothing(ThreadList(0))) Then + ThreadList = New Thread(nMaxThread - 1) {} + For nThreadIndex = 0 To nMaxThread - 1 + ThreadList(nThreadIndex) = New Thread(Sub() + ThreadFunction() + End Sub) + ThreadList(nThreadIndex).SetApartmentState(ApartmentState.STA) + ' avvio thread di gestione della macchina che avvia la connessione + ThreadList(nThreadIndex).Start() + Thread.Sleep(10) + Next + End If + If n30SecCounter <= 30 Then + n30SecCounter += 1 + Else + n30SecCounter = 1 + End If + Thread.Sleep(1000) + End While + + End Sub + + Private Sub StartProcess_Click(sender As Object, e As EventArgs) Handles StartProcess.Click + m_bStopProcess = False + m_ExecutionThread = New Thread(Sub() + ExecutionProcess() + End Sub) + + m_ExecutionThread.SetApartmentState(ApartmentState.STA) + ' avvio thread di gestione della macchina che avvia la connessione + m_ExecutionThread.Start() + + '' recupero Id dei DDF + 'Dim sDdfRoot As String = "c:\EgtData\WebDoor\Ddf" + 'Dim sCurrDdfDir As String = "" + 'Dim nDdfId As Integer = 1 + + '' Numero di core logici da utilizzare (minimo tra presenti sul PC e imposti da INI) + 'Dim nMaxThread As Integer = Math.Min(Environment.ProcessorCount, m_MaxCamInstances) + 'Dim bStopMainProcess As Boolean = False + 'Dim n30SecCounter As Integer = 0 + 'While Not bStopMainProcess + ' bStopMainProcess = m_bStopProcess + ' Dim bOk As Boolean = False + ' While Not bOk + ' ' ogni 30 secondi + ' If n30SecCounter = 30 OrElse n30SecCounter = 0 Then + ' ' verifica connessione + ' Dim risultatoPing As PingReply = currWDC.testPing + ' bOk = risultatoPing.Status = IPStatus.Success + ' If bOk Then + ' bOk = currWDC.testAlive + ' End If + ' Else bOk = True + ' End If + ' ' se connessione non ok o processo fermato, fermo i thread + ' If Not bOk OrElse bStopMainProcess Then + ' If Not IsNothing(ThreadList) AndAlso ThreadList.Count > 0 Then + ' ' li fermo + ' m_bStopProcess = True + ' ' verifico siano terminati + ' Dim bOneNotEnded As Boolean = True + ' While bOneNotEnded + ' bOneNotEnded = False + ' For Each Thread In ThreadList + ' If Thread.IsAlive Then + ' bOneNotEnded = True + ' Exit For + ' End If + ' Next + ' End While + ' ' pulisco la lista + ' For Each Thread In ThreadList + ' Thread = Nothing + ' Next + ' End If + ' If bStopMainProcess Then Return + ' End If + ' If Not bOk Then Thread.Sleep(10) + ' End While + + ' If bOk AndAlso (IsNothing(ThreadList) OrElse ThreadList.Count = 0) Then + ' ThreadList = New Thread(nMaxThread - 1) {} + ' For nThreadIndex = 0 To nMaxThread - 1 + ' ThreadList(nThreadIndex) = New Thread(Sub() + ' ThreadFunction() + ' End Sub) + ' ThreadList(nThreadIndex).SetApartmentState(ApartmentState.STA) + ' ' avvio thread di gestione della macchina che avvia la connessione + ' ThreadList(nThreadIndex).Start() + ' Next + ' End If + ' If n30SecCounter <= 30 Then + ' n30SecCounter += 1 + ' Else + ' n30SecCounter = 1 + ' End If + ' Thread.Sleep(1000) + 'End While + 'Dim DdfDirs As String() = Directory.GetDirectories(sDdfRoot) 'If DdfDirs.Count = 0 Then ' sCurrDdfDir = sDdfRoot & "\0" @@ -157,17 +310,8 @@ Public Class Form1 ' End If 'End If - ' Numero di core logici da utilizzare (minimo tra presenti sul PC e imposti da INI) - Dim nMaxThread As Integer = Math.Min(Environment.ProcessorCount, m_MaxCamInstances) - ThreadList = New Thread(nMaxThread - 1) {} - For nThreadIndex = 0 To nMaxThread - 1 - ThreadList(nThreadIndex) = New Thread(Sub() - ThreadFunction() - End Sub) - ThreadList(nThreadIndex).SetApartmentState(ApartmentState.STA) - ' avvio thread di gestione della macchina che avvia la connessione - ThreadList(nThreadIndex).Start() - Next + + ' ' Lancio in parallelo più processi (senza superare il numero di core logici presenti) ' Dim vProc As MyProc() = New MyProc(nMaxThread - 1) {} diff --git a/WebDoorCreator.API/Controllers/QueueController.cs b/WebDoorCreator.API/Controllers/QueueController.cs index a02d448..155d356 100644 --- a/WebDoorCreator.API/Controllers/QueueController.cs +++ b/WebDoorCreator.API/Controllers/QueueController.cs @@ -84,6 +84,10 @@ namespace WebDoorCreator.API.Controllers var actProc = await QDataServ.RequestProcessing(); answ.Add("processing", actProc); + + + var actDone = await QDataServ.RequestDone(); + answ.Add("done", actProc); return answ; } diff --git a/WebDoorCreator.API/Properties/PublishProfiles/IIS-PROD.pubxml b/WebDoorCreator.API/Properties/PublishProfiles/IIS-PROD.pubxml new file mode 100644 index 0000000..8a9f0e5 --- /dev/null +++ b/WebDoorCreator.API/Properties/PublishProfiles/IIS-PROD.pubxml @@ -0,0 +1,27 @@ + + + + + MSDeploy + true + Release + Any CPU + https://iis04.egalware.com/WDC/SRV/swagger/index.html + false + c2109e71-4eae-4167-9052-175123ccc2bc + false + https://iis04.egalware.com:8172/MsDeploy.axd + Default Web Site/WDC/SRV + + false + WMSVC + true + true + jenkins + <_SavePWD>true + <_TargetId>IISWebDeploy + net6.0 + + \ No newline at end of file diff --git a/WebDoorCreator.API/Properties/PublishProfiles/IIS-PROD.pubxml.user b/WebDoorCreator.API/Properties/PublishProfiles/IIS-PROD.pubxml.user new file mode 100644 index 0000000..0173043 --- /dev/null +++ b/WebDoorCreator.API/Properties/PublishProfiles/IIS-PROD.pubxml.user @@ -0,0 +1,13 @@ + + + + + + AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAk75miMJLMkCTEelQutKpbwAAAAACAAAAAAADZgAAwAAAABAAAAB43BVhUmznhAu3pUfV1IfOAAAAAASAAACgAAAAEAAAAEV8hgbujDFfsMjS77NS2oYYAAAAUHPGFaVWgRqQPDU4wk5KGABmVHKko4/9FAAAANtaROBOcPHljx4RnmQHj5aHdtYk + True|2023-05-11T15:35:09.5858697Z;True|2022-01-27T10:34:09.2346456+01:00;True|2022-01-27T10:13:36.3080675+01:00;True|2022-01-27T10:05:45.6649507+01:00;True|2022-01-26T14:34:16.5263189+01:00;True|2022-01-26T13:04:22.2336648+01:00;False|2022-01-26T13:04:06.0677616+01:00;True|2021-11-08T09:03:37.7855257+01:00;True|2021-11-08T09:03:34.8263479+01:00;True|2021-11-08T09:03:31.8889390+01:00;True|2021-10-29T16:19:33.6539408+02:00;True|2021-10-29T16:19:28.2082360+02:00;True|2021-10-26T16:12:11.7740950+02:00;True|2021-10-26T16:11:56.2014641+02:00;True|2021-10-26T16:11:22.2897842+02:00;False|2021-10-26T16:10:58.3733037+02:00;False|2021-10-26T16:10:29.4793991+02:00;True|2021-10-21T17:35:11.9761128+02:00;True|2021-10-18T20:22:00.9305399+02:00;True|2021-10-18T18:32:29.4558070+02:00;True|2021-10-18T18:32:22.8950294+02:00;True|2021-10-18T18:16:13.7563877+02:00;True|2021-10-18T18:15:48.5678387+02:00;True|2021-10-18T12:45:45.7228681+02:00;True|2021-10-18T12:14:22.3221605+02:00;True|2021-10-18T12:14:15.7373530+02:00;True|2021-10-18T12:10:43.8607301+02:00; + + + \ No newline at end of file diff --git a/WebDoorCreator.API/Properties/PublishProfiles/IIS02.pubxml b/WebDoorCreator.API/Properties/PublishProfiles/IIS02.pubxml new file mode 100644 index 0000000..6ef3826 --- /dev/null +++ b/WebDoorCreator.API/Properties/PublishProfiles/IIS02.pubxml @@ -0,0 +1,27 @@ + + + + + MSDeploy + true + Release + Any CPU + https://iis02.egalware.com/WDC/SRV/swagger/index.html + false + c2109e71-4eae-4167-9052-175123ccc2bc + false + https://iis02.egalware.com:8172/MsDeploy.axd + Default Web Site/WDC/SRV + + false + WMSVC + true + true + jenkins + <_SavePWD>true + <_TargetId>IISWebDeploy + net6.0 + + \ No newline at end of file diff --git a/WebDoorCreator.API/Properties/PublishProfiles/IISProfile.pubxml b/WebDoorCreator.API/Properties/PublishProfiles/IISProfile.pubxml new file mode 100644 index 0000000..7c9343f --- /dev/null +++ b/WebDoorCreator.API/Properties/PublishProfiles/IISProfile.pubxml @@ -0,0 +1,19 @@ + + + + + Package + Release + Any CPU + + true + false + c2109e71-4eae-4167-9052-175123ccc2bc + bin\publish\WDC.API.zip + true + Default Web Site/WDC/SRV + <_TargetId>IISWebDeployPackage + + \ No newline at end of file diff --git a/WebDoorCreator.API/WebDoorCreator.API.csproj b/WebDoorCreator.API/WebDoorCreator.API.csproj index 3a61c6f..0f32449 100644 --- a/WebDoorCreator.API/WebDoorCreator.API.csproj +++ b/WebDoorCreator.API/WebDoorCreator.API.csproj @@ -7,7 +7,14 @@ + <_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS-PROD.pubxml" /> <_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS01.pubxml" /> + <_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS02.pubxml" /> + <_WebToolingArtifacts Remove="Properties\PublishProfiles\IISProfile.pubxml" /> + + + + diff --git a/WebDoorCreator.Data/Services/QueueDataService.cs b/WebDoorCreator.Data/Services/QueueDataService.cs index f1b214f..1823114 100644 --- a/WebDoorCreator.Data/Services/QueueDataService.cs +++ b/WebDoorCreator.Data/Services/QueueDataService.cs @@ -139,6 +139,33 @@ namespace WebDoorCreator.Data.Services return fatto; } + /// + /// Get Queue request done + /// + /// Dictionary of DoorId, saveVersNumb + public async Task> RequestDone() + { + string source = "REDIS"; + long numReq = 0; + Dictionary dictResult = new Dictionary(); + // cerco da cache + RedisKey currKey = new RedisKey(Constants.CALC_REQ_DDF_CACHE); + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + numReq = redisDb.HashLength(currKey); + if (numReq > 0) + { + var rawData = await redisDb.HashGetAllAsync(currKey); + foreach (var item in rawData) + { + dictResult.Add($"{item.Name}", $"{item.Value}"); + } + } + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Debug($"RequestDone | {source} in: {ts.TotalMilliseconds} ms"); + return dictResult; + } /// /// Remove for single hash record /// @@ -394,6 +421,15 @@ namespace WebDoorCreator.Data.Services await RequestProcessingRemove(item.Name!); fatto = true; } + // cerco le richieste processed + currKey = new RedisKey(Constants.CALC_REQ_DONE); + rawData = await redisDb.HashGetAllAsync(currKey); + foreach (var item in rawData) + { + await RequestPendingUpsert(item.Name!, item.Value!); + await RequestDoneRemove(item.Name!); + fatto = true; + } stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; Log.Debug($"ResetQueue | REDIS in: {ts.TotalMilliseconds} ms"); diff --git a/WebDoorCreator.UI/Properties/PublishProfiles/IIS-PROD.pubxml b/WebDoorCreator.UI/Properties/PublishProfiles/IIS-PROD.pubxml new file mode 100644 index 0000000..fb2b7cc --- /dev/null +++ b/WebDoorCreator.UI/Properties/PublishProfiles/IIS-PROD.pubxml @@ -0,0 +1,27 @@ + + + + + MSDeploy + true + Release + Any CPU + https://iis04.egalware.com/WDC/UI/ + false + c2109e71-4eae-4167-9052-175123ccc2bc + false + https://iis04.egalware.com:8172/MsDeploy.axd + Default Web Site/WDC/UI + + false + WMSVC + true + true + jenkins + <_SavePWD>true + <_TargetId>IISWebDeploy + net6.0 + + \ No newline at end of file diff --git a/WebDoorCreator.UI/Properties/PublishProfiles/IIS02.pubxml b/WebDoorCreator.UI/Properties/PublishProfiles/IIS02.pubxml new file mode 100644 index 0000000..b77615e --- /dev/null +++ b/WebDoorCreator.UI/Properties/PublishProfiles/IIS02.pubxml @@ -0,0 +1,27 @@ + + + + + MSDeploy + true + Release + Any CPU + https://iis02.egalware.com/WDC/UI/ + false + c2109e71-4eae-4167-9052-175123ccc2bc + false + https://iis02.egalware.com:8172/MsDeploy.axd + Default Web Site/WDC/UI + + false + WMSVC + true + true + jenkins + <_SavePWD>true + <_TargetId>IISWebDeploy + net6.0 + + \ No newline at end of file diff --git a/WebDoorCreator.UI/WebDoorCreator.UI.csproj b/WebDoorCreator.UI/WebDoorCreator.UI.csproj index 6ff3724..644fabd 100644 --- a/WebDoorCreator.UI/WebDoorCreator.UI.csproj +++ b/WebDoorCreator.UI/WebDoorCreator.UI.csproj @@ -13,7 +13,10 @@ + <_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS-PROD.pubxml" /> <_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS01.pubxml" /> + <_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS02.pubxml" /> + <_WebToolingArtifacts Remove="Properties\PublishProfiles\IISProfile.pubxml" /> diff --git a/WeebDoorCreator.SDK/WDC.cs b/WeebDoorCreator.SDK/WDC.cs index 7e8bb18..f128488 100644 --- a/WeebDoorCreator.SDK/WDC.cs +++ b/WeebDoorCreator.SDK/WDC.cs @@ -195,16 +195,23 @@ namespace WeebDoorCreator.SDK // cerco online RestClient client = new RestClient(apiUrl); var request = new RestRequest(URL); - var response = client.Get(request); - // controllo status code risposta - if (response.StatusCode == System.Net.HttpStatusCode.OK) + try { - // deserializzo risposta - answ = response.Content; + var response = client.Get(request); + // controllo status code risposta + if (response.StatusCode == System.Net.HttpStatusCode.OK) + { + // deserializzo risposta + answ = response.Content; + } + else + { + answ = "KO"; + } } - else + catch { - answ = "KO"; + answ = "ERR"; } // restituisco valore! return answ; @@ -242,7 +249,9 @@ namespace WeebDoorCreator.SDK } } catch - { } + { + answ = "ERR"; + } // restituisco valore! return answ; } @@ -274,7 +283,9 @@ namespace WeebDoorCreator.SDK } } catch - { } + { + answ = "ERR"; + } // restituisco valore! return answ; } @@ -305,16 +316,23 @@ namespace WeebDoorCreator.SDK { request.AddJsonBody(payload); } - var response = client.Post(request); - // controllo status code risposta - if (response.StatusCode == System.Net.HttpStatusCode.OK) + try { - // deserializzo risposta - answ = response.Content; + var response = client.Post(request); + // controllo status code risposta + if (response.StatusCode == System.Net.HttpStatusCode.OK) + { + // deserializzo risposta + answ = response.Content; + } + else + { + answ = "KO"; + } } - else + catch { - answ = "KO"; + answ = "ERR"; } // restituisco valore! return answ;