From 4d3049c36d8e6a5a0c999daaa6fdd856af00525c Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Wed, 22 Apr 2015 18:33:11 -0400 Subject: Added direct deployment for theme. The deployment tool has been modified to deploy the theme files directly from /usr/share/pki. New deployment descriptors have been added for admin templates and JS library. https://fedorahosted.org/pki/ticket/499 --- .../deployment/scriptlets/instance_layout.py | 60 +++++++++++++--------- .../tomcat7/conf/Catalina/localhost/ROOT.xml | 2 +- .../tomcat7/conf/Catalina/localhost/pki#admin.xml | 30 +++++++++++ .../tomcat7/conf/Catalina/localhost/pki#js.xml | 30 +++++++++++ .../server/tomcat7/conf/Catalina/localhost/pki.xml | 2 +- .../tomcat8/conf/Catalina/localhost/ROOT.xml | 2 +- .../tomcat8/conf/Catalina/localhost/pki#admin.xml | 32 ++++++++++++ .../tomcat8/conf/Catalina/localhost/pki#js.xml | 32 ++++++++++++ .../server/tomcat8/conf/Catalina/localhost/pki.xml | 2 +- 9 files changed, 163 insertions(+), 29 deletions(-) create mode 100644 base/server/tomcat7/conf/Catalina/localhost/pki#admin.xml create mode 100644 base/server/tomcat7/conf/Catalina/localhost/pki#js.xml create mode 100644 base/server/tomcat8/conf/Catalina/localhost/pki#admin.xml create mode 100644 base/server/tomcat8/conf/Catalina/localhost/pki#js.xml (limited to 'base/server') diff --git a/base/server/python/pki/server/deployment/scriptlets/instance_layout.py b/base/server/python/pki/server/deployment/scriptlets/instance_layout.py index 3a4d3faa3..ebcedc2e0 100644 --- a/base/server/python/pki/server/deployment/scriptlets/instance_layout.py +++ b/base/server/python/pki/server/deployment/scriptlets/instance_layout.py @@ -60,7 +60,9 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): deployer.deploy_webapp( "ROOT", os.path.join( - deployer.mdict['pki_tomcat_common_webapps_path'], + config.PKI_DEPLOYMENT_SOURCE_ROOT, + "server", + "webapps", "ROOT"), os.path.join( deployer.mdict['pki_source_server_path'], @@ -68,18 +70,46 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): "localhost", "ROOT.xml")) - # Deploy pki web application + # Deploy theme web application deployer.deploy_webapp( "pki", - os.path.join( - deployer.mdict['pki_tomcat_common_webapps_path'], - "pki"), + deployer.mdict['pki_theme_server_dir'], os.path.join( deployer.mdict['pki_source_server_path'], "Catalina", "localhost", "pki.xml")) + # Deploy admin templates + deployer.deploy_webapp( + "pki#admin", + os.path.join( + config.PKI_DEPLOYMENT_SOURCE_ROOT, + "server", + "webapps", + "pki", + "admin"), + os.path.join( + deployer.mdict['pki_source_server_path'], + "Catalina", + "localhost", + "pki#admin.xml")) + + # Deploy JS library + deployer.deploy_webapp( + "pki#js", + os.path.join( + config.PKI_DEPLOYMENT_SOURCE_ROOT, + "server", + "webapps", + "pki", + "js"), + os.path.join( + deployer.mdict['pki_source_server_path'], + "Catalina", + "localhost", + "pki#js.xml")) + # establish Tomcat instance base deployer.directory.create(deployer.mdict['pki_tomcat_common_path']) deployer.directory.create( @@ -99,26 +129,6 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): deployer.mdict['pki_instance_lib_log4j_properties']) deployer.directory.create(deployer.mdict['pki_tomcat_tmpdir_path']) - # Copy /usr/share/pki/server/webapps to /common/webapps - deployer.directory.copy( - os.path.join( - config.PKI_DEPLOYMENT_SOURCE_ROOT, - "server", - "webapps"), - deployer.mdict['pki_tomcat_common_webapps_path']) - - # If desired and available, - # copy selected server theme - # to /common/webapps/pki - if config.str2bool(deployer.mdict['pki_theme_enable']) and\ - os.path.exists(deployer.mdict['pki_theme_server_dir']): - deployer.directory.copy( - deployer.mdict['pki_theme_server_dir'], - os.path.join( - deployer.mdict['pki_tomcat_common_webapps_path'], - "pki"), - overwrite_flag=True) - deployer.directory.create(deployer.mdict['pki_tomcat_work_path']) deployer.directory.create( deployer.mdict['pki_tomcat_work_catalina_path']) diff --git a/base/server/tomcat7/conf/Catalina/localhost/ROOT.xml b/base/server/tomcat7/conf/Catalina/localhost/ROOT.xml index ce98bfa4e..2a052f52c 100644 --- a/base/server/tomcat7/conf/Catalina/localhost/ROOT.xml +++ b/base/server/tomcat7/conf/Catalina/localhost/ROOT.xml @@ -22,7 +22,7 @@ See the License for the specific language governing permissions and limitations under the License. --> - + diff --git a/base/server/tomcat7/conf/Catalina/localhost/pki#admin.xml b/base/server/tomcat7/conf/Catalina/localhost/pki#admin.xml new file mode 100644 index 000000000..e7f2e54a3 --- /dev/null +++ b/base/server/tomcat7/conf/Catalina/localhost/pki#admin.xml @@ -0,0 +1,30 @@ + + + + + + + + + diff --git a/base/server/tomcat7/conf/Catalina/localhost/pki#js.xml b/base/server/tomcat7/conf/Catalina/localhost/pki#js.xml new file mode 100644 index 000000000..cef2f1c6b --- /dev/null +++ b/base/server/tomcat7/conf/Catalina/localhost/pki#js.xml @@ -0,0 +1,30 @@ + + + + + + + + + diff --git a/base/server/tomcat7/conf/Catalina/localhost/pki.xml b/base/server/tomcat7/conf/Catalina/localhost/pki.xml index ce98bfa4e..77d1f27b1 100644 --- a/base/server/tomcat7/conf/Catalina/localhost/pki.xml +++ b/base/server/tomcat7/conf/Catalina/localhost/pki.xml @@ -22,7 +22,7 @@ See the License for the specific language governing permissions and limitations under the License. --> - + diff --git a/base/server/tomcat8/conf/Catalina/localhost/ROOT.xml b/base/server/tomcat8/conf/Catalina/localhost/ROOT.xml index e70dd2055..f7659800c 100644 --- a/base/server/tomcat8/conf/Catalina/localhost/ROOT.xml +++ b/base/server/tomcat8/conf/Catalina/localhost/ROOT.xml @@ -22,7 +22,7 @@ See the License for the specific language governing permissions and limitations under the License. --> - + diff --git a/base/server/tomcat8/conf/Catalina/localhost/pki#admin.xml b/base/server/tomcat8/conf/Catalina/localhost/pki#admin.xml new file mode 100644 index 000000000..16db43605 --- /dev/null +++ b/base/server/tomcat8/conf/Catalina/localhost/pki#admin.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + diff --git a/base/server/tomcat8/conf/Catalina/localhost/pki#js.xml b/base/server/tomcat8/conf/Catalina/localhost/pki#js.xml new file mode 100644 index 000000000..9b0903ddf --- /dev/null +++ b/base/server/tomcat8/conf/Catalina/localhost/pki#js.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + diff --git a/base/server/tomcat8/conf/Catalina/localhost/pki.xml b/base/server/tomcat8/conf/Catalina/localhost/pki.xml index e70dd2055..1e87c1cd5 100644 --- a/base/server/tomcat8/conf/Catalina/localhost/pki.xml +++ b/base/server/tomcat8/conf/Catalina/localhost/pki.xml @@ -22,7 +22,7 @@ See the License for the specific language governing permissions and limitations under the License. --> - + -- cgit