diff --git a/delete-bin-obj-folders.bat b/delete-bin-obj-folders.bat deleted file mode 100644 index 9e2a02a6..00000000 --- a/delete-bin-obj-folders.bat +++ /dev/null @@ -1,16 +0,0 @@ -@ECHO off -cls - -ECHO Deleting all BIN and OBJ folders... -ECHO. - -FOR /d /r . %%d in (bin,obj, logs, node_modules) DO (( - ECHO.Deleting: %%d - rd /s/q "%%d" - ) - ) -) - -ECHO. -ECHO.BIN and OBJ folders have been successfully deleted. Press any key to exit. -pause > nul \ No newline at end of file diff --git a/delete-temp-directories.bat b/delete-temp-directories.bat new file mode 100644 index 00000000..d9e2badf --- /dev/null +++ b/delete-temp-directories.bat @@ -0,0 +1,21 @@ +@echo off +cls + +set directories= bin, obj, logs, node_modules +set /a count = 0 + +echo Deleting all following directories: +for %%d in (%directories%) do echo %%d +echo. + +for /d /r . %%d in (%directories%) do if exist "%%d" ( + echo. Deleting: %%d + rd /s/q "%%d" + set /a count += 1 +) + +echo. +echo The specified directories were successfully scanned. +echo Number of deleted directories: %count% +echo Press any key to exit. +pause > nul diff --git a/etc/k8s/azure/azure-pipelines.yml b/etc/k8s/azure/azure-pipelines.yml index d5273739..f5c78b6a 100644 --- a/etc/k8s/azure/azure-pipelines.yml +++ b/etc/k8s/azure/azure-pipelines.yml @@ -1,7 +1,7 @@ trigger: branches: include: - - skoc/azure-pipeline + - main paths: include: - apps/angular/src/** @@ -87,20 +87,20 @@ stages: containerRegistry: $(dockerRegistryServiceConnection) tags: | $(tag) - # - task: HelmDeploy@0 - # #condition: and(succeeded(), eq(variables['hasChangedAngular'], 'true')) - # displayName: 'Deploy Angular App' - # inputs: - # connectionType: Kubernetes Service Connection - # kubernetesServiceConnection: 'aks-demoms' - # namespace: 'eshop' - # command: 'upgrade' - # hartType: 'FilePath' - # chartPath: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/web' - # releaseName: 'administration' - # overrideValues: 'image.tag=$(tag)' - # valueFile: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/web/values.yaml' - # waitForExecution: false + - task: HelmDeploy@0 + #condition: and(succeeded(), eq(variables['hasChangedAngular'], 'true')) + displayName: 'Deploy Angular App' + inputs: + connectionType: Kubernetes Service Connection + kubernetesServiceConnection: 'aks-demoms' + namespace: 'eshop' + command: 'upgrade' + chartType: 'FilePath' + chartPath: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/web' + releaseName: 'web' + overrideValues: 'image.tag=$(tag)' + valueFile: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/web/values.yaml' + waitForExecution: false # Public Web - task: Docker@2 @@ -123,20 +123,20 @@ stages: containerRegistry: $(dockerRegistryServiceConnection) tags: | $(tag) - # - task: HelmDeploy@0 - # #condition: and(succeeded(), eq(variables['hasChangedPublicWeb'], 'true')) - # displayName: 'Deploy Public Web' - # inputs: - # connectionType: Kubernetes Service Connection - # kubernetesServiceConnection: 'aks-demoms' - # namespace: 'eshop' - # command: 'upgrade' - # hartType: 'FilePath' - # chartPath: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/public-web' - # releaseName: 'public-web' - # overrideValues: 'image.tag=$(tag)' - # valueFile: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/public-web/values.yaml' - # waitForExecution: false + - task: HelmDeploy@0 + #condition: and(succeeded(), eq(variables['hasChangedPublicWeb'], 'true')) + displayName: 'Deploy Public Web' + inputs: + connectionType: Kubernetes Service Connection + kubernetesServiceConnection: 'aks-demoms' + namespace: 'eshop' + command: 'upgrade' + chartType: 'FilePath' + chartPath: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/public-web' + releaseName: 'public-web' + overrideValues: 'image.tag=$(tag)' + valueFile: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/public-web/values.yaml' + waitForExecution: false # Web Gateway - task: Docker@2 @@ -159,20 +159,20 @@ stages: containerRegistry: $(dockerRegistryServiceConnection) tags: | $(tag) - # - task: HelmDeploy@0 - # #condition: and(succeeded(), eq(variables['hasChangedWebGateway'], 'true')) - # displayName: 'Deploy Web Gateway' - # inputs: - # connectionType: Kubernetes Service Connection - # kubernetesServiceConnection: 'aks-demoms' - # namespace: 'eshop' - # command: 'upgrade' - # hartType: 'FilePath' - # chartPath: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/gateway-web' - # releaseName: 'web-gateway' - # overrideValues: 'image.tag=$(tag)' - # valueFile: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/gateway-web/values.yaml' - # waitForExecution: false + - task: HelmDeploy@0 + #condition: and(succeeded(), eq(variables['hasChangedWebGateway'], 'true')) + displayName: 'Deploy Web Gateway' + inputs: + connectionType: Kubernetes Service Connection + kubernetesServiceConnection: 'aks-demoms' + namespace: 'eshop' + command: 'upgrade' + chartType: 'FilePath' + chartPath: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/gateway-web' + releaseName: 'web-gateway' + overrideValues: 'image.tag=$(tag)' + valueFile: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/gateway-web/values.yaml' + waitForExecution: false # Web Public Gateway - task: Docker@2 @@ -195,20 +195,20 @@ stages: containerRegistry: $(dockerRegistryServiceConnection) tags: | $(tag) - # - task: HelmDeploy@0 - # #condition: and(succeeded(), eq(variables['hasChangedWebPublicGateway'], 'true')) - # displayName: 'Deploy Web Public Gateway' - # inputs: - # connectionType: Kubernetes Service Connection - # kubernetesServiceConnection: 'aks-demoms' - # namespace: 'eshop' - # command: 'upgrade' - # hartType: 'FilePath' - # chartPath: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/gateway-web-public' - # releaseName: 'web-public-gateway' - # overrideValues: 'image.tag=$(tag)' - # valueFile: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/gateway-web-public/values.yaml' - # waitForExecution: false + - task: HelmDeploy@0 + #condition: and(succeeded(), eq(variables['hasChangedWebPublicGateway'], 'true')) + displayName: 'Deploy Web Public Gateway' + inputs: + connectionType: Kubernetes Service Connection + kubernetesServiceConnection: 'aks-demoms' + namespace: 'eshop' + command: 'upgrade' + chartType: 'FilePath' + chartPath: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/gateway-web-public' + releaseName: 'web-public-gateway' + overrideValues: 'image.tag=$(tag)' + valueFile: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/gateway-web-public/values.yaml' + waitForExecution: false # Administration - task: Docker@2 @@ -231,20 +231,20 @@ stages: containerRegistry: $(dockerRegistryServiceConnection) tags: | $(tag) - # - task: HelmDeploy@0 - # #condition: and(succeeded(), eq(variables['hasChangedAdministration'], 'true')) - # displayName: 'Deploy Administration' - # inputs: - # connectionType: Kubernetes Service Connection - # kubernetesServiceConnection: 'aks-demoms' - # namespace: 'eshop' - # command: 'upgrade' - # hartType: 'FilePath' - # chartPath: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/administration' - # releaseName: 'administration' - # overrideValues: 'image.tag=$(tag)' - # valueFile: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/administration/values.yaml' - # waitForExecution: false + - task: HelmDeploy@0 + #condition: and(succeeded(), eq(variables['hasChangedAdministration'], 'true')) + displayName: 'Deploy Administration' + inputs: + connectionType: Kubernetes Service Connection + kubernetesServiceConnection: 'aks-demoms' + namespace: 'eshop' + command: 'upgrade' + chartType: 'FilePath' + chartPath: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/administration' + releaseName: 'administration' + overrideValues: 'image.tag=$(tag)' + valueFile: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/administration/values.yaml' + waitForExecution: false # Basket - task: Docker@2 @@ -267,20 +267,20 @@ stages: containerRegistry: $(dockerRegistryServiceConnection) tags: | $(tag) - # - task: HelmDeploy@0 - # #condition: and(succeeded(), eq(variables['hasChangedBasket'], 'true')) - # displayName: 'Deploy Basket' - # inputs: - # connectionType: Kubernetes Service Connection - # kubernetesServiceConnection: 'aks-demoms' - # namespace: 'eshop' - # command: 'upgrade' - # hartType: 'FilePath' - # chartPath: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/basket' - # releaseName: 'basket' - # overrideValues: 'image.tag=$(tag)' - # valueFile: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/basket/values.yaml' - # waitForExecution: false + - task: HelmDeploy@0 + #condition: and(succeeded(), eq(variables['hasChangedBasket'], 'true')) + displayName: 'Deploy Basket' + inputs: + connectionType: Kubernetes Service Connection + kubernetesServiceConnection: 'aks-demoms' + namespace: 'eshop' + command: 'upgrade' + chartType: 'FilePath' + chartPath: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/basket' + releaseName: 'basket' + overrideValues: 'image.tag=$(tag)' + valueFile: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/basket/values.yaml' + waitForExecution: false # Catalog - task: Docker@2 @@ -303,20 +303,20 @@ stages: containerRegistry: $(dockerRegistryServiceConnection) tags: | $(tag) - # - task: HelmDeploy@0 - # #condition: and(succeeded(), eq(variables['hasChangedCatalog'], 'true')) - # displayName: 'Deploy Catalog' - # inputs: - # connectionType: Kubernetes Service Connection - # kubernetesServiceConnection: 'aks-demoms' - # namespace: 'eshop' - # command: 'upgrade' - # hartType: 'FilePath' - # chartPath: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/catalog' - # releaseName: 'catalog' - # overrideValues: 'image.tag=$(tag)' - # valueFile: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/catalog/values.yaml' - # waitForExecution: false + - task: HelmDeploy@0 + #condition: and(succeeded(), eq(variables['hasChangedCatalog'], 'true')) + displayName: 'Deploy Catalog' + inputs: + connectionType: Kubernetes Service Connection + kubernetesServiceConnection: 'aks-demoms' + namespace: 'eshop' + command: 'upgrade' + chartType: 'FilePath' + chartPath: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/catalog' + releaseName: 'catalog' + overrideValues: 'image.tag=$(tag)' + valueFile: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/catalog/values.yaml' + waitForExecution: false # cmskit - task: Docker@2 @@ -339,20 +339,20 @@ stages: containerRegistry: $(dockerRegistryServiceConnection) tags: | $(tag) - # - task: HelmDeploy@0 - # #condition: and(succeeded(), eq(variables['hasChangedCmsKit'], 'true')) - # displayName: 'Deploy CmsKit' - # inputs: - # connectionType: Kubernetes Service Connection - # kubernetesServiceConnection: 'aks-demoms' - # namespace: 'eshop' - # command: 'upgrade' - # hartType: 'FilePath' - # chartPath: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/cmskit' - # releaseName: 'cmskit' - # overrideValues: 'image.tag=$(tag)' - # valueFile: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/cmskit/values.yaml' - # waitForExecution: false + - task: HelmDeploy@0 + #condition: and(succeeded(), eq(variables['hasChangedCmsKit'], 'true')) + displayName: 'Deploy CmsKit' + inputs: + connectionType: Kubernetes Service Connection + kubernetesServiceConnection: 'aks-demoms' + namespace: 'eshop' + command: 'upgrade' + chartType: 'FilePath' + chartPath: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/cmskit' + releaseName: 'cmskit' + overrideValues: 'image.tag=$(tag)' + valueFile: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/cmskit/values.yaml' + waitForExecution: false # Identity - task: Docker@2 @@ -375,20 +375,20 @@ stages: containerRegistry: $(dockerRegistryServiceConnection) tags: | $(tag) - # - task: HelmDeploy@0 - # #condition: and(succeeded(), eq(variables['hasChangedIdentity'], 'true')) - # displayName: 'Deploy Identity' - # inputs: - # connectionType: Kubernetes Service Connection - # kubernetesServiceConnection: 'aks-demoms' - # namespace: 'eshop' - # command: 'upgrade' - # hartType: 'FilePath' - # chartPath: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/identity' - # releaseName: 'identity' - # overrideValues: 'image.tag=$(tag)' - # valueFile: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/identity/values.yaml' - # waitForExecution: false + - task: HelmDeploy@0 + #condition: and(succeeded(), eq(variables['hasChangedIdentity'], 'true')) + displayName: 'Deploy Identity' + inputs: + connectionType: Kubernetes Service Connection + kubernetesServiceConnection: 'aks-demoms' + namespace: 'eshop' + command: 'upgrade' + chartType: 'FilePath' + chartPath: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/identity' + releaseName: 'identity' + overrideValues: 'image.tag=$(tag)' + valueFile: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/identity/values.yaml' + waitForExecution: false # Ordering - task: Docker@2 @@ -411,20 +411,20 @@ stages: containerRegistry: $(dockerRegistryServiceConnection) tags: | $(tag) - # - task: HelmDeploy@0 - # #condition: and(succeeded(), eq(variables['hasChangedOrdering'], 'true')) - # displayName: 'Deploy Ordering' - # inputs: - # connectionType: Kubernetes Service Connection - # kubernetesServiceConnection: 'aks-demoms' - # namespace: 'eshop' - # command: 'upgrade' - # hartType: 'FilePath' - # chartPath: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/ordering' - # releaseName: 'ordering' - # overrideValues: 'image.tag=$(tag)' - # valueFile: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/ordering/values.yaml' - # waitForExecution: false + - task: HelmDeploy@0 + #condition: and(succeeded(), eq(variables['hasChangedOrdering'], 'true')) + displayName: 'Deploy Ordering' + inputs: + connectionType: Kubernetes Service Connection + kubernetesServiceConnection: 'aks-demoms' + namespace: 'eshop' + command: 'upgrade' + chartType: 'FilePath' + chartPath: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/ordering' + releaseName: 'ordering' + overrideValues: 'image.tag=$(tag)' + valueFile: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/ordering/values.yaml' + waitForExecution: false # Payment - task: Docker@2 @@ -447,17 +447,17 @@ stages: containerRegistry: $(dockerRegistryServiceConnection) tags: | $(tag) - # - task: HelmDeploy@0 - # #condition: and(succeeded(), eq(variables['hasChangedPayment'], 'true')) - # displayName: 'Deploy Payment' - # inputs: - # connectionType: Kubernetes Service Connection - # kubernetesServiceConnection: 'aks-demoms' - # namespace: 'eshop' - # command: 'upgrade' - # hartType: 'FilePath' - # chartPath: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/payment' - # releaseName: 'payment' - # overrideValues: 'image.tag=$(tag)' - # valueFile: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/payment/values.yaml' - # waitForExecution: false \ No newline at end of file + - task: HelmDeploy@0 + #condition: and(succeeded(), eq(variables['hasChangedPayment'], 'true')) + displayName: 'Deploy Payment' + inputs: + connectionType: Kubernetes Service Connection + kubernetesServiceConnection: 'aks-demoms' + namespace: 'eshop' + command: 'upgrade' + chartType: 'FilePath' + chartPath: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/payment' + releaseName: 'payment' + overrideValues: 'image.tag=$(tag)' + valueFile: 'devops/eshoponabp/k8s/eshoponabp-istio/charts/payment/values.yaml' + waitForExecution: false \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.Application/UserLoggedInEventHandler.cs b/services/identity/src/EShopOnAbp.IdentityService.Application/UserLoggedInEventHandler.cs index 058db2d8..075b1283 100644 --- a/services/identity/src/EShopOnAbp.IdentityService.Application/UserLoggedInEventHandler.cs +++ b/services/identity/src/EShopOnAbp.IdentityService.Application/UserLoggedInEventHandler.cs @@ -1,8 +1,11 @@ -using System.Threading.Tasks; +using System.Linq; +using System.Threading.Tasks; using EShopOnAbp.IdentityService.ETOs; +using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.Logging; using Volo.Abp; using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Repositories; using Volo.Abp.EventBus.Distributed; using Volo.Abp.Identity; using Volo.Abp.Uow; @@ -13,16 +16,22 @@ public class UserLoggedInEventHandler : IDistributedEventHandler _logger; + private readonly IIdentityUserRepository _identityUserRepository; + private readonly ILookupNormalizer _lookupNormalizer; - public UserLoggedInEventHandler(IdentityUserManager userManager, ILogger logger) + public UserLoggedInEventHandler(IdentityUserManager userManager, + ILogger logger, + IIdentityUserRepository identityUserRepository, + ILookupNormalizer lookupNormalizer) { _userManager = userManager; _logger = logger; + _identityUserRepository = identityUserRepository; + _lookupNormalizer = lookupNormalizer; } - - + [UnitOfWork] - public async virtual Task HandleEventAsync(UserLoggedInEto eventData) + public virtual async Task HandleEventAsync(UserLoggedInEto eventData) { if (eventData == null) { @@ -59,8 +68,15 @@ public class UserLoggedInEventHandler : IDistributedEventHandler