Fix payara windows image (#2880)

This commit is contained in:
Lauri Tulmin 2021-04-28 13:26:26 +03:00 committed by GitHub
parent a66a13f938
commit 7c517035c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -1 +1,8 @@
java %JVM_ARGS% -jar glassfish/lib/client/appserver-cli.jar start-domain --verbose domain1
:: server is run through a launcher process, to add jvm arguments we need to add them to configuration file
:: firstly split JVM_ARGS environment variable by space character and put each argument into <jvm-options> tag
:: after that place options into configuration xml after <jvm-options>-server</jvm-options>
SET IN_CONF_FILE=/server/glassfish/domains/domain1/config/domain.xml
SET OUT_CONF_FILE=/server/glassfish/domains/domain1/config/domain.xml
powershell -command "$opts='<jvm-options>' + $env:JVM_ARGS + '</jvm-options>'; $opts=$opts -replace ' ', '</jvm-options><jvm-options>'; (gc $env:IN_CONF_FILE) -replace '<jvm-options>-server</jvm-options>', ('<jvm-options>-server</jvm-options>' + $opts) | sc $env:OUT_CONF_FILE"
:: --verbose starts server in foreground mode where output is printed to console
java -jar glassfish/lib/client/appserver-cli.jar start-domain --verbose domain1