From 29ca60ccecbc077f11d5bcba1c2061a308da24ae Mon Sep 17 00:00:00 2001
From: Joaquin <joaquin92.rm@gmail.com>
Date: Mon, 17 Mar 2025 10:37:19 -0600
Subject: [PATCH] OracleGoldenGate 23 - Adding support for python startup
 scripts

---
 OracleGoldenGate/23/README.md              | 2 +-
 OracleGoldenGate/23/bin/deployment-main.sh | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/OracleGoldenGate/23/README.md b/OracleGoldenGate/23/README.md
index 6c3177442d..e54844773d 100644
--- a/OracleGoldenGate/23/README.md
+++ b/OracleGoldenGate/23/README.md
@@ -160,7 +160,7 @@ Version 23.4 ...
 
 ### Running Scripts Before Setup and on Startup
 
-The container images can be configured to run scripts before setup and on startup. Currently, `.sh` extensions are supported. For setup scripts just mount the volume `/u01/ogg/scripts/setup` or extend the image to include scripts in this directory. For startup scripts just mount the volume `/u01/ogg/scripts/startup` or extend the image to include scripts in this directory. Both of those locations
+The container images can be configured to run scripts before setup and on startup. Currently, `.sh` and `.py` extensions are supported. For setup scripts just mount the volume `/u01/ogg/scripts/setup` or extend the image to include scripts in this directory. For startup scripts just mount the volume `/u01/ogg/scripts/startup` or extend the image to include scripts in this directory. Both of those locations
 are static and the content is controlled by the volume mount.
 
 The example below mounts the local directory `${PWD}/myScripts` to `/u01/ogg/scripts` which is then searched for custom startup scripts:
diff --git a/OracleGoldenGate/23/bin/deployment-main.sh b/OracleGoldenGate/23/bin/deployment-main.sh
index ed799f48bf..ec9f534342 100755
--- a/OracleGoldenGate/23/bin/deployment-main.sh
+++ b/OracleGoldenGate/23/bin/deployment-main.sh
@@ -125,10 +125,14 @@ function run_user_scripts {
 	while read -r script; do
 		case "${script}" in
 		*.sh)
-			echo "Running script '${script}'"
+			echo "Running shell script '${script}'"
 			# shellcheck disable=SC1090
 			source "${script}"
 			;;
+		*.py)
+			echo "Running Python script '${script}'"
+			python3 "${script}"
+			;;
 		*)
 			echo "Ignoring '${script}'"
 			;;