diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-04-13 15:42:05 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-04-16 16:23:04 +0000 |
commit | 0425200cc159e6baa007f8a80f451bb670452c71 (patch) | |
tree | 85aeb0594b69323acd2b958040c268916efb79cf /strata/openstack-services/horizon.morph | |
parent | 1ec9fced3606cf71c80414093289672ef56c4b92 (diff) | |
download | definitions-0425200cc159e6baa007f8a80f451bb670452c71.tar.gz |
Add Openstack system
Add Openstack system and stratum pointing they components to
Juno tag 2014.2.1.
Change-Id: Iaa9a31c44b0a2c711c5a147dc3156bab14577fb7
Signed-off-by: Pedro Alvarez <pedro.alvarez@codethink.co.uk>
Signed-off-by: Francisco Redondo Marchena <francisco.marchena@codethink.co.uk>
Signed-off-by: Richard Maw <richard.maw@codethink.co.uk>
Signed-off-by: Richard Ipsum <richard.ipsum@codethink.co.uk>
Signed-off-by: Patrick Darley <patrick.darley@codethink.co.uk>
Signed-off-by: Zara Zaimeche <zara.zaimeche@codethink.co.uk>
Signed-off-by: Mike Smith <mike.smith@codethink.co.uk>
Diffstat (limited to 'strata/openstack-services/horizon.morph')
-rw-r--r-- | strata/openstack-services/horizon.morph | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/strata/openstack-services/horizon.morph b/strata/openstack-services/horizon.morph new file mode 100644 index 00000000..ae6399b1 --- /dev/null +++ b/strata/openstack-services/horizon.morph @@ -0,0 +1,59 @@ +name: horizon +kind: chunk +configure-commands: +# Remove unnecessary .mo files they will be generated +# later during package build. +- find . -name "django*.mo" -exec rm -f '{}' \; +# Set COMPRESS_OFFLINE=True +- | + sed -i 's:COMPRESS_OFFLINE.=.False:COMPRESS_OFFLINE = True:' \ + openstack_dashboard/settings.py +build-commands: +# Compile message strings +- cd horizon && django-admin.py compilemessages && cd .. +- cd openstack_dashboard && django-admin.py compilemessages && cd .. +- python setup.py build +post-build-commands: +# Use the local_settings.py example to compile and compress the css, js, etc files. +# This is a hack to make SECRET_KEY work. +- | + cp openstack_dashboard/local/local_settings.py.example \ + openstack_dashboard/local/local_settings.py +# Collect the static files and compress them. +- python manage.py collectstatic --noinput +- python manage.py compress --force +install-commands: +# Undo hack +- | + cp openstack_dashboard/local/local_settings.py.example \ + openstack_dashboard/local/local_settings.py +# Install horizon +- python setup.py install -O1 --skip-build --prefix "$PREFIX" --root "$DESTDIR" +post-install-commands: +# Remove unnecessary .po files +- find "$DESTDIR" -name django.po -exec rm '{}' \; +- find "$DESTDIR" -name djangojs.po -exec rm '{}' \; +# Link Openstack local_settings where openstack_dashboard is installed. +- mkdir -p "$DESTDIR"/var/lib/horizon/openstack_dashboard/local +- | + ln -sf /etc/horizon/openstack_dashboard/local_settings.py \ + "$DESTDIR$PREFIX"/lib/python2.7/site-packages/openstack_dashboard/local/local_settings.py +# Create the static directory (STATIC_ROOT) used in local_settings.py to keep +# the static objects like css files. +- mkdir -p "$DESTDIR"/var/lib/horizon/openstack_dashboard/static +# Copy the compressed static files to horizon. +- cp -a openstack_dashboard/static/* "$DESTDIR"/var/lib/horizon/openstack_dashboard/static +- cp -a horizon/static/* "$DESTDIR"/var/lib/horizon/openstack_dashboard/static +- cp -a static/* "$DESTDIR"/var/lib/horizon/openstack_dashboard/static +# Work around to make django.wsgi working with horizon +# See: https://bugs.launchpad.net/osprofiler/+bug/1361235 +# and: https://git.openstack.org/cgit/openstack/tripleo-image-elements/commit/?id=41c9a1dfad23f8aee366afb6a0b20a6c57ec8f79 +- | + sed -i "s|'../..'|os.path.realpath('../..')|" \ + "$DESTDIR$PREFIX"/lib/python2.7/site-packages/openstack_dashboard/wsgi/django.wsgi +# And link this django.wsgi file to the horizon home directory +- | + ln -sf "$PREFIX"/lib/python2.7/site-packages/openstack_dashboard/wsgi/django.wsgi \ + "$DESTDIR"/var/lib/horizon/openstack_dashboard/django.wsgi +# Create the horizon document root for apache configuration +- mkdir -p "$DESTDIR"/var/lib/horizon/.blackhole |