Added debug flag to aca_bootRun.sh options. JVM will launch with debug

This commit is contained in:
iadgovuser29 2024-05-07 16:02:24 -04:00
parent a903b0e448
commit f476b25053
3 changed files with 22 additions and 2 deletions

View File

@ -20,6 +20,12 @@ java {
} }
} }
bootRun {
if (project.hasProperty('debug')) {
jvmArgs "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:9123"
}
}
configurations { configurations {
compileOnly { compileOnly {
extendsFrom annotationProcessor extendsFrom annotationProcessor

View File

@ -27,6 +27,7 @@ help () {
echo " options:" echo " options:"
echo " -p | --path Path to the HIRS_AttestationCAPortal.war file" echo " -p | --path Path to the HIRS_AttestationCAPortal.war file"
echo " -w | --war Use deployed war file" echo " -w | --war Use deployed war file"
echo " -d | --debug Launch the JVM with a debug port open"
echo " -h | --help Print this help" echo " -h | --help Print this help"
echo echo
} }
@ -49,6 +50,10 @@ while [[ $# -gt 0 ]]; do
WAR_PATH="/opt/hirs/aca/HIRS_AttestationCAPortal.war" WAR_PATH="/opt/hirs/aca/HIRS_AttestationCAPortal.war"
DEPLOYED_WAR=true DEPLOYED_WAR=true
;; ;;
-d|--debug)
DEBUG_ACA=YES
shift
;;
-h|--help) -h|--help)
help help
exit 0 exit 0
@ -125,7 +130,10 @@ WEB_TLS_PARAMS="--server.ssl.key-store-password=$hirs_pki_password \
# uncomment to show spring boot and hibernate properties used as gradle arguments # uncomment to show spring boot and hibernate properties used as gradle arguments
#echo "--args=\"$CONNECTOR_PARAMS $WEB_TLS_PARAMS\"" #echo "--args=\"$CONNECTOR_PARAMS $WEB_TLS_PARAMS\""
if [ -z "$USE_WAR" ]; then if [ "$DEBUG_ACA" == YES ]; then
echo "Booting with debug mode..."
./gradlew bootRun --args="--spring.config.location=$SPRING_PROP_FILE" -Pdebug
elif [ -z "$USE_WAR" ]; then
echo "Booting the ACA from local build..." echo "Booting the ACA from local build..."
# ./gradlew bootRun --args="$CONNECTOR_PARAMS$WEB_TLS_PARAMS" # ./gradlew bootRun --args="$CONNECTOR_PARAMS$WEB_TLS_PARAMS"
./gradlew bootRun --args="--spring.config.location=$SPRING_PROP_FILE" ./gradlew bootRun --args="--spring.config.location=$SPRING_PROP_FILE"

View File

@ -1,6 +1,7 @@
param ( param (
[string]$p, [string]$path = $null, [string]$p, [string]$path = $null,
[switch]$w, [switch]$war = $false, [switch]$w, [switch]$war = $false,
[switch]$d, [switch]$debug = $false,
[switch]$h, [switch]$help = $false [switch]$h, [switch]$help = $false
) )
@ -34,6 +35,7 @@ if ($p) {
$path = $p $path = $p
} }
$war = $w -or $war $war = $w -or $war
$debug = $d -or $debug
$help = $h -or $help $help = $h -or $help
if(!(New-Object Security.Principal.WindowsPrincipal( if(!(New-Object Security.Principal.WindowsPrincipal(
@ -49,6 +51,7 @@ if ($help) {
echo " options:" echo " options:"
echo " -p | --path Path to the HIRS_AttestationCAPortal.war file" echo " -p | --path Path to the HIRS_AttestationCAPortal.war file"
echo " -w | --war Use deployed war file" echo " -w | --war Use deployed war file"
echo " -d | --debug Launch the JVM with a debug port open"
echo " -h | --help Print this help" echo " -h | --help Print this help"
exit 1 exit 1
} }
@ -71,7 +74,10 @@ if (!$DEPLOYED_WAR) {
} }
$SPRING_PROP_FILE_FORWARDSLASHES=($global:HIRS_DATA_SPRING_PROP_FILE | ChangeBackslashToForwardSlash) $SPRING_PROP_FILE_FORWARDSLASHES=($global:HIRS_DATA_SPRING_PROP_FILE | ChangeBackslashToForwardSlash)
if ($w -or $war) { if ($d -or $debug) {
echo "Booting with debug mode..."
./gradlew bootRun --args="--spring.config.location=$SPRING_PROP_FILE" -Pdebug
elseif ($w -or $war) {
echo "Booting the ACA from a war file..." | WriteAndLog echo "Booting the ACA from a war file..." | WriteAndLog
java -jar $DEPLOYED_WAR --spring.config.location=$SPRING_PROP_FILE_FORWARDSLASHES java -jar $DEPLOYED_WAR --spring.config.location=$SPRING_PROP_FILE_FORWARDSLASHES
} else { } else {