Skip to content

Commit 2967849

Browse files
authored
Issue 268 parameter naming (#377)
* Issue #268 - Use argument names when identifying invalid or missing options * Issue #268 - Change argument value names to match argument names in usage (CMD files) * Issue #268 - Store script name before SHIFT of arguments * Issue #268 - Change argument value names to match argument names in usage (SH files) * Issue #268 - Change arguments for compatibility with Solari awk * Issue #268 - Remove references to prev_model_file argument
1 parent 9dc86de commit 2967849

14 files changed

+329
-350
lines changed

installer/src/main/bin/createDomain.cmd

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ SETLOCAL
5252

5353
SET WLSDEPLOY_PROGRAM_NAME=createDomain
5454

55+
SET SCRIPT_NAME=%~nx0
5556
SET SCRIPT_PATH=%~dp0
5657
FOR %%i IN ("%SCRIPT_PATH%") DO SET SCRIPT_PATH=%%~fsi
5758
IF %SCRIPT_PATH:~-1%==\ SET SCRIPT_PATH=%SCRIPT_PATH:~0,-1%
@@ -184,7 +185,7 @@ IF %JVM_VERSION% LSS %MIN_JDK_VERSION% (
184185
@rem The underlying WLST script has other required arguments.
185186
@rem
186187
IF "%ORACLE_HOME%" == "" (
187-
ECHO Required argument ORACLE_HOME not provided >&2
188+
ECHO Required argument -oracle_home not provided >&2
188189
SET RETURN_CODE=99
189190
GOTO usage
190191
)
@@ -195,13 +196,13 @@ IF "%ORACLE_HOME%" == "" (
195196
IF DEFINED WLST_PATH_DIR (
196197
FOR %%i IN ("%WLST_PATH_DIR%") DO SET WLST_PATH_DIR=%%~fsi
197198
IF NOT EXIST "%WLST_PATH_DIR%" (
198-
ECHO WLST_PATH_DIR specified does not exist: %WLST_PATH_DIR% >&2
199+
ECHO Specified -wlst_path directory does not exist: %WLST_PATH_DIR% >&2
199200
SET RETURN_CODE=98
200201
GOTO exit_script
201202
)
202203
set "WLST=%WLST_PATH_DIR%\common\bin\wlst.cmd"
203204
IF NOT EXIST "%WLST%" (
204-
ECHO WLST executable %WLST% not found under specified WLST_PATH_DIR %WLST_PATH_DIR% >&2
205+
ECHO WLST executable %WLST% not found under -wlst_path directory %WLST_PATH_DIR% >&2
205206
SET RETURN_CODE=98
206207
GOTO exit_script
207208
)
@@ -307,55 +308,55 @@ GOTO exit_script
307308

308309
:usage
309310
ECHO.
310-
ECHO Usage: %~nx0 [-help] [-use_encryption] [-run_rcu]
311-
ECHO -oracle_home ^<oracle-home^>
312-
ECHO [-domain_parent ^<domain-parent^> ^| -domain_home ^<domain-home^>]
313-
ECHO -domain_type ^<domain-type^>
314-
ECHO [-java_home ^<java-home^>]
315-
ECHO [-archive_file ^<archive-file^>]
316-
ECHO [-model_file ^<model-file^>]
317-
ECHO [-variable_file ^<variable-file^>]
318-
ECHO [-wlst_path ^<wlst-path^>]
319-
ECHO [-rcu_db ^<rcu-database^>
320-
ECHO -rcu_prefix ^<rcu-prefix^>
311+
ECHO Usage: %SCRIPT_NAME% [-help] [-use_encryption] [-run_rcu]
312+
ECHO -oracle_home ^<oracle_home^>
313+
ECHO [-domain_parent ^<domain_parent^> ^| -domain_home ^<domain_home^>]
314+
ECHO -domain_type ^<domain_type^>
315+
ECHO [-java_home ^<java_home^>]
316+
ECHO [-archive_file ^<archive_file^>]
317+
ECHO [-model_file ^<model_file^>]
318+
ECHO [-variable_file ^<variable_file^>]
319+
ECHO [-wlst_path ^<wlst_path^>]
320+
ECHO [-rcu_db ^<rcu_database^>
321+
ECHO -rcu_prefix ^<rcu_prefix^>
321322
ECHO ]
322323
ECHO.
323324
ECHO where:
324-
ECHO oracle-home - the existing Oracle Home directory for the domain.
325+
ECHO oracle_home - the existing Oracle Home directory for the domain.
325326
ECHO.
326-
ECHO domain-parent - the parent directory where the domain should be created.
327+
ECHO domain_parent - the parent directory where the domain should be created.
327328
ECHO The domain name from the model will be appended to this
328329
ECHO location to become the domain home.
329330
ECHO.
330-
ECHO domain-home - the full directory where the domain should be created.
331+
ECHO domain_home - the full directory where the domain should be created.
331332
ECHO This is used in cases where the domain name is different
332333
ECHO from the domain home directory name.
333334
ECHO.
334-
ECHO domain-type - the type of domain (e.g., WLS, JRF). This controls
335+
ECHO domain_type - the type of domain (e.g., WLS, JRF). This controls
335336
ECHO the domain templates and template resource targeting.
336-
ECHO Also used to locate wlst.cmd if wlst-path not specified.
337+
ECHO Also used to locate wlst.cmd if -wlst_path not specified.
337338
ECHO.
338-
ECHO java-home - the Java Home to use for the new domain. If not
339+
ECHO java_home - the Java Home to use for the new domain. If not
339340
ECHO specified, it defaults to the value of the JAVA_HOME
340341
ECHO environment variable.
341342
ECHO.
342-
ECHO archive-file - the path to the archive file to use. If the -model_file
343+
ECHO archive_file - the path to the archive file to use. If the -model_file
343344
ECHO argument is not specified, the model file in this archive
344345
ECHO will be used.
345346
ECHO.
346-
ECHO model-file - the location of the model file to use.
347+
ECHO model_file - the location of the model file to use.
347348
ECHO.
348-
ECHO variable-file - the location of the property file containing
349+
ECHO variable_file - the location of the property file containing
349350
ECHO the variable values for all variables used in
350351
ECHO the model
351352
ECHO.
352-
ECHO wlst-path - the Oracle Home subdirectory of the wlst.cmd
353+
ECHO wlst_path - the Oracle Home subdirectory of the wlst.cmd
353354
ECHO script to use (e.g., ^<ORACLE_HOME^>\soa).
354355
ECHO.
355-
ECHO rcu-database - the RCU database connect string (if the domain
356+
ECHO rcu_database - the RCU database connect string (if the domain
356357
ECHO type requires RCU).
357358
ECHO.
358-
ECHO rcu-prefix - the RCU prefix to use (if the domain type requires
359+
ECHO rcu_prefix - the RCU prefix to use (if the domain type requires
359360
ECHO RCU).
360361
ECHO.
361362
ECHO The -use_encryption switch tells the program that one or more of the

installer/src/main/bin/createDomain.sh

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# of the arguments are passed down to the underlying python program:
2020
#
2121
# - -oracle_home The directory of the existing Oracle Home to use.
22-
# This directory must exist and it is the caller^'s
22+
# This directory must exist and it is the caller's
2323
# responsibility to verify that it does. This
2424
# argument is required.
2525
#
@@ -52,54 +52,54 @@
5252
usage() {
5353
echo ""
5454
echo "Usage: $1 [-help] [-use_encryption] [-run_rcu]"
55-
echo " -oracle_home <oracle-home>"
56-
echo " [-domain_parent <domain-parent> | -domain_home <domain-home>]"
57-
echo " -domain_type <domain-type>"
58-
echo " [-java_home <java-home>]"
59-
echo " [-archive_file <archive-file>]"
60-
echo " [-model_file <model-file>]"
61-
echo " [-variable_file <variable-file>]"
62-
echo " [-wlst_path <wlst-path>]"
63-
echo " [-rcu_db <rcu-database>"
64-
echo " -rcu_prefix <rcu-prefix>"
55+
echo " -oracle_home <oracle_home>"
56+
echo " [-domain_parent <domain_parent> | -domain_home <domain_home>]"
57+
echo " -domain_type <domain_type>"
58+
echo " [-java_home <java_home>]"
59+
echo " [-archive_file <archive_file>]"
60+
echo " [-model_file <model_file>]"
61+
echo " [-variable_file <variable_file>]"
62+
echo " [-wlst_path <wlst_path>]"
63+
echo " [-rcu_db <rcu_database>"
64+
echo " -rcu_prefix <rcu_prefix>"
6565
echo " ]"
6666
echo ""
6767
echo " where:"
68-
echo " oracle-home - the existing Oracle Home directory for the domain."
68+
echo " oracle_home - the existing Oracle Home directory for the domain."
6969
echo ""
70-
echo " domain-parent - the parent directory where the domain should be created."
70+
echo " domain_parent - the parent directory where the domain should be created."
7171
echo " The domain name from the model will be appended to this"
7272
echo " location to become the domain home."
7373
echo ""
74-
echo " domain-home - the full directory where the domain should be created."
74+
echo " domain_home - the full directory where the domain should be created."
7575
echo " This is used in cases where the domain name is different"
7676
echo " from the domain home directory name."
7777
echo ""
78-
echo " domain-type - the type of domain (e.g., WLS, JRF). This controls"
78+
echo " domain_type - the type of domain (e.g., WLS, JRF). This controls"
7979
echo " the domain templates and template resource targeting."
80-
echo " Also used to locate wlst.cmd if wlst-path not specified."
80+
echo " Also used to locate wlst.cmd if -wlst_path not specified."
8181
echo ""
82-
echo " java-home - the Java Home to use for the new domain. If not"
82+
echo " java_home - the Java Home to use for the new domain. If not"
8383
echo " specified, it defaults to the value of the JAVA_HOME"
8484
echo " environment variable."
8585
echo ""
86-
echo " archive-file - the path to the archive file to use. If the -model_file"
86+
echo " archive_file - the path to the archive file to use. If the -model_file"
8787
echo " argument is not specified, the model file in this archive"
8888
echo " will be used."
8989
echo ""
90-
echo " model-file - the location of the model file to use."
90+
echo " model_file - the location of the model file to use."
9191
echo ""
92-
echo " variable-file - the location of the property file containing"
92+
echo " variable_file - the location of the property file containing"
9393
echo " the variable values for all variables used in"
9494
echo " the model"
9595
echo ""
96-
echo " wlst-path - the Oracle Home subdirectory of the wlst.cmd"
96+
echo " wlst_path - the Oracle Home subdirectory of the wlst.cmd"
9797
echo " script to use (e.g., <ORACLE_HOME>/soa)."
9898
echo ""
99-
echo " rcu-database - the RCU database connect string (if the domain"
99+
echo " rcu_database - the RCU database connect string (if the domain"
100100
echo " type requires RCU)."
101101
echo ""
102-
echo " rcu-prefix - the RCU prefix to use (if the domain type requires"
102+
echo " rcu_prefix - the RCU prefix to use (if the domain type requires"
103103
echo " RCU)."
104104
echo ""
105105
echo " The -use_encryption switch tells the program that one or more of the"
@@ -208,8 +208,8 @@ fi
208208
#
209209
# Validate the JVM version based on whether or not the user asked us to use encryption
210210
#
211-
JVM_FULL_VERSION=`${JAVA_EXE} -fullversion 2>&1 | awk -F "\"" '{ print $2 }'`
212-
JVM_VERSION=`echo ${JVM_FULL_VERSION} | awk -F "." '{ print $2 }'`
211+
JVM_FULL_VERSION=`${JAVA_EXE} -fullversion 2>&1 | awk -F"\"" '{ print $2 }'`
212+
JVM_VERSION=`echo ${JVM_FULL_VERSION} | awk -F"." '{ print $2 }'`
213213

214214
if [ ${JVM_VERSION} -lt ${MIN_JDK_VERSION} ]; then
215215
if [ ${JVM_VERSION} -lt 7 ]; then
@@ -227,11 +227,11 @@ fi
227227
# The underlying WLST script has other required arguments.
228228
#
229229
if [ "${ORACLE_HOME}" = "" ]; then
230-
echo "Required argument ORACLE_HOME not provided" >&2
230+
echo "Required argument -oracle_home not provided" >&2
231231
usage `basename $0`
232232
exit 99
233233
elif [ ! -d ${ORACLE_HOME} ]; then
234-
echo "The specified ORACLE_HOME does not exist: ${ORACLE_HOME}" >&2
234+
echo "The specified -oracle_home directory does not exist: ${ORACLE_HOME}" >&2
235235
exit 98
236236
fi
237237

@@ -240,12 +240,12 @@ fi
240240
#
241241
if [ "${WLST_PATH_DIR}" != "" ]; then
242242
if [ ! -d ${WLST_PATH_DIR} ]; then
243-
echo "WLST_PATH_DIR specified does not exist: ${WLST_PATH_DIR}" >&2
243+
echo "Specified -wlst_path directory does not exist: ${WLST_PATH_DIR}" >&2
244244
exit 98
245245
fi
246246
WLST=${WLST_PATH_DIR}/common/bin/wlst.sh
247247
if [ ! -x "${WLST}" ]; then
248-
echo "WLST executable ${WLST} not found under specified WLST_PATH_DIR: ${WLST_PATH_DIR}" >&2
248+
echo "WLST executable ${WLST} not found under -wlst_path directory: ${WLST_PATH_DIR}" >&2
249249
exit 98
250250
fi
251251
CLASSPATH=${WLSDEPLOY_HOME}/lib/weblogic-deploy-core.jar; export CLASSPATH

installer/src/main/bin/deployApps.cmd

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ SETLOCAL
5151

5252
SET WLSDEPLOY_PROGRAM_NAME=deployApps
5353

54+
SET SCRIPT_NAME=%~nx0
5455
SET SCRIPT_PATH=%~dp0
5556
FOR %%i IN ("%SCRIPT_PATH%") DO SET SCRIPT_PATH=%%~fsi
5657
IF %SCRIPT_PATH:~-1%==\ SET SCRIPT_PATH=%SCRIPT_PATH:~0,-1%
@@ -181,7 +182,7 @@ IF %JVM_VERSION% LSS %MIN_JDK_VERSION% (
181182
@rem The underlying WLST script has other required arguments.
182183
@rem
183184
IF "%ORACLE_HOME%" == "" (
184-
ECHO Required argument ORACLE_HOME not provided >&2
185+
ECHO Required argument -oracle_home not provided >&2
185186
SET RETURN_CODE=99
186187
GOTO usage
187188
)
@@ -192,13 +193,13 @@ IF "%ORACLE_HOME%" == "" (
192193
IF DEFINED WLST_PATH_DIR (
193194
FOR %%i IN ("%WLST_PATH_DIR%") DO SET WLST_PATH_DIR=%%~fsi
194195
IF NOT EXIST "%WLST_PATH_DIR%" (
195-
ECHO WLST_PATH_DIR specified does not exist: %WLST_PATH_DIR% >&2
196+
ECHO Specified -wlst_path directory does not exist: %WLST_PATH_DIR% >&2
196197
SET RETURN_CODE=98
197198
GOTO exit_script
198199
)
199200
set "WLST=%WLST_PATH_DIR%\common\bin\wlst.cmd"
200201
IF NOT EXIST "%WLST%" (
201-
ECHO WLST executable %WLST% not found under specified WLST_PATH_DIR %WLST_PATH_DIR% >&2
202+
ECHO WLST executable %WLST% not found under -wlst_path directory %WLST_PATH_DIR% >&2
202203
SET RETURN_CODE=98
203204
GOTO exit_script
204205
)
@@ -318,48 +319,41 @@ GOTO exit_script
318319

319320
:usage
320321
ECHO.
321-
ECHO Usage: %~nx0 [-help] [-use_encryption]
322-
ECHO -oracle_home ^<oracle-home^>
323-
ECHO -domain_home ^<domain-home^>
324-
ECHO [-archive_file ^<archive-file^>]
325-
ECHO [-model_file ^<model-file^>]
326-
ECHO [-prev_model_file ^<prev-model-file^>]
327-
ECHO [-variable_file ^<variable-file^>]
328-
ECHO [-domain_type ^<domain-type^>]
329-
ECHO [-wlst_path ^<wlst-path^>]
330-
ECHO [-admin_url ^<admin-url^>
331-
ECHO -admin_user ^<admin-user^>
322+
ECHO Usage: %SCRIPT_NAME% [-help] [-use_encryption]
323+
ECHO -oracle_home ^<oracle_home^>
324+
ECHO -domain_home ^<domain_home^>
325+
ECHO [-archive_file ^<archive_file^>]
326+
ECHO [-model_file ^<model_file^>]
327+
ECHO [-variable_file ^<variable_file^>]
328+
ECHO [-domain_type ^<domain_type^>]
329+
ECHO [-wlst_path ^<wlst_path^>]
330+
ECHO [-admin_url ^<admin_url^>
331+
ECHO -admin_user ^<admin_user^>
332332
ECHO ]
333333
ECHO.
334334
ECHO where:
335-
ECHO oracle-home - the existing Oracle Home directory for the domain
335+
ECHO oracle_home - the existing Oracle Home directory for the domain
336336
ECHO.
337-
ECHO domain-home - the domain home directory
337+
ECHO domain_home - the domain home directory
338338
ECHO.
339-
ECHO archive-file - the path to the archive file to use
339+
ECHO archive_file - the path to the archive file to use
340340
ECHO.
341-
ECHO model-file - the location of the model file to use,
341+
ECHO model_file - the location of the model file to use,
342342
ECHO the default is to get the model from the archive
343343
ECHO.
344-
ECHO prev-model-file - the location of the previous model file.
345-
ECHO.
346-
ECHO This is used to remove apps and resources that
347-
ECHO were previously deployed in addition to
348-
ECHO (re)deploying the current apps and resources
349-
ECHO.
350-
ECHO variable-file - the location of the property file containing
344+
ECHO variable_file - the location of the property file containing
351345
ECHO the variable values for all variables used in
352346
ECHO the model
353347
ECHO.
354-
ECHO domain-type - the type of domain (e.g., WLS, JRF).
355-
ECHO Used to locate wlst.cmd if wlst-path not specified
348+
ECHO domain_type - the type of domain (e.g., WLS, JRF).
349+
ECHO Used to locate wlst.cmd if -wlst_path not specified
356350
ECHO.
357-
ECHO wlst-path - the Oracle Home subdirectory of the wlst.cmd
351+
ECHO wlst_path - the Oracle Home subdirectory of the wlst.cmd
358352
ECHO script to use (e.g., ^<ORACLE_HOME^>\soa)
359353
ECHO.
360-
ECHO admin-url - the admin server URL (used for online deploy)
354+
ECHO admin_url - the admin server URL (used for online deploy)
361355
ECHO.
362-
ECHO admin-user - the admin username (used for online deploy)
356+
ECHO admin_user - the admin username (used for online deploy)
363357
ECHO.
364358
ECHO The -use_encryption switch tells the program that one or more of the
365359
ECHO passwords in the model or variables files are encrypted. The program will

0 commit comments

Comments
 (0)