diff --git a/docker/horizon/Dockerfile.j2 b/docker/horizon/Dockerfile.j2 index 6bb3c59..ac82193 100644 --- a/docker/horizon/Dockerfile.j2 +++ b/docker/horizon/Dockerfile.j2 @@ -11,6 +11,7 @@ RUN apt-get update \ {{ copy_sources("openstack/sahara-dashboard", "/sahara-dashboard") }} {{ copy_sources("openstack/murano-dashboard", "/murano-dashboard") }} {{ copy_sources("openstack/searchlight-ui", "/searchlight-ui") }} +{{ copy_sources("mirantis-theme", "/theme") }} RUN mkdir -p /etc/openstack-dashboard /home/horizon /var/www/cgi-bin/horizon /var/lib/microservices/venv/lib/python2.7/site-packages/openstack_dashboard/local/local_settings.d \ /var/lib/microservices/venv/lib/python2.7/site-packages/openstack_dashboard/conf \ @@ -29,13 +30,12 @@ RUN mkdir -p /etc/openstack-dashboard /home/horizon /var/www/cgi-bin/horizon /va cp -a /searchlight-ui/searchlight_ui/conf/searchlight_policy.json /var/lib/microservices/venv/lib/python2.7/site-packages/openstack_dashboard/conf/; fi) \ && (if [ -f /searchlight-ui/searchlight_ui/local_settings.d/_1001_search_settings.py ]; then \ cp -a /searchlight-ui/searchlight_ui/local_settings.d/_1001_search_settings.py /var/lib/microservices/venv/lib/python2.7/site-packages/openstack_dashboard/local/local_settings.d/; fi) \ + && cp -r /theme/themes/vendor/ /horizon/openstack_dashboard/themes/ \ && /var/lib/microservices/venv/bin/pip install --upgrade /horizon /sahara-dashboard /murano-dashboard /searchlight-ui \ && useradd --user-group horizon \ && ln -s /etc/openstack-dashboard/local_settings /var/lib/microservices/venv/lib/python2.7/site-packages/openstack_dashboard/local/local_settings.py \ && cp -r /horizon/openstack_dashboard/conf/* /etc/openstack-dashboard/ \ - && cp /horizon/manage.py /var/lib/microservices/venv/bin/manage.py \ - && /var/lib/microservices/venv/bin/python /var/lib/microservices/venv/bin/manage.py collectstatic --noinput --clear \ - && chown -R horizon: /etc/openstack-dashboard /home/horizon /var/lib/microservices/venv/lib/python2.7/site-packages/static /horizon + && cp /horizon/manage.py /var/lib/microservices/venv/bin/manage.py ENV PATH /var/lib/venv/bin:$PATH diff --git a/service/files/defaults.yaml b/service/files/defaults.yaml index e671149..d145ab9 100644 --- a/service/files/defaults.yaml +++ b/service/files/defaults.yaml @@ -10,6 +10,8 @@ configs: processes: 6 threads: 15 + theme: mirantis + sources: openstack/horizon: git_url: https://git.openstack.org/openstack/horizon.git @@ -23,3 +25,6 @@ sources: openstack/searchlight-ui: git_url: https://git.openstack.org/openstack/searchlight-ui.git git_ref: stable/newton + mirantis-theme: + git_url: https://review.fuel-infra.org/openstack/horizon-vendor-theme + git_ref: 9.0/mitaka diff --git a/service/files/local_settings.j2 b/service/files/local_settings.j2 index 4502871..a47c999 100644 --- a/service/files/local_settings.j2 +++ b/service/files/local_settings.j2 @@ -437,7 +437,9 @@ TIME_ZONE = "UTC" # ('default', 'Default', 'themes/default'), # ('material', 'Material', 'themes/material'), #] - +AVAILABLE_THEMES = [('default', 'Default', 'themes/default'), + ('mirantis', 'Mirantis', 'themes/vendor')] +DEFAULT_THEME = "{{ horizon.theme }}" LOGGING = { 'version': 1, # When set to True this will disable all logging except diff --git a/service/horizon.yaml b/service/horizon.yaml index e48a609..81179b5 100644 --- a/service/horizon.yaml +++ b/service/horizon.yaml @@ -19,6 +19,8 @@ service: pre: - name: chown-logs-dir command: "sudo /bin/chown horizon:horizon /var/log/ccp/horizon" + - name: horizon-collectstatic + command: /var/lib/microservices/venv/bin/python /var/lib/microservices/venv/bin/manage.py collectstatic --noinput --clear - name: horizon-compress # Just for Mitaka compatibility command: /var/lib/microservices/venv/bin/python /var/lib/microservices/venv/bin/manage.py compress daemon: