Skip to content

Commit 6ad3d0b

Browse files
Issue #661 staging mode for deploy apps (#681)
1 parent 125f0ab commit 6ad3d0b

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

core/src/main/python/wlsdeploy/aliases/model_constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@
352352
SET_OPTION_JAVA_HOME = 'JavaHome'
353353
SET_OPTION_SERVER_START_MODE = 'ServerStartMode'
354354
SOURCE_PATH = 'SourcePath'
355+
STAGE_MODE = 'StageMode'
355356
TAGS = 'Tags'
356357
TARGETS = 'Targets'
357358
URL = 'URL'

core/src/main/python/wlsdeploy/tool/deploy/applications_deployer.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
from wlsdeploy.aliases.model_constants import RESOURCE_GROUP_TEMPLATE
3030
from wlsdeploy.aliases.model_constants import SECURITY_DD_MODEL
3131
from wlsdeploy.aliases.model_constants import SOURCE_PATH
32+
from wlsdeploy.aliases.model_constants import STAGE_MODE
3233
from wlsdeploy.aliases.model_constants import TARGET
3334
from wlsdeploy.aliases.model_constants import TARGETS
3435
from wlsdeploy.aliases.wlst_modes import WlstModes
@@ -292,7 +293,6 @@ def __online_deploy_apps_and_libs(self, base_location):
292293
self.logger.exiting(class_name=self._class_name, method_name=_method_name)
293294
return
294295

295-
296296
###########################################################################
297297
# Private utility methods #
298298
###########################################################################
@@ -851,8 +851,9 @@ def __deploy_model_applications(self, model_apps, app_location, deployed_applist
851851
self.__get_mt_names_from_location(location)
852852

853853
new_app_name = self.__deploy_app_online(app_name, src_path, targets, plan=plan_file,
854-
partition=partition_name, resource_group=resource_group_name,
855-
resource_group_template=resource_group_template_name, options=options)
854+
partition=partition_name, resource_group=resource_group_name,
855+
resource_group_template=resource_group_template_name,
856+
options=options)
856857
location.remove_name_token(token_name)
857858
deployed_applist.append(new_app_name)
858859
return
@@ -1135,6 +1136,7 @@ def __start_all_apps(self, deployed_app_list, base_location):
11351136
self.__start_app(app)
11361137
return
11371138

1139+
11381140
def _get_deploy_options(model_apps, app_name, library_module):
11391141
"""
11401142
Get the deploy command options.
@@ -1145,7 +1147,7 @@ def _get_deploy_options(model_apps, app_name, library_module):
11451147
"""
11461148
deploy_options = OrderedDict()
11471149
# not sure about altDD, altWlsDD
1148-
for option in [DEPLOYMENT_ORDER, SECURITY_DD_MODEL, PLAN_STAGE_MODE]:
1150+
for option in [DEPLOYMENT_ORDER, SECURITY_DD_MODEL, PLAN_STAGE_MODE, STAGE_MODE]:
11491151
app = dictionary_utils.get_dictionary_element(model_apps, app_name)
11501152
value = dictionary_utils.get_element(app, option)
11511153

@@ -1156,6 +1158,8 @@ def _get_deploy_options(model_apps, app_name, library_module):
11561158
option_name = 'securityModel'
11571159
elif option == PLAN_STAGE_MODE:
11581160
option_name = 'planStageMode'
1161+
elif option == STAGE_MODE:
1162+
option_name = 'stageMode'
11591163

11601164
if value is not None:
11611165
deploy_options[option_name] = str(value)
@@ -1167,6 +1171,7 @@ def _get_deploy_options(model_apps, app_name, library_module):
11671171
deploy_options = None
11681172
return deploy_options
11691173

1174+
11701175
def _find_deployorder_list(apps_dict, ordered_list, order):
11711176
"""
11721177
Get the deployment order for the apps

core/src/main/python/wlsdeploy/util/model_context.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,8 +645,11 @@ def replace_tokens(self, resource_type, resource_name, attribute_name, resource_
645645
:param resource_dict: the dictionary to use to lookup and replace the attribute value
646646
"""
647647
attribute_value = resource_dict[attribute_name]
648+
if attribute_value is None:
649+
return
648650
uri = URI(attribute_value)
649-
if uri.getScheme().startsWith('file'):
651+
uri_scheme = uri.getScheme()
652+
if uri_scheme is not None and uri_scheme.startsWith('file'):
650653
attribute_value = uri.getPath()
651654
if attribute_value.startswith(self.ORACLE_HOME_TOKEN):
652655
message = "Replacing {0} in {1} {2} {3} with {4}"

0 commit comments

Comments
 (0)