Skip to content

Commit

Permalink
Merge branch 'skip_archive_deployment_plan_fix' into 'main'
Browse files Browse the repository at this point in the history
fixing GitHub issue 1607 for handling deployment plan discovery with -skip_archive or -remote

See merge request weblogic-cloud/weblogic-deploy-tooling!1765
  • Loading branch information
robertpatrick committed Jan 13, 2025
2 parents 45156de + 706b155 commit fcd55b0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,10 @@ def _disconnect_target(self, application_name, application_dict, message):
def _get_plan_path(self, plan_path, archive_file, source_name, deployment_type, deployment_name, deployment_dict):
_method_name = '_get_plan_path'

if self._model_context.is_skip_archive():
# Just return None so that the model plan file stays the same.
return None

plan_dir = None
if model_constants.PLAN_DIR in deployment_dict:
plan_dir = deployment_dict[model_constants.PLAN_DIR]
Expand All @@ -551,19 +555,21 @@ def _get_plan_path(self, plan_path, archive_file, source_name, deployment_type,

if deployment_type == model_constants.LIBRARY:
archive_entry_type = WLSDeployArchive.ArchiveEntryType.SHLIB_PLAN
download_file_type = 'sharedLibraries'
remote_archive_path = WLSDeployArchive.getShlibPlanArchivePath(plan_file_name)
archive_add_method = archive_file.addSharedLibraryDeploymentPlan
else:
archive_entry_type = WLSDeployArchive.ArchiveEntryType.APPLICATION_PLAN
download_file_type = 'applications'
remote_archive_path = WLSDeployArchive.getApplicationPlanArchivePath(plan_file_name)
archive_add_method = archive_file.addApplicationDeploymentPlan

if self._model_context.is_remote():
new_plan_name = remote_archive_path
self.add_to_remote_map(plan_path, new_plan_name, archive_entry_type.name())
elif not self._model_context.is_skip_archive():
else:
if deployment_type == model_constants.LIBRARY:
download_file_type = 'sharedLibraries'
archive_add_method = archive_file.addSharedLibraryDeploymentPlan
else:
download_file_type = 'applications'
archive_add_method = archive_file.addApplicationDeploymentPlan
try:
if self._model_context.is_ssh():
plan_file_name = self.download_deployment_from_remote_server(
Expand All @@ -582,7 +588,7 @@ def _get_plan_path(self, plan_path, archive_file, source_name, deployment_type,
_logger.throwing(class_name=_class_name, method_name=_method_name, error=de)
raise de

return new_plan_name
return new_plan_name

def _resolve_deployment_plan_path(self, plan_dir, plan_path):
"""
Expand Down
12 changes: 9 additions & 3 deletions documentation/4.0/content/userguide/tools/discover.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,24 @@ behavior.
means that the tool must run on the same host as the domain's Administration Server and that the user running the
tool needs full read access to the domain home directory structure. By default, the tool will gather files referenced
by the domain configuration (for example, applications, domain libraries) and store those files in a zip file known as
the archive file. To prevent the collection of these files, simply add the `-skip_archive` argument to the
command-line use to invoke the tool.
the archive file.

To prevent the collection of these files, simply add the `-skip_archive` argument to the
command-line use to invoke the tool. This will result in a model file that has the original paths to the files that
could not be collected.
- online mode - Online mode uses WLST online to read the domain configuration using the Administration Server's MBeans.
The user running the tool needs to provide the administrative credentials and URL to connect to the Administration
Server. There are four options when running the tool:
- Normal mode (default) - In this mode, the tool must run on the same host as the domain's Administration Server
and the user running the tool must have full read access to the domain home directory structure and any other
locations where domain-specific files are stored.
- `-skip_archive` mode - In this mode, the tool can be run from anywhere since the archive file is not being created.
As with offline mode, this will result in a model file that has the original paths to the files that
could not be collected.
- `-remote` mode - This mode is similar to `-skip_archive` mode except that the tool will generate a list of `TODO`
messages that inform the user which artifacts needs to be gathered and added to an archive file in order to create
a complete model of the domain.
a complete model of the domain. The model file will be populated with the archive paths that need to be collected
and added to an archive file to allow a new domain to be created.
- SSH mode - In this mode, the tool can be run from any host for which you have set up SSH connectivity between the
host where WDT is running and the host where the Administration Server is running. The `-ssh_user` (which, by
default, is the same user running the tool) must have full read access to the domain home directory structure and
Expand Down

0 comments on commit fcd55b0

Please sign in to comment.