Skip to content

Commit

Permalink
Merge pull request #1378 from hemangajmera/patch-3
Browse files Browse the repository at this point in the history
Add variables for web and uploads paths
  • Loading branch information
swalkinshaw authored Jun 6, 2022
2 parents e42880d + 1abd657 commit 31fdfa3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion roles/deploy/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ project_templates:
# mode: '0755' // <- optional, use an octal number starting with 0 or quote it, defaults to `'0755'` if `directory` or `'0644'` if `file`
# type: directory // <- optional, defaults to `directory`, options: `directory` or `file`
project_shared_children:
- path: web/app/uploads
- path: "{{ project_public_path }}/{{ project_upload_path }}"
src: uploads

# The project_environment is a list of environment variables that can be used in hooks
Expand All @@ -58,6 +58,8 @@ composer_classmap_authoritative: true
project: "{{ wordpress_sites[site] }}"
project_root: "{{ www_root }}/{{ site }}"
project_local_path: "{{ (lookup('env', 'USER') == 'vagrant') | ternary(project_root + '/' + project_current_path, project.local_path) }}"
project_public_path: "{{ project.public_path | default('web') }}"
project_upload_path: "{{ project.upload_path | default('app/uploads') }}"


# Deploy hooks
Expand Down
2 changes: 1 addition & 1 deletion roles/wordpress-install/tasks/directories.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Create web root of sites
file:
path: "{{ www_root }}/{{ item.key }}/{{ item.value.current_path | default('current') }}/web"
path: "{{ www_root }}/{{ item.key }}/{{ item.value.current_path | default('current') }}/{{ item.value.public_path | default('web') }}"
owner: "{{ web_user }}"
group: "{{ web_group }}"
mode: '0755'
Expand Down
2 changes: 1 addition & 1 deletion roles/wordpress-setup/templates/wordpress-site.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ server {
{% endblock %}

{% block server_basic -%}
root {{ www_root }}/{{ item.key }}/{{ item.value.current_path | default('current') }}/web;
root {{ www_root }}/{{ item.key }}/{{ item.value.current_path | default('current') }}/{{ item.value.public_path | default('web') }};
index index.php index.htm index.html;
add_header Fastcgi-Cache $upstream_cache_status;

Expand Down

0 comments on commit 31fdfa3

Please sign in to comment.