Skip to content

Support remote app deploy #1355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d0475b1
initial checkin for remote app deployment
jshum2479 Dec 16, 2022
be4a9a2
update deployment strategy for remote app deploy
jshum2479 Dec 16, 2022
addffa6
Fix command line args requirement if -remote is used.
jshum2479 Dec 19, 2022
d32cb33
refactor cla vaidation
jshum2479 Jan 3, 2023
54d719d
refactor method name
jshum2479 Jan 3, 2023
0114cc9
add validation for remote update domain
jshum2479 Jan 4, 2023
a6b3e03
Bug fix for model context does not have domain name and home when usi…
jshum2479 Jan 5, 2023
af0bd92
Merge branch 'main' into support-remote-app-deploy
jshum2479 Jan 6, 2023
bd1cf25
Merge branch 'main' into support-remote-app-deploy
jshum2479 Jan 6, 2023
13cb877
Merge branch 'main' into support-remote-app-deploy
jshum2479 Jan 9, 2023
7d29faa
update CLI options
jshum2479 Jan 9, 2023
9589d42
fix bug for calculating hash when remote is specified.
jshum2479 Jan 10, 2023
094aa4f
refactor applicaiton_deployer for sonar
jshum2479 Jan 10, 2023
68dccb1
Merge branch 'main' into support-remote-app-deploy
jshum2479 Jan 10, 2023
426312e
add resource for tests
jshum2479 Jan 11, 2023
416cb28
update integration test
jshum2479 Jan 11, 2023
b8d63a4
update unit test
jshum2479 Jan 11, 2023
5470789
refactor
jshum2479 Jan 11, 2023
51335d9
doc and comments update
jshum2479 Jan 12, 2023
296e154
Merge branch 'main' into support-remote-app-deploy
jshum2479 Jan 12, 2023
cef55b1
Fix code error
jshum2479 Jan 12, 2023
f59234b
update copyrights
jshum2479 Jan 12, 2023
6724fb7
update doc
jshum2479 Jan 12, 2023
1e6f69a
doc update
jshum2479 Jan 12, 2023
5ef8176
pull out doc changes for this PR
jshum2479 Jan 14, 2023
990d1d0
refactor based on PR comments
jshum2479 Jan 18, 2023
fe906fd
remove obsolete method
jshum2479 Jan 18, 2023
38f8a69
remove extra line
jshum2479 Jan 18, 2023
ed3cff2
remove spaces
jshum2479 Jan 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions core/src/main/python/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@

__required_arguments = [
CommandLineArgUtil.ORACLE_HOME_SWITCH,
CommandLineArgUtil.DOMAIN_HOME_SWITCH,
CommandLineArgUtil.MODEL_FILE_SWITCH
]

__optional_arguments = [
# Used by shell script to locate WLST
CommandLineArgUtil.DOMAIN_HOME_SWITCH,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there ever a case where the model for a remote deploy operation might have a domain home token? If so, what happens if the user did not provide the domain home path on the remote machine?

CommandLineArgUtil.DOMAIN_TYPE_SWITCH,
CommandLineArgUtil.ARCHIVE_FILE_SWITCH,
CommandLineArgUtil.VARIABLE_FILE_SWITCH,
Expand All @@ -61,7 +61,8 @@
CommandLineArgUtil.PASSPHRASE_ENV_SWITCH,
CommandLineArgUtil.OUTPUT_DIR_SWITCH,
CommandLineArgUtil.DISCARD_CURRENT_EDIT_SWITCH,
CommandLineArgUtil.CANCEL_CHANGES_IF_RESTART_REQ_SWITCH
CommandLineArgUtil.CANCEL_CHANGES_IF_RESTART_REQ_SWITCH,
CommandLineArgUtil.REMOTE_SWITCH
]


Expand All @@ -72,6 +73,7 @@ def __process_args(args):
:raises CLAException: if an error occurs while validating and processing the command-line arguments
"""
global __wlst_mode
_method_name = '__process_args'

cla_util = CommandLineArgUtil(_program_name, __required_arguments, __optional_arguments)
cla_util.set_allow_multiple_models(True)
Expand All @@ -80,6 +82,7 @@ def __process_args(args):
cla_helper.validate_optional_archive(_program_name, argument_map)
cla_helper.validate_required_model(_program_name, argument_map)
cla_helper.validate_variable_file_exists(_program_name, argument_map)
cla_helper.validate_if_domain_home_required(_program_name, argument_map)

__wlst_mode = cla_helper.process_online_args(argument_map)
cla_helper.process_encryption_args(argument_map)
Expand Down Expand Up @@ -124,6 +127,10 @@ def __deploy_online(model, model_context, aliases):
__logger.info("WLSDPLY-09005", admin_url, timeout, method_name=_method_name, class_name=_class_name)

__wlst_helper.connect(admin_user, admin_pwd, admin_url, timeout)

model_context.set_domain_home_name_if_remote(__wlst_helper.get_domain_home_online(),
__wlst_helper.get_domain_name_online())

deployer_utils.ensure_no_uncommitted_changes_or_edit_sessions(skip_edit_session_check)
__wlst_helper.edit()
__logger.fine("WLSDPLY-09019", edit_lock_acquire_timeout, edit_lock_release_timeout, edit_lock_exclusive)
Expand Down
7 changes: 6 additions & 1 deletion core/src/main/python/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@

__required_arguments = [
CommandLineArgUtil.ORACLE_HOME_SWITCH,
CommandLineArgUtil.DOMAIN_HOME_SWITCH,
CommandLineArgUtil.MODEL_FILE_SWITCH
]

__optional_arguments = [
# Used by shell script to locate WLST
CommandLineArgUtil.DOMAIN_HOME_SWITCH,
CommandLineArgUtil.ARCHIVE_FILE_SWITCH,
CommandLineArgUtil.SKIP_ARCHIVE_FILE_SWITCH,
CommandLineArgUtil.DOMAIN_TYPE_SWITCH,
Expand Down Expand Up @@ -102,6 +102,7 @@ def __process_args(args):
argument_map = cla_util.process_args(args, TOOL_TYPE_DISCOVER)

__wlst_mode = cla_helper.process_online_args(argument_map)
cla_helper.validate_if_domain_home_required(_program_name, argument_map)
target_configuration_helper.process_target_arguments(argument_map)
__process_model_arg(argument_map)
__process_archive_filename_arg(argument_map)
Expand Down Expand Up @@ -356,6 +357,10 @@ def __connect_to_domain(model_context, helper):
try:
helper.connect(model_context.get_admin_user(), model_context.get_admin_password(),
model_context.get_admin_url(), model_context.get_model_config().get_connect_timeout())

model_context.set_domain_home_name_if_remote(helper.get_domain_home_online(),
helper.get_domain_name_online())

except PyWLSTException, wlst_ex:
ex = exception_helper.create_discover_exception('WLSDPLY-06001', model_context.get_admin_url(),
model_context.get_admin_user(),
Expand Down
19 changes: 18 additions & 1 deletion core/src/main/python/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
from wlsdeploy.util.exit_code import ExitCode
from wlsdeploy.util.model import Model
from wlsdeploy.util.weblogic_helper import WebLogicHelper
from wlsdeploy.tool.validate.validator import Validator
from oracle.weblogic.deploy.validate import ValidateException


wlst_helper.wlst_functions = globals()
Expand All @@ -44,12 +46,12 @@

__required_arguments = [
CommandLineArgUtil.ORACLE_HOME_SWITCH,
CommandLineArgUtil.DOMAIN_HOME_SWITCH,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same questions as for Deploy. For discoverDomain -remote, we still require the user to provide -domain_home to support tokenization. I would think we might need this for at least updateDomain -remote if not all remote operations.

CommandLineArgUtil.MODEL_FILE_SWITCH
]

__optional_arguments = [
# Used by shell script to locate WLST
CommandLineArgUtil.DOMAIN_HOME_SWITCH,
CommandLineArgUtil.DOMAIN_TYPE_SWITCH,
CommandLineArgUtil.ARCHIVE_FILE_SWITCH,
CommandLineArgUtil.VARIABLE_FILE_SWITCH,
Expand All @@ -66,6 +68,7 @@
CommandLineArgUtil.OUTPUT_DIR_SWITCH,
CommandLineArgUtil.UPDATE_RCU_SCHEMA_PASS_SWITCH,
CommandLineArgUtil.DISCARD_CURRENT_EDIT_SWITCH,
CommandLineArgUtil.REMOTE_SWITCH,
CommandLineArgUtil.WAIT_FOR_EDIT_LOCK_SWITCH
]

Expand All @@ -85,6 +88,7 @@ def __process_args(args):
cla_helper.validate_optional_archive(_program_name, argument_map)
cla_helper.validate_required_model(_program_name, argument_map)
cla_helper.validate_variable_file_exists(_program_name, argument_map)
cla_helper.validate_if_domain_home_required(_program_name, argument_map)

__wlst_mode = cla_helper.process_online_args(argument_map)
cla_helper.process_encryption_args(argument_map)
Expand Down Expand Up @@ -130,14 +134,27 @@ def __update_online(model, model_context, aliases):
__logger.info("WLSDPLY-09005", admin_url, timeout, method_name=_method_name, class_name=_class_name)

try:

if model_context.is_remote():
model_validator = Validator(model_context, aliases, logger=__logger, wlst_mode=WlstModes.ONLINE)
model_validator.validate_in_tool_mode(model.get_model(), None,
model_context.get_archive_file_name())

__wlst_helper.connect(admin_user, admin_pwd, admin_url, timeout)

# -remote does not have domain home set, so get it from online wlst after connect
model_context.set_domain_home_name_if_remote(__wlst_helper.get_domain_home_online(),
__wlst_helper.get_domain_name_online())

deployer_utils.ensure_no_uncommitted_changes_or_edit_sessions(skip_edit_session_check)
__wlst_helper.edit()
__logger.fine("WLSDPLY-09019", edit_lock_acquire_timeout, edit_lock_release_timeout, edit_lock_exclusive)
__wlst_helper.start_edit(acquire_timeout=edit_lock_acquire_timeout, release_timeout=edit_lock_release_timeout,
exclusive=edit_lock_exclusive)
if model_context.is_discard_current_edit():
deployer_utils.discard_current_edit()
except ValidateException, ve:
raise ve
except BundleAwareException, ex:
raise ex

Expand Down
1 change: 1 addition & 0 deletions core/src/main/python/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
]

__optional_arguments = [
CommandLineArgUtil.REMOTE_SWITCH,
CommandLineArgUtil.DOMAIN_TYPE_SWITCH, # Used by shell script to locate WLST
CommandLineArgUtil.MODEL_FILE_SWITCH,
CommandLineArgUtil.ARCHIVE_FILE_SWITCH,
Expand Down
Loading