Skip to content

Commit

Permalink
Merge pull request #216 from galaxyproject/subdomain-static
Browse files Browse the repository at this point in the history
Set static source dir for subdomains based on server dir
  • Loading branch information
natefoo authored Aug 16, 2024
2 parents 08974b1 + b75919c commit 793ce1c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -303,42 +303,42 @@ galaxy_app_config_default:
static_enabled: "{{ galaxy_manage_subdomain_static }}"
static_dir_by_host: >
{ {% if galaxy_manage_subdomain_static %}
'{{ galaxy_themes_instance_domain }}': '{{ galaxy_themes_static_path }}/static/',
'{{ galaxy_themes_instance_domain }}': '{{ galaxy_static_dir }}/',
{% for subdomain in galaxy_themes_subdomains %}
'{{ subdomain.name }}.{{ galaxy_themes_instance_domain}}': '{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}/',
{% endfor %}
{% endif %} }
static_images_dir_by_host: >
{ {% if galaxy_manage_subdomain_static %}
'{{ galaxy_themes_instance_domain }}': '{{ galaxy_themes_static_path }}/static/images',
'{{ galaxy_themes_instance_domain }}': '{{ galaxy_static_dir }}/images',
{% for subdomain in galaxy_themes_subdomains %}
'{{ subdomain.name }}.{{ galaxy_themes_instance_domain}}': '{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}/images',
{% endfor %}
{% endif %} }
static_welcome_html_by_host: >
{ {% if galaxy_manage_subdomain_static %}
'{{ galaxy_themes_instance_domain }}': '{{ galaxy_themes_static_path }}/static/welcome.html',
'{{ galaxy_themes_instance_domain }}': '{{ galaxy_static_dir }}/welcome.html',
{% for subdomain in galaxy_themes_subdomains %}
'{{ subdomain.name }}.{{ galaxy_themes_instance_domain}}': '{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}/welcome.html',
{% endfor %}
{% endif %} }
static_scripts_dir_by_host: >
{ {% if galaxy_manage_subdomain_static %}
'{{ galaxy_themes_instance_domain }}': '{{ galaxy_themes_static_path }}/static/scripts',
'{{ galaxy_themes_instance_domain }}': '{{ galaxy_static_dir }}/scripts',
{% for subdomain in galaxy_themes_subdomains %}
'{{ subdomain.name }}.{{ galaxy_themes_instance_domain}}': '{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}/scripts',
{% endfor %}
{% endif %} }
static_favicon_dir_by_host: >
{ {% if galaxy_manage_subdomain_static %}
'{{ galaxy_themes_instance_domain }}': '{{ galaxy_themes_static_path }}/static',
'{{ galaxy_themes_instance_domain }}': '{{ galaxy_static_dir }}',
{% for subdomain in galaxy_themes_subdomains %}
'{{ subdomain.name }}.{{ galaxy_themes_instance_domain}}': '{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}',
{% endfor %}
{% endif %} }
static_robots_txt_by_host: >
{ {% if galaxy_manage_subdomain_static %}
'{{ galaxy_themes_instance_domain }}': '{{ galaxy_themes_static_path }}/static',
'{{ galaxy_themes_instance_domain }}': '{{ galaxy_static_dir }}',
{% for subdomain in galaxy_themes_subdomains %}
'{{ subdomain.name }}.{{ galaxy_themes_instance_domain}}': '{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}',
{% endfor %}
Expand Down Expand Up @@ -499,7 +499,7 @@ galaxy_systemd_env: []
galaxy_additional_venv_packages: []

# galaxy themes variables
galaxy_themes_subdomains: {}
galaxy_themes_subdomains: []
# - name: assembly
# tool_sections:
# - "hicexplorer"
Expand Down
6 changes: 3 additions & 3 deletions tasks/static_subdomain_dirs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

- name: Register files in static/dist
ansible.builtin.find:
paths: "{{ galaxy_themes_static_path }}/static/dist"
paths: "{{ galaxy_static_dir }}/dist"
file_type: file
when: galaxy_themes_symlinks
register: dist_files
Expand All @@ -28,7 +28,7 @@

- name: "Symlink directory {{ item }} from static-{{ subdomain.name }}/{{ item }} to static/{{ item }}"
ansible.builtin.file:
src: "{{ galaxy_themes_static_path }}/static/{{ item }}"
src: "{{ galaxy_static_dir }}/{{ item }}"
dest: "{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}/{{ item }}"
state: link
when: galaxy_themes_symlinks
Expand All @@ -42,7 +42,7 @@

- name: Synchronize contents from static to static-"{{ subdomain.name }}"
ansible.posix.synchronize:
src: "{{ galaxy_themes_static_path }}/static/"
src: "{{ galaxy_static_dir }}/"
dest: "{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}"
rsync_opts: "{{ ['--ignore-existing'] if __galaxy_client_build_version ==
__galaxy_current_commit_id else omit }}"
Expand Down

0 comments on commit 793ce1c

Please sign in to comment.