From 8329ddc2788e82c23f4e473f4e848d97eab4d46b Mon Sep 17 00:00:00 2001 From: Christopher Aedo Date: Wed, 25 Nov 2015 15:21:02 -0800 Subject: [PATCH] Update app-catalog commands This commit updates the App Catalog manifest to execute the proper commands for generating static and compressed content such that the content will appear in the install directory as and when expected. Change-Id: I130878728ce3a1ae06e9823fcd3db1aa1fa5285d --- manifests/init.pp | 26 +++++++++++++------------- templates/local_settings.erb | 3 +++ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 1ad8827..943b54e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -101,34 +101,34 @@ class apps_site ( } exec { 'install-app_catalog' : - command => "/usr/local/bin/pip install ${root_dir}", + command => "/usr/local/bin/pip install --upgrade ${root_dir}", cwd => $root_dir, refreshonly => true, subscribe => Vcsrepo[$root_dir], - require => File["${install_dir}/local_settings.py"], notify => Service['httpd'], } file { "${install_dir}/local_settings.py": ensure => present, mode => '0644', + require => Exec['install-app_catalog'], content => template('apps_site/local_settings.erb'), - require => Vcsrepo[$root_dir], } - file { "${install_dir}/web/static/CACHE": - ensure => directory, - owner => 'www-data', - group => 'www-data', - mode => '0755', - require => Vcsrepo[$root_dir], + file { "${install_dir}/manage.py": + ensure => present, + source => "${root_dir}/manage.py", + require => Exec['install-app_catalog'], } exec { 'collect-static' : - command => "/usr/bin/python ${root_dir}/manage.py collectstatic --noinput", - refreshonly => true, - subscribe => Vcsrepo[$root_dir], - require => File["${install_dir}/web/static/CACHE"], + command => "/usr/bin/python ${install_dir}/manage.py collectstatic --noinput", + subscribe => File["${install_dir}/manage.py"], + } + + exec { 'python-compress' : + command => "/usr/bin/python ${install_dir}/manage.py compress --force", + subscribe => File["${install_dir}/manage.py"], } exec { 'make_assets_json' : diff --git a/templates/local_settings.erb b/templates/local_settings.erb index c2d7ee8..4f99304 100644 --- a/templates/local_settings.erb +++ b/templates/local_settings.erb @@ -1,3 +1,6 @@ ASSETS_FILE = '<%= @root_dir %>/openstack_catalog/web/api/v1/assets' STATIC_ROOT = '<%= @install_dir %>/web/static' +ALLOWED_HOSTS = ['*'] +DEBUG = False COMPRESS_ENABLED = True +COMPRESS_OFFLINE = True