Skip to content

Commit

Permalink
Merge pull request #720 from roots/deploy-hook-improve-updating-theme…
Browse files Browse the repository at this point in the history
…-paths

Fix #718 - change method of updating theme paths
  • Loading branch information
swalkinshaw authored Dec 29, 2016
2 parents 7f77ecf + 632bbe8 commit 95766ed
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### HEAD
* Fix #718 - improve method of updating theme paths ([#720](https://github.com/roots/trellis/pull/720))
* Create `/home/vagrant/trellis` bindfs mount with proper permissions ([#705](https://github.com/roots/trellis/pull/705))

### 0.9.9: December 14th, 2016
Expand Down
16 changes: 14 additions & 2 deletions roles/deploy/hooks/finalize-after.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,24 @@
chdir: "{{ deploy_helper.current_path }}"
when: wp_installed | success and project.multisite.enabled | default(false)

- name: Update WP theme paths
command: wp eval 'wp_clean_themes_cache(); switch_theme(get_stylesheet());'
- name: Get WP theme template root
command: wp option get template_root
args:
chdir: "{{ deploy_helper.current_path }}"
register: wp_template_root
changed_when: false
failed_when: wp_template_root.stderr != ""
when: wp_installed | success

- name: Update WP theme paths
command: wp option set {{ item }} {{ deploy_helper.new_release_path }}/web/wp/wp-content/themes
args:
chdir: "{{ deploy_helper.current_path }}"
when: wp_installed | success and wp_template_root != '/themes' and wp_template_root != ''
with_items:
- stylesheet_root
- template_root

- name: Reload php-fpm
shell: sudo service php7.1-fpm reload
args:
Expand Down

0 comments on commit 95766ed

Please sign in to comment.