hotel_gui_11326c.patch
| new/build.xml 2026-05-15 08:59:35 +0000 | ||
|---|---|---|
| 610 | 610 |
<fileset dir="ddl" /> |
| 611 | 611 |
</copy> |
| 612 | 612 |
</target> |
| 613 | ||
| 614 |
<target name="deploy.appcds" depends="init-ant-contrib" |
|
| 615 |
description="Generate the list of classes to include in the AppCDS archive." > |
|
| 616 |
<!-- Server AppCDS --> |
|
| 617 |
|
|
| 618 |
<!-- Client AppCDS --> |
|
| 619 |
<exec executable="bash" dir="${deploy.home}/server" failonerror="true" osfamily="unix">
|
|
| 620 |
<arg value="deploy_appcds.sh"/> |
|
| 621 |
<arg value="${deploy.home}/lib/p2j.jar"/>
|
|
| 622 |
</exec> |
|
| 623 |
<exec executable="pwsh" dir="${deploy.home}/server" failonerror="true" osfamily="windows">
|
|
| 624 |
<arg value="-ExecutionPolicy"/> |
|
| 625 |
<arg value="Bypass"/> |
|
| 626 |
<arg value="-File"/> |
|
| 627 |
<arg value="deploy_appcds.ps1"/> |
|
| 628 |
<arg value="${deploy.home}/lib/p2j.jar"/>
|
|
| 629 |
</exec> |
|
| 630 |
</target> |
|
| 613 | 631 |
|
| 614 | 632 |
<!-- ==================== Jar Targets ==================================== --> |
| 615 | 633 | |
| ... | ... | |
| 853 | 871 |
data/**/*.p2o |
| 854 | 872 |
cfg/*.xml |
| 855 | 873 |
deploy/lib/** |
| 874 |
deploy/lib.client/** |
|
| 856 | 875 |
deploy/client/** |
| 857 | 876 |
deploy/server/** |
| 858 | 877 |
*.xml |
| ... | ... | |
| 875 | 894 |
<!-- exclude the AspectJ tools --> |
| 876 | 895 |
<fileset dir="${fwd.lib.home}" excludes="aspectjtools.jar, fwdspi.jar"/>
|
| 877 | 896 |
</copy> |
| 897 | ||
| 898 |
<!-- Copy client jars --> |
|
| 899 |
<copy todir="${deploy.home}/lib.client">
|
|
| 900 |
<fileset dir="${fwd.home}/p2j/dist/client" excludes="**/aspectjtools.jar"/>
|
|
| 901 |
<fileset dir="${fwd.lib.home}" includes="p2j.jar, libp2j.so, p2j.dll"/>
|
|
| 902 |
</copy> |
|
| 878 | 903 |
</target> |
| 879 | 904 | |
| 880 | 905 |
<!-- deploy the application jars, NOT FWD --> |
| ... | ... | |
| 918 | 943 | |
| 919 | 944 |
<!-- ==================== Clean Targets ==================================== --> |
| 920 | 945 | |
| 921 |
<target name="clean" depends="clean.convert, clean.build, clean.dist" description="Remove all clean.build, clean.convert, clean.dist files." /> |
|
| 946 |
<target name="clean" depends="clean.convert, clean.build, clean.dist, clean.appcds" |
|
| 947 |
description="Remove all clean.build, clean.convert, clean.dist files." |
|
| 948 |
/> |
|
| 922 | 949 | |
| 923 | 950 |
<target name="clean.build" description="Remove all built files from the conversion process." > |
| 924 | 951 |
<delete includeemptydirs="true" failonerror="false"> |
| ... | ... | |
| 1024 | 1051 |
<target name="create.db" depends="create.db.h2, create.db.pg, create.db.mariadb, create.db.sqlserver" |
| 1025 | 1052 |
description="Create empty database instance for all enabled database types." /> |
| 1026 | 1053 |
|
| 1054 |
<target name="clean.appcds" |
|
| 1055 |
description="Remove any generated AppCDS archives and related files." > |
|
| 1056 |
<delete dir="${deploy.home}/client/appcds" />
|
|
| 1057 |
</target> |
|
| 1058 |
|
|
| 1027 | 1059 |
<target name="import.db" depends="import.db.h2, import.db.pg, import.db.mariadb, import.db.sqlserver" |
| 1028 | 1060 |
description="Create empty database instance and import data for all enabled database types." /> |
| 1029 | 1061 | |
| new/deploy/server/deploy_appcds.ps1 2026-05-15 08:06:55 +0000 | ||
|---|---|---|
| 1 |
param ( |
|
| 2 |
[Parameter(Position=0)] |
|
| 3 |
[string]$P2jJar = "..\lib\p2j.jar", |
|
| 4 |
|
|
| 5 |
[string]$DirXml = "", |
|
| 6 |
[string]$AppCdsDir = "", |
|
| 7 |
|
|
| 8 |
[switch]$h, |
|
| 9 |
[switch]$help |
|
| 10 |
) |
|
| 11 | ||
| 12 |
function Show-Usage {
|
|
| 13 |
Write-Host "Usage: deploy_appcds.ps1 [[-P2jJar] <path_to_p2j.jar>] [-DirXml <directory.xml>] [-AppCdsDir <appcds_dir>]" |
|
| 14 |
Write-Host "Where:" |
|
| 15 |
Write-Host "`t-P2jJar = Path to p2j.jar (default=`"..\lib\p2j.jar`")" |
|
| 16 |
Write-Host "`t-DirXml = Path to directory.xml (default=`"..\server\directory.xml`")" |
|
| 17 |
Write-Host "`t-AppCdsDir = Path to output appcds folder (default=`"..\appcds\client`")" |
|
| 18 |
Write-Host "`t-Help = Usage information" |
|
| 19 |
} |
|
| 20 | ||
| 21 |
if ($h -or $help -or $P2jJar -eq "-h" -or $P2jJar -eq "--help" -or $args -contains "-Help" -or $args -contains "-h" -or $args -contains "--help") {
|
|
| 22 |
Show-Usage |
|
| 23 |
exit 1 |
|
| 24 |
} |
|
| 25 | ||
| 26 |
$ErrorActionPreference = "Stop" |
|
| 27 | ||
| 28 |
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition |
|
| 29 |
$DeployHome = (Get-Item (Join-Path $ScriptDir "..")).FullName |
|
| 30 | ||
| 31 |
# Ensure P2jJar is an absolute path |
|
| 32 |
if (-not [System.IO.Path]::IsPathRooted($P2jJar)) {
|
|
| 33 |
$P2jJar = (Resolve-Path $P2jJar).Path |
|
| 34 |
} |
|
| 35 | ||
| 36 |
if ([string]::IsNullOrWhiteSpace($DirXml)) {
|
|
| 37 |
$DirXml = Join-Path $DeployHome "server\directory.xml" |
|
| 38 |
} elseif (-not [System.IO.Path]::IsPathRooted($DirXml)) {
|
|
| 39 |
$DirXml = (Resolve-Path $DirXml -ErrorAction SilentlyContinue).Path |
|
| 40 |
if (-not $DirXml) {
|
|
| 41 |
$DirXml = Join-Path (Get-Location).Path $DirXml |
|
| 42 |
} |
|
| 43 |
} |
|
| 44 | ||
| 45 |
if (-not (Test-Path $DirXml)) {
|
|
| 46 |
Write-Error "Error: $DirXml not found." |
|
| 47 |
exit 1 |
|
| 48 |
} |
|
| 49 | ||
| 50 |
$TmpProps = [System.IO.Path]::GetTempFileName() |
|
| 51 |
# Run JvmArgsExtractor |
|
| 52 |
$javaArgs = @("-cp", $P2jJar, "com.goldencode.util.JvmArgsExtractor", "-f", $DirXml, "-o", $TmpProps)
|
|
| 53 |
& java $javaArgs |
|
| 54 | ||
| 55 |
if ($LASTEXITCODE -ne 0) {
|
|
| 56 |
Write-Error "Error: Failed to extract JVM args." |
|
| 57 |
Remove-Item $TmpProps -Force |
|
| 58 |
exit 1 |
|
| 59 |
} |
|
| 60 | ||
| 61 |
# Read properties |
|
| 62 |
$props = @{}
|
|
| 63 |
foreach ($line in (Get-Content $TmpProps)) {
|
|
| 64 |
if ([string]::IsNullOrWhiteSpace($line) -or $line.StartsWith("#")) {
|
|
| 65 |
continue |
|
| 66 |
} |
|
| 67 |
$idx = $line.IndexOf("=")
|
|
| 68 |
if ($idx -gt 0) {
|
|
| 69 |
$key = $line.Substring(0, $idx).Trim() |
|
| 70 |
$value = $line.Substring($idx + 1).Trim() |
|
| 71 |
$value = $value.Replace("\:", ":").Replace("\=", "=")
|
|
| 72 |
$props[$key] = $value |
|
| 73 |
} |
|
| 74 |
} |
|
| 75 | ||
| 76 |
Remove-Item $TmpProps -Force |
|
| 77 | ||
| 78 |
if ([string]::IsNullOrWhiteSpace($AppCdsDir)) {
|
|
| 79 |
$AppCdsDir = Join-Path $DeployHome "appcds\client" |
|
| 80 |
} elseif (-not [System.IO.Path]::IsPathRooted($AppCdsDir)) {
|
|
| 81 |
$AppCdsDir = (Resolve-Path $AppCdsDir -ErrorAction SilentlyContinue).Path |
|
| 82 |
if (-not $AppCdsDir) {
|
|
| 83 |
$AppCdsDir = Join-Path (Get-Location).Path $AppCdsDir |
|
| 84 |
} |
|
| 85 |
} |
|
| 86 | ||
| 87 |
# Remove existing appcds directory to prevent Java from reusing a stale .jsa archive. |
|
| 88 |
# The JVM does not overwrite an existing SharedArchiveFile in-place; removing the |
|
| 89 |
# directory guarantees a clean dump on every run. |
|
| 90 |
if (Test-Path $AppCdsDir) {
|
|
| 91 |
Remove-Item -Recurse -Force -Path $AppCdsDir |
|
| 92 |
} |
|
| 93 |
New-Item -ItemType Directory -Force -Path $AppCdsDir | Out-Null |
|
| 94 | ||
| 95 |
$appcdsClientsStr = $props["appcds.clients"] |
|
| 96 |
if ([string]::IsNullOrWhiteSpace($appcdsClientsStr)) {
|
|
| 97 |
Write-Host "No clients found for AppCDS." |
|
| 98 |
exit 0 |
|
| 99 |
} |
|
| 100 | ||
| 101 |
$clients = $appcdsClientsStr.Split(',')
|
|
| 102 | ||
| 103 |
foreach ($client in $clients) {
|
|
| 104 |
$clientType = $client.Trim() |
|
| 105 |
if ([string]::IsNullOrWhiteSpace($clientType)) {
|
|
| 106 |
continue |
|
| 107 |
} |
|
| 108 |
|
|
| 109 |
Write-Host "Processing client: $clientType" |
|
| 110 |
|
|
| 111 |
$clientCp = $props["appcds.classpath.$clientType"] |
|
| 112 |
$clientArgsStr = $props["appcds.jvmargs.$clientType"] |
|
| 113 |
|
|
| 114 |
Write-Host "JVM classpath for $clientType: $clientCp" |
|
| 115 |
Write-Host "JVM args for $clientType: $clientArgsStr" |
|
| 116 |
|
|
| 117 |
$baseLst = [System.IO.Path]::GetTempFileName() |
|
| 118 |
$runtimeLst = [System.IO.Path]::GetTempFileName() |
|
| 119 |
|
|
| 120 |
# 1. LstExporter |
|
| 121 |
Set-Location (Join-Path $DeployHome "lib") |
|
| 122 |
|
|
| 123 |
$lstArgs = @("-cp", $clientCp, "com.goldencode.util.LstExporter",
|
|
| 124 |
"com.goldencode.p2j.main.ClientDriver", |
|
| 125 |
"com.goldencode.p2j.ui.client", |
|
| 126 |
"-com.goldencode.p2j.persist", |
|
| 127 |
"-com.goldencode.p2j.main.StandardServer", |
|
| 128 |
"!com.goldencode.p2j.util", |
|
| 129 |
"-o", $baseLst) |
|
| 130 |
|
|
| 131 |
& java $lstArgs |
|
| 132 |
|
|
| 133 |
if ($LASTEXITCODE -ne 0) {
|
|
| 134 |
Write-Error "Error: LstExporter failed for $clientType" |
|
| 135 |
Remove-Item $baseLst -Force |
|
| 136 |
Remove-Item $runtimeLst -Force |
|
| 137 |
exit 1 |
|
| 138 |
} |
|
| 139 |
|
|
| 140 |
# 2. ClientDriver to dump runtime class list |
|
| 141 |
Set-Location ([System.IO.Path]::GetTempPath()) |
|
| 142 |
|
|
| 143 |
$dumpArgs = @("-cp", $clientCp,
|
|
| 144 |
"-Djava.library.path=$DeployHome\lib", |
|
| 145 |
"-XX:DumpLoadedClassList=$runtimeLst", |
|
| 146 |
"com.goldencode.p2j.main.ClientDriver") |
|
| 147 |
|
|
| 148 |
& java $dumpArgs |
|
| 149 |
# Ignore failure as it's allowed in ant |
|
| 150 |
|
|
| 151 |
# 3. Concatenate |
|
| 152 |
$finalLst = Join-Path $AppCdsDir "$clientType.lst" |
|
| 153 |
Get-Content $baseLst, $runtimeLst | Set-Content $finalLst |
|
| 154 |
|
|
| 155 |
# 4. Build JSA archive |
|
| 156 |
Set-Location (Join-Path $DeployHome "client") |
|
| 157 |
|
|
| 158 |
# Split clientArgsStr into an array of arguments |
|
| 159 |
$clientArgs = -split $clientArgsStr |
|
| 160 |
|
|
| 161 |
$jsaArgs = @("-cp", $clientCp,
|
|
| 162 |
"-Djava.library.path=$DeployHome\lib", |
|
| 163 |
"-Xshare:dump", |
|
| 164 |
"-XX:SharedClassListFile=$AppCdsDir\$clientType.lst", |
|
| 165 |
"-XX:SharedArchiveFile=$AppCdsDir\$clientType.jsa") |
|
| 166 |
$jsaArgs += $clientArgs |
|
| 167 |
$jsaArgs += "com.goldencode.p2j.main.ClientDriver" |
|
| 168 |
|
|
| 169 |
& java $jsaArgs |
|
| 170 |
|
|
| 171 |
if ($LASTEXITCODE -ne 0) {
|
|
| 172 |
Write-Error "Error: JSA archive generation failed for $clientType" |
|
| 173 |
Remove-Item $baseLst -Force |
|
| 174 |
Remove-Item $runtimeLst -Force |
|
| 175 |
exit 1 |
|
| 176 |
} |
|
| 177 |
|
|
| 178 |
Remove-Item $baseLst -Force |
|
| 179 |
Remove-Item $runtimeLst -Force |
|
| 180 |
} |
|
| 181 | ||
| 182 |
Write-Host "AppCDS deployment completed successfully." |
|
| new/deploy/server/deploy_appcds.sh 2026-05-15 11:06:38 +0000 | ||
|---|---|---|
| 1 |
#!/bin/bash |
|
| 2 | ||
| 3 |
# Default values |
|
| 4 |
P2J_JAR="../lib/p2j.jar" |
|
| 5 |
DIR_XML="" |
|
| 6 |
APPCDS_DIR="" |
|
| 7 | ||
| 8 |
show_usage() |
|
| 9 |
{
|
|
| 10 |
i=0; usage[$i]="Usage: $(basename $0) [-f <directory.xml>] [-d <appcds_dir>] [path_to_p2j.jar]" |
|
| 11 |
i=$((i+1)); usage[$i]="Where:" |
|
| 12 |
i=$((i+1)); usage[$i]="path_to_p2j.jar \t= Path to p2j.jar (default=\"../lib/p2j.jar\")" |
|
| 13 |
i=$((i+1)); usage[$i]="-f | --file \t= Path to directory.xml (default=\"../server/directory.xml\")" |
|
| 14 |
i=$((i+1)); usage[$i]="-d | --dir \t= Path to output appcds folder (default=\"../appcds/client\")" |
|
| 15 |
i=$((i+1)); usage[$i]="-h | --help \t= Usage information" |
|
| 16 | ||
| 17 |
for i in "${usage[@]}"; do
|
|
| 18 |
echo -e "$i" |
|
| 19 |
done |
|
| 20 |
} |
|
| 21 | ||
| 22 |
while [[ $# -gt 0 ]]; do |
|
| 23 |
case "$1" in |
|
| 24 |
-h|--help|-\?) |
|
| 25 |
show_usage |
|
| 26 |
exit 1 |
|
| 27 |
;; |
|
| 28 |
-f|--file) |
|
| 29 |
DIR_XML="$2" |
|
| 30 |
shift 2 |
|
| 31 |
;; |
|
| 32 |
-d|--dir) |
|
| 33 |
APPCDS_DIR="$2" |
|
| 34 |
shift 2 |
|
| 35 |
;; |
|
| 36 |
*) |
|
| 37 |
if [[ "$1" == -* ]]; then |
|
| 38 |
echo "Unknown option: $1" |
|
| 39 |
show_usage |
|
| 40 |
exit 1 |
|
| 41 |
fi |
|
| 42 |
# Positional argument |
|
| 43 |
P2J_JAR="$1" |
|
| 44 |
shift |
|
| 45 |
;; |
|
| 46 |
esac |
|
| 47 |
done |
|
| 48 | ||
| 49 |
# Resolve DEPLOY_HOME relative to this script |
|
| 50 |
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
| 51 |
DEPLOY_HOME="$(cd "$SCRIPT_DIR/.." && pwd)" |
|
| 52 | ||
| 53 |
# Ensure P2J_JAR is an absolute path if it exists |
|
| 54 |
if [[ "$P2J_JAR" != /* ]]; then |
|
| 55 |
P2J_JAR="$PWD/$P2J_JAR" |
|
| 56 |
fi |
|
| 57 | ||
| 58 |
DIR_XML="${DIR_XML:-$DEPLOY_HOME/server/directory.xml}"
|
|
| 59 |
if [[ "$DIR_XML" != /* ]]; then |
|
| 60 |
DIR_XML="$PWD/$DIR_XML" |
|
| 61 |
fi |
|
| 62 | ||
| 63 |
APPCDS_DIR="${APPCDS_DIR:-$DEPLOY_HOME/appcds/client}"
|
|
| 64 |
if [[ "$APPCDS_DIR" != /* ]]; then |
|
| 65 |
APPCDS_DIR="$PWD/$APPCDS_DIR" |
|
| 66 |
fi |
|
| 67 | ||
| 68 |
if [ ! -f "$DIR_XML" ]; then |
|
| 69 |
echo "Error: $DIR_XML not found." |
|
| 70 |
exit 1 |
|
| 71 |
fi |
|
| 72 | ||
| 73 |
TMP_PROPS=$(mktemp) |
|
| 74 |
java -cp "$P2J_JAR" com.goldencode.util.JvmArgsExtractor -f "$DIR_XML" -o "$TMP_PROPS" |
|
| 75 | ||
| 76 |
if [ $? -ne 0 ]; then |
|
| 77 |
echo "Error: Failed to extract JVM args." |
|
| 78 |
rm -f "$TMP_PROPS" |
|
| 79 |
exit 1 |
|
| 80 |
fi |
|
| 81 | ||
| 82 |
# Read properties into dynamically named variables |
|
| 83 |
while IFS='=' read -r key value; do |
|
| 84 |
if [[ $key == \#* ]] || [ -z "$key" ]; then |
|
| 85 |
continue |
|
| 86 |
fi |
|
| 87 |
key=$(echo "$key" | xargs) |
|
| 88 |
value="${value//\\:/:}"
|
|
| 89 |
value="${value//\\=/=}"
|
|
| 90 |
|
|
| 91 |
var_name="${key//./_}"
|
|
| 92 |
var_name="${var_name//-/_}"
|
|
| 93 |
declare "$var_name=$value" |
|
| 94 |
done < "$TMP_PROPS" |
|
| 95 | ||
| 96 |
rm -f "$TMP_PROPS" |
|
| 97 | ||
| 98 |
# Remove existing appcds directory to prevent Java from reusing a stale .jsa archive. |
|
| 99 |
# The JVM does not overwrite an existing SharedArchiveFile in-place; removing the |
|
| 100 |
# directory guarantees a clean dump on every run. |
|
| 101 |
if [ -d "$APPCDS_DIR" ]; then |
|
| 102 |
rm -rf "$APPCDS_DIR" |
|
| 103 |
fi |
|
| 104 |
mkdir -p "$APPCDS_DIR" |
|
| 105 | ||
| 106 |
if [ -z "$appcds_clients" ]; then |
|
| 107 |
echo "No clients found for AppCDS." |
|
| 108 |
exit 0 |
|
| 109 |
fi |
|
| 110 | ||
| 111 |
IFS=',' read -ra clients <<< "$appcds_clients" |
|
| 112 |
for client_type in "${clients[@]}"; do
|
|
| 113 |
client_type=$(echo "$client_type" | xargs) |
|
| 114 |
if [ -z "$client_type" ]; then |
|
| 115 |
continue |
|
| 116 |
fi |
|
| 117 |
|
|
| 118 |
echo "Processing client: $client_type" |
|
| 119 |
|
|
| 120 |
cp_var="appcds_classpath_$client_type" |
|
| 121 |
args_var="appcds_jvmargs_$client_type" |
|
| 122 |
|
|
| 123 |
client_cp="${!cp_var}"
|
|
| 124 |
client_args="${!args_var}"
|
|
| 125 |
|
|
| 126 |
echo "JVM classpath for $client_type: $client_cp" |
|
| 127 |
echo "JVM args for $client_type: $client_args" |
|
| 128 |
|
|
| 129 |
base_lst=$(mktemp) |
|
| 130 |
runtime_lst=$(mktemp) |
|
| 131 |
|
|
| 132 |
# 1. LstExporter |
|
| 133 |
cd "$DEPLOY_HOME/lib" || exit 1 |
|
| 134 |
java -cp "$client_cp" com.goldencode.util.LstExporter \ |
|
| 135 |
"com.goldencode.p2j.main.ClientDriver" \ |
|
| 136 |
"com.goldencode.p2j.ui.client" \ |
|
| 137 |
"-com.goldencode.p2j.persist" \ |
|
| 138 |
"-com.goldencode.p2j.main.StandardServer" \ |
|
| 139 |
"!com.goldencode.p2j.util" \ |
|
| 140 |
"-o" "$base_lst" |
|
| 141 |
|
|
| 142 |
if [ $? -ne 0 ]; then |
|
| 143 |
echo "Error: LstExporter failed for $client_type" |
|
| 144 |
rm -f "$base_lst" "$runtime_lst" |
|
| 145 |
exit 1 |
|
| 146 |
fi |
|
| 147 |
|
|
| 148 |
# 2. ClientDriver to dump runtime class list |
|
| 149 |
cd /tmp || exit 1 |
|
| 150 |
java -cp "$client_cp" \ |
|
| 151 |
-Djava.library.path="$DEPLOY_HOME/lib" \ |
|
| 152 |
-XX:DumpLoadedClassList="$runtime_lst" \ |
|
| 153 |
com.goldencode.p2j.main.ClientDriver |
|
| 154 |
|
|
| 155 |
# 3. Concatenate |
|
| 156 |
final_lst="$APPCDS_DIR/${client_type}.lst"
|
|
| 157 |
cat "$base_lst" "$runtime_lst" > "$final_lst" |
|
| 158 |
|
|
| 159 |
# 4. Build JSA archive |
|
| 160 |
cd "$DEPLOY_HOME/client" || exit 1 |
|
| 161 |
|
|
| 162 |
# We must split client_args on spaces properly without quotes |
|
| 163 |
# so that -Xmx512m -Dfoo=bar are treated as separate args |
|
| 164 |
java -cp "$client_cp" \ |
|
| 165 |
-Djava.library.path="$DEPLOY_HOME/lib" \ |
|
| 166 |
-Xshare:dump \ |
|
| 167 |
-XX:SharedClassListFile="$APPCDS_DIR/${client_type}.lst" \
|
|
| 168 |
-XX:SharedArchiveFile="$APPCDS_DIR/${client_type}.jsa" \
|
|
| 169 |
$client_args \ |
|
| 170 |
com.goldencode.p2j.main.ClientDriver |
|
| 171 |
|
|
| 172 |
if [ $? -ne 0 ]; then |
|
| 173 |
echo "Error: JSA archive generation failed for $client_type" |
|
| 174 |
rm -f "$base_lst" "$runtime_lst" |
|
| 175 |
exit 1 |
|
| 176 |
fi |
|
| 177 |
|
|
| 178 |
rm -f "$base_lst" "$runtime_lst" |
|
| 179 |
done |
|
| 180 | ||
| 181 |
echo "AppCDS deployment completed successfully." |
|
| new/deploy/server/directory.xml.template 2026-05-15 11:06:51 +0000 | ||
|---|---|---|
| 1187 | 1187 |
<node-attribute name="value" value="{spawner_path}"/>
|
| 1188 | 1188 |
</node> |
| 1189 | 1189 |
<node class="string" name="jvmArgs"> |
| 1190 |
<node-attribute name="value" value="-Xmx512m -Djava.awt.headless=true"/>
|
|
| 1190 |
<node-attribute name="value" value="-Xshare:on -XX:SharedArchiveFile=../appcds/client/default.jsa -Xmx128m -Djava.awt.headless=true"/>
|
|
| 1191 | 1191 |
</node> |
| 1192 | 1192 |
<node class="string" name="workingDir"> |
| 1193 | 1193 |
<node-attribute name="value" value="{client_start_dir}"/>
|
| 1194 | 1194 |
</node> |
| 1195 |
<node class="string" name="libPath"> |
|
| 1196 |
<node-attribute name="value" value="{client_lib_path}"/>
|
|
| 1197 |
</node> |
|
| 1195 | 1198 |
<node class="string" name="cfgOverrides"> |
| 1196 | 1199 |
<node-attribute name="value" value="client:cmd-line-option:debugalert=true"/> |
| 1197 | 1200 |
</node> |
| new/deploy/server/prepare_dir.sh 2026-05-15 06:50:48 +0000 | ||
|---|---|---|
| 295 | 295 |
admin_port=$(getval "admin_port" "7443" $infile) |
| 296 | 296 |
log_rotation_limit=$(getval "log_rotation_limit" "50000000" $infile) |
| 297 | 297 |
log_rotation_count=$(getval "log_rotation_count" "4" $infile) |
| 298 |
client_lib_path=$(getval "client_lib_path" "../lib" $infile) |
|
| 298 | 299 | |
| 299 | 300 |
# Handle DB load. No entry implies H2 hotel DB. |
| 300 | 301 |
if ! load_array_from_json "dbnames" "$infile" db_array false \ |
| ... | ... | |
| 346 | 347 |
sed \ |
| 347 | 348 |
-e "s#{spawner_path}#$spawner_path#g" \
|
| 348 | 349 |
-e "s#{client_start_dir}#$client_start_dir#g" \
|
| 350 |
-e "s#{client_lib_path}#$client_lib_path#g" \
|
|
| 349 | 351 |
-e "s/{dateFormat}/$dateFormat/g" \
|
| 350 | 352 |
-e "s/{numberGroupSep}/$numberGroupSep/g" \
|
| 351 | 353 |
-e "s/{numberDecimalSep}/$numberDecimalSep/g" \
|
| new/docker/docker-compose.yml 2026-05-15 11:21:15 +0000 | ||
|---|---|---|
| 43 | 43 |
volumes: |
| 44 | 44 |
- ${LOG_DIR:-../deploy/logs}:/opt/hotel/logs
|
| 45 | 45 |
- ${CFG_DIR:-../deploy/etc}:/opt/hotel/etc
|
| 46 |
- ${APPCDS_DIR:-../deploy/appcds}:/opt/hotel/appcds
|
|
| 46 | 47 |
environment: |
| 47 | 48 |
START_SERVER_GETOPTS: '-c /opt/hotel/etc/server.xml' |
| 48 | 49 | |
| new/docker/docker-compose_client.yml 2026-05-15 11:21:53 +0000 | ||
|---|---|---|
| 44 | 44 |
volumes: |
| 45 | 45 |
- ${LOG_DIR:-../deploy/logs}:/opt/hotel/logs
|
| 46 | 46 |
- ${CFG_DIR:-../deploy/etc}:/opt/hotel/etc
|
| 47 |
- ${APPCDS_DIR:-../deploy/appcds}:/opt/hotel/appcds
|
|
| 47 | 48 |
environment: |
| 48 | 49 |
START_SERVER_GETOPTS: '-c /opt/hotel/etc/server.xml' |
| 49 | 50 | |
| ... | ... | |
| 59 | 60 |
- 2202:22 |
| 60 | 61 |
volumes: |
| 61 | 62 |
- ${LOG_DIR:-../deploy/logs}:/opt/hotel/logs
|
| 63 |
- ${APPCDS_DIR:-../deploy/appcds}:/opt/hotel/appcds
|
|
| 62 | 64 | |
| 63 | 65 |
volumes: |
| 64 | 66 |
hotel_db_postgres: |
| new/docker/docker-compose_create_pg_cluster.yml 2026-05-15 05:24:16 +0000 | ||
|---|---|---|
| 1 | 1 |
services: |
| 2 | 2 | |
| 3 | 3 |
hotel_db: |
| 4 |
image: hotel_gui_postgres:latest
|
|
| 4 |
image: hotel_gui_pg14_server:451_11326c-16563_20260514a
|
|
| 5 | 5 |
container_name: hotel_db |
| 6 | 6 |
command: > |
| 7 | 7 |
bash -c " |
| 8 | 8 |
cd /tmp && |
| 9 |
sudo fwd_create_pg_cluster.sh --pgdata /pgdata/fwdcluster --rolefile-path /docker-entrypoint-initdb.d
|
|
| 9 |
sudo fwd_create_pg_cluster.sh --pgdata ${PGDATA:-/opt/hotel/db/fwdcluster}
|
|
| 10 | 10 |
" |
| 11 | 11 |
ports: |
| 12 | 12 |
- ${PGPORT:-5432}:${PGPORT:-5432}
|
| 13 | 13 |
volumes: |
| 14 |
- hotel_db_postgres:/pgdata:delegated
|
|
| 14 |
- hotel_db_postgres:/opt/hotel/db:delegated
|
|
| 15 | 15 |
environment: |
| 16 |
PGDATA: /pgdata/fwdcluster
|
|
| 16 |
PGDATA: /opt/hotel/db/fwdcluster
|
|
| 17 | 17 |
PGPORT: ${PGPORT:-5432}
|
| 18 | 18 | |
| 19 | 19 |
volumes: |
| new/docker/docker-compose_prepare.yml 2026-05-15 11:13:53 +0000 | ||
|---|---|---|
| 11 | 11 |
- ${LOG_DIR:-../deploy/logs}:/opt/hotel/logs
|
| 12 | 12 |
- ${CFG_DIR:-../deploy/etc}:/opt/hotel/etc
|
| 13 | 13 |
- ${SEC_DIR:-../deploy/security}:/opt/hotel/security
|
| 14 |
- ${APPCDS_DIR:-../deploy/appcds}:/opt/hotel/appcds
|
|
| 14 | 15 |
environment: |
| 15 | 16 |
ADMIN_CONSOLE_PASSWORD: "${ADMIN_CONSOLE_PASSWORD:-test123}"
|
| 16 | 17 |
APP_DBUSER_PASSWORD: "${APP_DBUSER_PASSWORD:-user}"
|
| new/docker/docker-compose_server.yml 2026-05-15 11:15:34 +0000 | ||
|---|---|---|
| 40 | 40 |
volumes: |
| 41 | 41 |
- ${LOG_DIR:-../deploy/logs}:/opt/hotel/logs
|
| 42 | 42 |
- ${CFG_DIR:-../deploy/etc}:/opt/hotel/etc
|
| 43 |
- ${APPCDS_DIR:-../deploy/appcds}:/opt/hotel/appcds
|
|
| 43 | 44 |
environment: |
| 44 | 45 |
START_SERVER_GETOPTS: '-c /opt/hotel/etc/server.xml' |
| 45 | 46 |
depends_on: |
| new/docker/docker_prepare.sh 2026-05-15 08:21:45 +0000 | ||
|---|---|---|
| 22 | 22 |
[--log_dir=<logdir>] \ |
| 23 | 23 |
[--cfg_dir=<cfgdir>] \ |
| 24 | 24 |
[--cfg_file=<cfgfile>] \ |
| 25 |
[--appcds_dir=<appcdsdir>] \ |
|
| 25 | 26 |
[--admin_pw=<password>] \ |
| 26 | 27 |
[--db_user_pw=<password>] \ |
| 27 | 28 |
[--root_ca_pw=<password>] \ |
| ... | ... | |
| 37 | 38 |
i=$((i+1)); usage[$i]="\t--log_dir=<logdir> Path to directory containing log files (def=${log_dir})."
|
| 38 | 39 |
i=$((i+1)); usage[$i]="\t--cfg_dir=<cfgdir> Path to directory containing configuration files (def=${cfg_dir})."
|
| 39 | 40 |
i=$((i+1)); usage[$i]="\t--cfg_file=<cfgfile> JSON configuration file in <cfgdir> (def=${cfg_file})."
|
| 41 |
i=$((i+1)); usage[$i]="\t--appcds_dir=<appcdsdir> Path to directory containing AppCDS files (def=${appcds_dir})."
|
|
| 40 | 42 |
i=$((i+1)); usage[$i]="\t--admin_pw=<password> Password to use for the Admin Console (def=${admin_console_pw})."
|
| 41 | 43 |
i=$((i+1)); usage[$i]="\t--db_user_pw=<password> Password to use for \"fwd_user\" (def=${db_user_pw})."
|
| 42 | 44 |
i=$((i+1)); usage[$i]="\t--root_ca_pw=<password> The root CA private-key encryption password (def=${root_ca_pw})."
|
| ... | ... | |
| 81 | 83 |
entrypoint_sh="docker-entrypoint_prepare.sh" |
| 82 | 84 |
container_entrypoint_sh="/docker-entrypoint.d/${entrypoint_sh}"
|
| 83 | 85 |
container_cfg_dir=${container_project_dir}/etc
|
| 86 |
container_appcds_dir=${container_project_dir}/appcds
|
|
| 84 | 87 |
container_log_dir=${container_project_dir}/logs
|
| 85 | 88 |
container_db_dir=${container_project_dir}/db
|
| 86 | 89 |
container_name_server=${proj}_server
|
| 87 | 90 |
log_dir="./deploy/logs" |
| 88 | 91 |
cfg_dir="./deploy/etc" |
| 92 |
appcds_dir="./deploy/appcds" |
|
| 89 | 93 |
cfg_file="prepare_dir.json" |
| 90 | 94 |
docker_image=$image_server |
| 91 | 95 |
admin_console_pw="test123" |
| ... | ... | |
| 108 | 112 |
"log_dir"* ) log_dir=$(echo $OPTARG | cut -d"=" -f2) ;; |
| 109 | 113 |
"cfg_dir"* ) cfg_dir=$(echo $OPTARG | cut -d"=" -f2) ;; |
| 110 | 114 |
"cfg_file"* ) cfg_file=$(echo $OPTARG | cut -d"=" -f2) ;; |
| 115 |
"appcds_dir"* ) appcds_dir=$(echo $OPTARG | cut -d"=" -f2) ;; |
|
| 111 | 116 |
"admin_pw"* ) admin_console_pw=$(echo $OPTARG | cut -d"=" -f2) ;; |
| 112 | 117 |
"db_user_pw"* ) db_user_pw=$(echo $OPTARG | cut -d"=" -f2) ;; |
| 113 | 118 |
"root_ca_pw"* ) root_ca_pw=$(echo $OPTARG | cut -d"=" -f2) ;; |
| ... | ... | |
| 139 | 144 |
fi |
| 140 | 145 |
vmap_log="-v ${log_dir}:${container_log_dir}"
|
| 141 | 146 |
vmap_cfg="-v ${cfg_dir}:${container_cfg_dir}"
|
| 147 |
vmap_appcds="-v ${appcds_dir}:${container_appcds_dir}"
|
|
| 142 | 148 |
app_env="-e APP_DBUSER_PASSWORD=${db_user_pw}"
|
| 143 | 149 |
app_env+=" -e ADMIN_CONSOLE_PASSWORD=${admin_console_pw}"
|
| 144 | 150 |
app_env+=" -e ROOT_CA_PASSWORD=\"${root_ca_pw}\""
|
| ... | ... | |
| 161 | 167 | |
| 162 | 168 |
run_cmd="$dryrun docker run --rm -it $detach_opt --name $container_name \ |
| 163 | 169 |
$net \ |
| 164 |
$vmap_log $vmap_cfg \ |
|
| 170 |
$vmap_log $vmap_cfg $vmap_appcds \
|
|
| 165 | 171 |
$app_env \ |
| 166 | 172 |
$docker_image $container_entrypoint_sh $entrypoint_opts" |
| 167 | 173 | |
| new/docker/run_docker.sh 2026-05-15 08:25:49 +0000 | ||
|---|---|---|
| 30 | 30 |
[--db_user_pw=<password>] \ |
| 31 | 31 |
[--log_dir=<logdir>] \ |
| 32 | 32 |
[--cfg_dir=<cfgdir>] \ |
| 33 |
[--appcds_dir=<appcdsdir>] \ |
|
| 33 | 34 |
[--cfg_file=<cfgfile>] \ |
| 34 | 35 |
[--clear_logs] \ |
| 35 | 36 |
[--skip_server] \ |
| ... | ... | |
| 58 | 59 |
i=$((i+1)); usage[$i]="\t--log_dir=<logdir> Path to directory containing log files. Maps to container ${container_log_dir} (def=${log_dir})."
|
| 59 | 60 |
i=$((i+1)); usage[$i]="\t--cfg_dir=<cfgdir> Path to directory containing configuration files. Maps to container ${container_cfg_dir} (def=${cfg_dir})."
|
| 60 | 61 |
i=$((i+1)); usage[$i]="\t--cfg_file=<cfgfile> JSON configuration file in <cfgdir>. Will overwrite the directory.xml if --opt_overwrite is included." |
| 62 |
i=$((i+1)); usage[$i]="\t--appcds_dir=<appcdsdir> Path to directory containing appcds files. Maps to container ${container_appcds_dir} (def=${appcds_dir})."
|
|
| 61 | 63 |
i=$((i+1)); usage[$i]="\t--clear_logs = clear '*.log' from logging directories." |
| 62 | 64 |
i=$((i+1)); usage[$i]="\t--skip_server = Skip starting the server in the container." |
| 63 | 65 |
i=$((i+1)); usage[$i]="\t--inspect = Open a bash in the running container." |
| ... | ... | |
| 107 | 109 |
repo_entrypoint_sh="./docker/repo/entrypoint/${entrypoint_sh}"
|
| 108 | 110 |
container_dbdump=/dbdump |
| 109 | 111 |
container_cfg_dir=/opt/${app}/etc
|
| 112 |
container_appcds_dir=/opt/${app}/appcds
|
|
| 110 | 113 |
container_log_dir=/opt/${app}/logs
|
| 111 | 114 |
container_db_dir=/opt/${app}/db
|
| 112 | 115 |
cfg_dir=./deploy/etc |
| 113 | 116 |
log_dir=./deploy/logs |
| 117 |
appcds_dir=./deploy/appcds |
|
| 114 | 118 |
dblang=${LANG%%.*}
|
| 115 | 119 |
dbcodepage=${LANG#*.}
|
| 116 | 120 |
dbcodepage=${dbcodepage,,//-/}
|
| ... | ... | |
| 151 | 155 |
"log_dir"* ) log_dir=$(echo $OPTARG | cut -d"=" -f2) ;; |
| 152 | 156 |
"cfg_dir"* ) cfg_dir=$(echo $OPTARG | cut -d"=" -f2) ;; |
| 153 | 157 |
"cfg_file"* ) cfg_file=$(echo $OPTARG | cut -d"=" -f2) ;; |
| 158 |
"appcds_dir"* ) appcds_dir=$(echo $OPTARG | cut -d"=" -f2) ;; |
|
| 154 | 159 |
"reports"* ) reports=true |
| 155 | 160 |
[[ "$OPTARG" == *=* ]] && report_place=$(echo "$OPTARG" | cut -d'=' -f2) ;; |
| 156 | 161 |
"clear_logs" ) clear_logs=true ;; |
| ... | ... | |
| 202 | 207 |
[ -n "$dbdump" ] && vmap_dump="-v ${dbdump}:${container_dbdump}"
|
| 203 | 208 |
vmap_log="-v ${log_dir}:${container_log_dir}"
|
| 204 | 209 |
vmap_cfg="-v ${cfg_dir}:${container_cfg_dir}"
|
| 210 |
vmap_appcds="-v ${appcds_dir}:${container_appcds_dir}"
|
|
| 205 | 211 |
vmap_entrypoint="-v ${repo_entrypoint_sh}:${container_entrypoint_sh}"
|
| 206 | 212 | |
| 207 | 213 |
# Establish docker run parameters |
| ... | ... | |
| 277 | 283 |
run_cmd="docker run --rm -it $detach_opt --name $container_name \ |
| 278 | 284 |
$ports $net \ |
| 279 | 285 |
$userinfo \ |
| 280 |
$vmap_log $vmap_cfg $vmap_entrypoint \ |
|
| 286 |
$vmap_log $vmap_cfg $vmap_entrypoint $vmap_appcds \
|
|
| 281 | 287 |
$vmap_db $vmap_dump \ |
| 282 | 288 |
$DB_ENV \ |
| 283 | 289 |
$DB_APP_ENV \ |
| new/json_template.sh 2026-05-15 06:53:26 +0000 | ||
|---|---|---|
| 233 | 233 |
pkgrootfolder=`echo $pkgroot |sed 's/\./\//g'` |
| 234 | 234 |
spawner_path="/opt/spawner/spawn" |
| 235 | 235 |
client_start_dir="$PWD/deploy/client" |
| 236 |
client_lib_path="$PWD/deploy/lib" |
|
| 236 | 237 |
server_log="../logs" |
| 237 | 238 |
client_log="../logs" |
| 238 | 239 |
keyboard="US" |
| ... | ... | |
| 396 | 397 |
sed \ |
| 397 | 398 |
-e "s#{spawner_path}#$spawner_path#g" \
|
| 398 | 399 |
-e "s#{client_start_dir}#$client_start_dir#g" \
|
| 400 |
-e "s#{client_lib_path}#$client_lib_path#g" \
|
|
| 399 | 401 |
-e "s/{dateFormat}/$dateFormat/g" \
|
| 400 | 402 |
-e "s/{numberGroupSep}/$numberGroupSep/g" \
|
| 401 | 403 |
-e "s/{numberDecimalSep}/$numberDecimalSep/g" \
|
| ... | ... | |
| 502 | 504 |
setval "directory_xml_file" $directory_xml_file $prepare_dir |
| 503 | 505 |
setval "spawner_path" $spawner_path $prepare_dir |
| 504 | 506 |
setval "client_start_dir" $client_start_dir $prepare_dir |
| 507 |
setval "client_lib_path" $client_lib_path $prepare_dir |
|
| 505 | 508 |
setval "dateFormat" $dateFormat $prepare_dir |
| 506 | 509 |
setval "numberGroupSep" $numberGroupSep $prepare_dir |
| 507 | 510 |
setval "numberDecimalSep" $numberDecimalSep $prepare_dir |