diff options
author | Endi Sukma Dewata <edewata@redhat.com> | 2012-11-01 21:06:21 -0400 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-11-06 15:43:41 -0500 |
commit | 70a0dd855426c4bab4a17cb5b2731f48f049c4be (patch) | |
tree | bb9aa8d3a6943bb68bd16bdf0eea413329b9f563 | |
parent | a80e994148a81914858f82b14af5fad90e12533d (diff) | |
download | pki-70a0dd855426c4bab4a17cb5b2731f48f049c4be.tar.gz pki-70a0dd855426c4bab4a17cb5b2731f48f049c4be.tar.xz pki-70a0dd855426c4bab4a17cb5b2731f48f049c4be.zip |
Merged theme files.
Currently the theme files are copied into each subsystem during
deployment creating duplicates. To reduce the problem the files
should be combined into a common folder /pki.
The process will be done over several patches. Initially this patch
will copy the images and CSS files into /pki/images and /pki/css.
Subsequent patches will update references to these files to the new
location. When it's done, the files no longer need to be copied
into each subsystem.
Ticket #328
-rw-r--r-- | base/deploy/src/scriptlets/instance_layout.py | 164 | ||||
-rwxr-xr-x | base/setup/pkicreate | 33 |
2 files changed, 192 insertions, 5 deletions
diff --git a/base/deploy/src/scriptlets/instance_layout.py b/base/deploy/src/scriptlets/instance_layout.py index 219f049c8..b4d1a5068 100644 --- a/base/deploy/src/scriptlets/instance_layout.py +++ b/base/deploy/src/scriptlets/instance_layout.py @@ -71,12 +71,90 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): util.directory.create(master['pki_tomcat_tmpdir_path']) util.directory.create(master['pki_tomcat_webapps_path']) util.directory.create(master['pki_tomcat_webapps_common_path']) + + common_images = os.path.join( + master['pki_tomcat_webapps_common_path'], + "images") + + # Copy /usr/share/pki/common-ui/admin/console/img + # to <instance>/webapp/pki/images util.directory.copy( os.path.join( config.PKI_DEPLOYMENT_SOURCE_ROOT, - "common-ui"), - master['pki_tomcat_webapps_common_path'], + "common-ui", + "admin", + "console", + "img"), + common_images, overwrite_flag=True) + + # Copy /usr/share/pki/common-ui/css + # to <instance>/webapp/pki/css + util.directory.copy( + os.path.join( + config.PKI_DEPLOYMENT_SOURCE_ROOT, + "common-ui", + "css"), + os.path.join( + master['pki_tomcat_webapps_common_path'], + "css"), + overwrite_flag=True) + + # Copy /usr/share/pki/common-ui/img + # to <instance>/webapp/pki/images + util.directory.copy( + os.path.join( + config.PKI_DEPLOYMENT_SOURCE_ROOT, + "common-ui", + "img"), + common_images, + overwrite_flag=True) + + # Copy /usr/share/pki/<subsystem>-ui/webapps/<subsystem>/admin/graphics + # to <instance>/webapp/pki/images + dir = os.path.join( + config.PKI_DEPLOYMENT_SOURCE_ROOT, + master['pki_subsystem'].lower() + "-ui", + "webapps", + master['pki_subsystem'].lower(), + "admin", + "graphics") + if (util.directory.exists(dir)): + util.directory.copy( + dir, + common_images, + overwrite_flag=True) + + # Copy /usr/share/pki/<subsystem>-ui/webapps/<subsystem>/agent/graphics + # to <instance>/webapp/pki/images + dir = os.path.join( + config.PKI_DEPLOYMENT_SOURCE_ROOT, + master['pki_subsystem'].lower() + "-ui", + "webapps", + master['pki_subsystem'].lower(), + "agent", + "graphics") + if (util.directory.exists(dir)): + util.directory.copy( + dir, + common_images, + overwrite_flag=True) + + # Copy /usr/share/pki/<subsystem>-ui/webapps/<subsystem>/ee/graphics + # to <instance>/webapp/pki/images + dir = os.path.join( + config.PKI_DEPLOYMENT_SOURCE_ROOT, + master['pki_subsystem'].lower() + "-ui", + "webapps", + master['pki_subsystem'].lower(), + "ee", + "graphics") + if (util.directory.exists(dir)): + util.directory.copy( + dir, + common_images, + overwrite_flag=True) + util.directory.create(master['pki_tomcat_webapps_root_path']) util.directory.copy( os.path.join( @@ -180,12 +258,90 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): util.directory.modify(master['pki_instance_lib']) util.directory.modify(master['pki_instance_lib_log4j_properties']) util.directory.modify(master['pki_tomcat_webapps_path']) + + common_images = os.path.join( + master['pki_tomcat_webapps_common_path'], + "images") + + # Copy /usr/share/pki/common-ui/admin/console/img + # to <instance>/webapp/pki/images util.directory.copy( os.path.join( config.PKI_DEPLOYMENT_SOURCE_ROOT, - "common-ui"), - master['pki_tomcat_webapps_common_path'], + "common-ui", + "admin", + "console", + "img"), + common_images, overwrite_flag=True) + + # Copy /usr/share/pki/common-ui/css + # to <instance>/webapp/pki/css + util.directory.copy( + os.path.join( + config.PKI_DEPLOYMENT_SOURCE_ROOT, + "common-ui", + "css"), + os.path.join( + master['pki_tomcat_webapps_common_path'], + "css"), + overwrite_flag=True) + + # Copy /usr/share/pki/common-ui/img + # to <instance>/webapp/pki/images + util.directory.copy( + os.path.join( + config.PKI_DEPLOYMENT_SOURCE_ROOT, + "common-ui", + "img"), + common_images, + overwrite_flag=True) + + # Copy /usr/share/pki/<subsystem>-ui/webapps/<subsystem>/admin/graphics + # to <instance>/webapp/pki/images + dir = os.path.join( + config.PKI_DEPLOYMENT_SOURCE_ROOT, + master['pki_subsystem'].lower() + "-ui", + "webapps", + master['pki_subsystem'].lower(), + "admin", + "graphics") + if (util.directory.exists(dir)): + util.directory.copy( + dir, + common_images, + overwrite_flag=True) + + # Copy /usr/share/pki/<subsystem>-ui/webapps/<subsystem>/agent/graphics + # to <instance>/webapp/pki/images + dir = os.path.join( + config.PKI_DEPLOYMENT_SOURCE_ROOT, + master['pki_subsystem'].lower() + "-ui", + "webapps", + master['pki_subsystem'].lower(), + "agent", + "graphics") + if (util.directory.exists(dir)): + util.directory.copy( + dir, + common_images, + overwrite_flag=True) + + # Copy /usr/share/pki/<subsystem>-ui/webapps/<subsystem>/ee/graphics + # to <instance>/webapp/pki/images + dir = os.path.join( + config.PKI_DEPLOYMENT_SOURCE_ROOT, + master['pki_subsystem'].lower() + "-ui", + "webapps", + master['pki_subsystem'].lower(), + "ee", + "graphics") + if (util.directory.exists(dir)): + util.directory.copy( + dir, + common_images, + overwrite_flag=True) + util.directory.copy( os.path.join( config.PKI_DEPLOYMENT_SOURCE_ROOT, diff --git a/base/setup/pkicreate b/base/setup/pkicreate index 506e766ef..767960778 100755 --- a/base/setup/pkicreate +++ b/base/setup/pkicreate @@ -2061,11 +2061,42 @@ sub process_pki_directories $default_dir_permissions, $default_file_permissions, $pki_user, $pki_group); - return 0 if !copy_directory($ui_subsystem_path, $pki_instance_path, $default_dir_permissions, $default_file_permissions, $pki_user, $pki_group); + # Copy /usr/share/pki/common-ui/admin/console/img + # to <instance>/docroot/pki/images + return 0 if !copy_directory( + "$common_ui_subsystem_path/admin/console/img", + "$docroot_instance_path/pki/images", + $default_dir_permissions, $default_file_permissions, + $pki_user, $pki_group); + + # Copy /usr/share/pki/common-ui/css + # to <instance>/docroot/pki/css + return 0 if !copy_directory( + "$common_ui_subsystem_path/css", + "$docroot_instance_path/pki/css", + $default_dir_permissions, $default_file_permissions, + $pki_user, $pki_group); + + # Copy /usr/share/pki/common-ui/img + # to <instance>/docroot/pki/images + return 0 if !copy_directory( + "$common_ui_subsystem_path/img", + "$docroot_instance_path/pki/images", + $default_dir_permissions, $default_file_permissions, + $pki_user, $pki_group); + + # Copy /usr/share/pki/<subsystem>-ui/docroot/<subsystem>/admin/console/img + # to <instance>/docroot/pki/images + return 0 if !copy_directory( + "$ui_subsystem_path/docroot/$subsystem_type/admin/console/img", + "$docroot_instance_path/pki/images", + $default_dir_permissions, $default_file_permissions, + $pki_user, $pki_group); + # fix permissions if (!is_Windows()) { # Apache Specific |