From f1d94907967039824da91f6019ea41135842bb67 Mon Sep 17 00:00:00 2001 From: Gaetano Savo Date: Wed, 26 Mar 2025 11:50:49 +0100 Subject: [PATCH] scarica i moduli --- .gitignore | 8 ++---- Sync-Projects.ps1 | 58 +++++++++++++++++++++++++++++++++++--------- build-and-deploy.ps1 | 4 +-- 3 files changed, 51 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 5e13219..c4fce3b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,9 +2,5 @@ *.log # Project directories -arm*/ -asset-gui/ -AmazonAWS.S3/ -aspose-manager/ -data-quality/ -shared-javaEE/ +workspace/ + diff --git a/Sync-Projects.ps1 b/Sync-Projects.ps1 index 843f9d6..2e4a073 100644 --- a/Sync-Projects.ps1 +++ b/Sync-Projects.ps1 @@ -1,24 +1,42 @@ -# PowerShell script to sync arm_am-pom and asset-gui projects from SVN +# PowerShell script to checkout arm_am-pom, asset-gui and used modules and to build modules # Configuration $SVN_BASE_URL = "https://svn.armundia.com/svn/PRJarm_am/branches/ISPBEstero/ADV360-BES-JB8_B2024_2" $SVN_BASE_URL_BW2_LIB = "https://svn.armundia.com/svn/PRJbw2/branches/LIB-JK10" - -# Define workspace directory +$SVN_BASE_URL_ARM_LIB = "https://svn.armundia.com/svn/PRJarm_am/branches/LIB-JK10" $WORKSPACE_DIR = Join-Path $PSScriptRoot "workspace" -# Define projects and their SVN URLs +# Project paths $PROJECTS = @{ - "arm_am-pom" = $SVN_BASE_URL + "arm_am-pom" = "$SVN_BASE_URL/arm_am-pom" "asset-gui" = "$SVN_BASE_URL/asset-gui" -} + "AmazonAWS.S3" = "$SVN_BASE_URL_BW2_LIB/AmazonAWS.S3" + "arm-core-batch" = "$SVN_BASE_URL_ARM_LIB/arm-batch-module" + "arm-core-document" = "$SVN_BASE_URL_BW2_LIB/arm-core-document-ispb" + "arm-core-event" = "$SVN_BASE_URL_BW2_LIB/arm-core-event" + "arm-core-perfo" = "$SVN_BASE_URL_ARM_LIB/arm-perfo-ispb" + "arm-core-print" = "$SVN_BASE_URL/arm-core-print/arm-core-print" + "arm-core-querybuilder" = "$SVN_BASE_URL_ARM_LIB/arm-core-querybuilder" + "arm-core-quest" = "$SVN_BASE_URL/arm-core-quest" + "arm-core-users" = "$SVN_BASE_URL_ARM_LIB/arm-core-users" + "arm-core-utility" = "$SVN_BASE_URL_ARM_LIB/arm-core-utility" + "arm-core-utility-extra" = "$SVN_BASE_URL_ARM_LIB/arm-core-utility-extra" + "arm-core-var" = "$SVN_BASE_URL_ARM_LIB/arm-calcolo-VaR" + "arm-fileExporter" = "$SVN_BASE_URL_ARM_LIB/arm-fileExporter" + "arm-limiti" = "$SVN_BASE_URL_ARM_LIB/arm-limiti" + "arm-quadratore-portafogli" = "$SVN_BASE_URL_ARM_LIB/arm-quadratore-portafogli" + "arm-util" = "$SVN_BASE_URL_ARM_LIB/arm-util" + "aspose-manager" = "$SVN_BASE_URL/arm-core-print/aspose-manager" + "data-quality" = "$SVN_BASE_URL_ARM_LIB/data-quality-default" + "shared-javaEE" = "$SVN_BASE_URL_ARM_LIB/Shared-JavaEE" + } # Create workspace directory if it doesn't exist if (-not (Test-Path $WORKSPACE_DIR)) { New-Item -ItemType Directory -Path $WORKSPACE_DIR -Force } -# Function to sync a project from SVN +# Function to checkout or update a project function Sync-Project { param ( [string]$projectName, @@ -39,9 +57,9 @@ function Sync-Project { } if ($LASTEXITCODE -eq 0) { - Write-Host "$projectName successfully synced" -ForegroundColor Green + Write-Host "$projectName successfully checked out/updated" -ForegroundColor Green } else { - Write-Host "Error syncing $projectName" -ForegroundColor Red + Write-Host "Error checking out/updating $projectName" -ForegroundColor Red } } @@ -49,7 +67,7 @@ function Sync-Project { $originalDirectory = Get-Location try { - # Sync each project + # Checkout/update each project foreach ($project in $PROJECTS.GetEnumerator()) { Sync-Project -projectName $project.Key -svnUrl $project.Value -targetDir $WORKSPACE_DIR } @@ -80,8 +98,26 @@ try { # Additional components "data-quality", # Data quality - "AmazonAWS.S3" # AWS S3 integration + "AmazonAWS.S3", # AWS S3 integration + "aspose-manager" # Document processing ) + + # Build each project in order + foreach ($project in $BUILD_ORDER) { + Write-Host "Building $project..." -ForegroundColor Yellow + Set-Location (Join-Path $WORKSPACE_DIR $project) + mvn clean install -DskipTests + + if ($LASTEXITCODE -eq 0) { + Write-Host "$project successfully built and installed" -ForegroundColor Green + } else { + Write-Host "Error building $project" -ForegroundColor Red + exit 1 + } + } + +} catch { + Write-Host "An error occurred: $_" -ForegroundColor Red } finally { # Restore original directory Set-Location $originalDirectory diff --git a/build-and-deploy.ps1 b/build-and-deploy.ps1 index 5a7a535..5a443cd 100644 --- a/build-and-deploy.ps1 +++ b/build-and-deploy.ps1 @@ -2,7 +2,7 @@ # Configuration $JBOSS_HOME = "C:\Dev2012\BUILDERS\jboss-eap-8.0" -$PROJECT_DIR = "C:\Dev2012\source\WindSurf\adv8\arm_am-pom" +$PROJECT_DIR = Join-Path $PSScriptRoot "workspace\arm_am-pom" $DEPLOYMENT_DIR = "$JBOSS_HOME\standalone\deployments" $MAVEN_PROFILE = "adv360-DEV" # Default development profile $JAVA_HOME = "C:\Dev2012\BUILDERS\java\jdk-17.0.9" # Path to Java 17 @@ -78,7 +78,7 @@ if ($LASTEXITCODE -ne 0) { # Finally build the EAR module with debug output Write-Host "Building EAR module..." -ForegroundColor Yellow -Set-Location "$PROJECT_DIR\arm_am-ear" +Set-Location (Join-Path $PROJECT_DIR "arm_am-ear") mvn clean package -DskipTests "-P$MAVEN_PROFILE" if ($LASTEXITCODE -ne 0) { Write-Host "Maven EAR module build failed!" -ForegroundColor Red