summaryrefslogtreecommitdiffstats
path: root/base/server/python/pki/server
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2014-02-25 12:01:55 -0500
committerEndi S. Dewata <edewata@redhat.com>2014-03-07 22:50:31 -0500
commitb944d31ef744a220f176bf7143e727223ad6b3b1 (patch)
tree845e86128c25df494e7b5a6bd378f8074f423423 /base/server/python/pki/server
parent60134cccd26eb872636427afe3fe1c07a253627f (diff)
downloadpki-b944d31ef744a220f176bf7143e727223ad6b3b1.tar.gz
pki-b944d31ef744a220f176bf7143e727223ad6b3b1.tar.xz
pki-b944d31ef744a220f176bf7143e727223ad6b3b1.zip
Direct deployment for TPS.
The deployment tool has been modified to deploy TPS directly from the share folder. This way the TPS UI can be upgraded automatically with RPM upgrade without having to write upgrade scripts. For this to work, the TPS web application files cannot contain any slot parameters. So, the cfgPath parameter has been removed from web.xml, and the CMSStartServlet has been modified such that if the parameter is missing it would generate a default path matching the original value in web.xml. Also, the velocity.properties has been modified to use a fixed value for the file.resource.loader.path parameter pointing to the share folder. In the future other subsystems may be modified to use the same deployment mechanism. Ticket #748, #752, #499
Diffstat (limited to 'base/server/python/pki/server')
-rw-r--r--base/server/python/pki/server/deployment/scriptlets/slot_substitution.py14
-rw-r--r--base/server/python/pki/server/deployment/scriptlets/webapp_deployment.py55
2 files changed, 47 insertions, 22 deletions
diff --git a/base/server/python/pki/server/deployment/scriptlets/slot_substitution.py b/base/server/python/pki/server/deployment/scriptlets/slot_substitution.py
index a6c21e166..cc54cc49c 100644
--- a/base/server/python/pki/server/deployment/scriptlets/slot_substitution.py
+++ b/base/server/python/pki/server/deployment/scriptlets/slot_substitution.py
@@ -67,10 +67,16 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
deployer.master_dict['pki_source_tomcat_conf'],
deployer.master_dict['pki_target_tomcat_conf'],
overwrite_flag=True)
- deployer.file.apply_slot_substitution(
- deployer.master_dict['pki_target_velocity_properties'])
- deployer.file.apply_slot_substitution(
- deployer.master_dict['pki_target_subsystem_web_xml'])
+
+ # Configure web.xml and velocity.properties for each subsystem.
+ # For TPS this is not necessary since the files are no longer
+ # copied to the target location in the instance directory.
+ if deployer.master_dict['pki_subsystem'] != "TPS":
+ deployer.file.apply_slot_substitution(
+ deployer.master_dict['pki_target_velocity_properties'])
+ deployer.file.apply_slot_substitution(
+ deployer.master_dict['pki_target_subsystem_web_xml'])
+
# Strip "<filter>" section from subsystem "web.xml"
# This is ONLY necessary because XML comments cannot be "nested"!
# deployer.file.copy(deployer.master_dict['pki_target_subsystem_web_xml'],
diff --git a/base/server/python/pki/server/deployment/scriptlets/webapp_deployment.py b/base/server/python/pki/server/deployment/scriptlets/webapp_deployment.py
index 975028d73..0f529a9a2 100644
--- a/base/server/python/pki/server/deployment/scriptlets/webapp_deployment.py
+++ b/base/server/python/pki/server/deployment/scriptlets/webapp_deployment.py
@@ -44,10 +44,40 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
config.pki_log.info(log.WEBAPP_DEPLOYMENT_SPAWN_1, __name__,
extra=config.PKI_INDENTATION_LEVEL_1)
+ # For TPS, deploy web application directly from /usr/share/pki.
+ if deployer.master_dict['pki_subsystem'] == "TPS":
+ deployer.file.copy(
+ os.path.join(
+ config.PKI_DEPLOYMENT_SOURCE_ROOT,
+ "tps",
+ "conf",
+ "Catalina",
+ "localhost",
+ "tps.xml"),
+ os.path.join(
+ deployer.master_dict['pki_instance_configuration_path'],
+ "Catalina",
+ "localhost",
+ "tps.xml"))
+ return self.rv
+
+ # For other subsystems, deploy web application into Tomcat instance.
+ deployer.directory.create(deployer.master_dict['pki_tomcat_webapps_subsystem_path'])
+
+ # Copy /usr/share/pki/<subsystem>/webapps/<subsystem>
+ # to <instance>/webapps/<subsystem>
+ deployer.directory.copy(
+ os.path.join(
+ config.PKI_DEPLOYMENT_SOURCE_ROOT,
+ deployer.master_dict['pki_subsystem'].lower(),
+ "webapps",
+ deployer.master_dict['pki_subsystem'].lower()),
+ deployer.master_dict['pki_tomcat_webapps_subsystem_path'],
+ overwrite_flag=True)
+
# Copy /usr/share/pki/server/webapps/pki/admin
# to <instance>/webapps/<subsystem>/admin
# TODO: common templates should be deployed in common webapp
- deployer.directory.create(deployer.master_dict['pki_tomcat_webapps_subsystem_path'])
deployer.directory.copy(
os.path.join(
config.PKI_DEPLOYMENT_SOURCE_ROOT,
@@ -60,17 +90,6 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
"admin"),
overwrite_flag=True)
- # Copy /usr/share/pki/<subsystem>/webapps/<subsystem>
- # to <instance>/webapps/<subsystem>
- deployer.directory.copy(
- os.path.join(
- config.PKI_DEPLOYMENT_SOURCE_ROOT,
- deployer.master_dict['pki_subsystem'].lower(),
- "webapps",
- deployer.master_dict['pki_subsystem'].lower()),
- deployer.master_dict['pki_tomcat_webapps_subsystem_path'],
- overwrite_flag=True)
-
deployer.directory.create(
deployer.master_dict['pki_tomcat_webapps_subsystem_webinf_classes_path'])
deployer.directory.create(
@@ -100,13 +119,12 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
elif deployer.master_dict['pki_subsystem'] == "TKS":
deployer.symlink.create(deployer.master_dict['pki_tks_jar'],
deployer.master_dict['pki_tks_jar_link'])
- elif deployer.master_dict['pki_subsystem'] == "TPS":
- deployer.symlink.create(deployer.master_dict['pki_tps_jar'],
- deployer.master_dict['pki_tps_jar_link'])
+
# set ownerships, permissions, and acls
deployer.directory.set_mode(deployer.master_dict['pki_tomcat_webapps_subsystem_path'])
- # Copy /usr/share/pki/<subsystem>/conf/Catalina/localhost/<subsystem>.xml
+ # Copy web application context file
+ # from /usr/share/pki/<subsystem>/conf/Catalina/localhost/<subsystem>.xml
# to <instance>/conf/Catalina/localhost/<subsystem>.xml
deployer.file.copy(
os.path.join(
@@ -137,7 +155,8 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet):
"localhost",
deployer.master_dict['pki_subsystem'].lower() + ".xml"))
- # Delete <instance>/webapps/<subsystem>
- deployer.directory.delete(deployer.master_dict['pki_tomcat_webapps_subsystem_path'])
+ # For subsystems other than TPS, delete <instance>/webapps/<subsystem>.
+ if deployer.master_dict['pki_subsystem'] != "TPS":
+ deployer.directory.delete(deployer.master_dict['pki_tomcat_webapps_subsystem_path'])
return self.rv