Skip to content

Commit 06cbe3f

Browse files
authored
Merge pull request galaxyproject#198 from mira-miracoli/themes
Symlinks reduce disk usage
2 parents 94ac81e + aceb4eb commit 06cbe3f

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

defaults/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,8 @@ galaxy_themes_static_keys:
512512
galaxy_themes_conf_path: files/galaxy/config/themes_conf.yml
513513
galaxy_themes_static_path: "{{ galaxy_root }}/server"
514514
galaxy_themes_static_dir: "{{ galaxy_root }}/server/static"
515+
galaxy_themes_symlinks: true
516+
galaxy_themes_symlinks_no_log: false # Hides extended logs for the symlink task in static/dist
515517
galaxy_themes_welcome_url_prefix: https://usegalaxy-eu.github.io/index-
516518
galaxy_themes_default_welcome: https://galaxyproject.org
517519
galaxy_themes_ansible_file_path: files/galaxy/static

tasks/static_subdomain_dirs.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,40 @@
55
mode: '0755'
66
owner: "{{ __galaxy_privsep_user_name }}"
77
group: "{{ __galaxy_privsep_user_group }}"
8-
path: "{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}"
8+
path: "{{ galaxy_themes_static_path }}/{{ item }}"
9+
with_items:
10+
- "static-{{ subdomain.name }}"
11+
- "static-{{ subdomain.name }}/dist"
12+
13+
- name: Register files in static/dist
14+
ansible.builtin.find:
15+
paths: "{{ galaxy_themes_static_path }}/static/dist"
16+
file_type: file
17+
when: galaxy_themes_symlinks
18+
register: dist_files
19+
20+
- name: "Symlink files static-{{ subdomain.name }}/dist to static/dist"
21+
ansible.builtin.file:
22+
src: "{{ item.path }}"
23+
dest: "{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}/dist/{{ item.path | basename }}"
24+
state: link
25+
when: galaxy_themes_symlinks
26+
no_log: "{{ galaxy_themes_symlinks_no_log }}"
27+
with_items: "{{ dist_files.files }}"
28+
29+
- name: "Symlink directory {{ item }} from static-{{ subdomain.name }}/{{ item }} to static/{{ item }}"
30+
ansible.builtin.file:
31+
src: "{{ galaxy_themes_static_path }}/static/{{ item }}"
32+
dest: "{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}/{{ item }}"
33+
state: link
34+
when: galaxy_themes_symlinks
35+
ignore_errors: true
36+
with_items:
37+
- "plugins"
38+
- "patmat"
39+
- "toolshed"
40+
- "wymeditor"
41+
- "style"
942

1043
- name: Synchronize contents from static to static-"{{ subdomain.name }}"
1144
ansible.posix.synchronize:

0 commit comments

Comments
 (0)