Skip to content

Commit

Permalink
Option to install WP-CLI packages (roots#837)
Browse files Browse the repository at this point in the history
  • Loading branch information
QWp6t authored and skemantix committed Sep 4, 2017
1 parent 49129f0 commit 44e65fe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### HEAD
* Option to install WP-CLI packages ([#837](https://github.com/roots/trellis/pull/837))
* Update WP-CLI to 1.2.1 ([#838](https://github.com/roots/trellis/pull/838))
* Auto-install Vagrant plugins ([#829](https://github.com/roots/trellis/pull/829))
* Add Vagrant config ([#828](https://github.com/roots/trellis/pull/828))
Expand Down
1 change: 1 addition & 0 deletions roles/wp-cli/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ wp_cli_bin_path: /usr/bin/wp
wp_cli_phar_url: "https://github.com/wp-cli/wp-cli/releases/download/v{{ wp_cli_version }}/wp-cli-{{ wp_cli_version }}.phar"
wp_cli_completion_url: "https://raw.githubusercontent.com/wp-cli/wp-cli/v{{ wp_cli_version }}/utils/wp-completion.bash"
wp_cli_completion_path: /etc/bash_completion.d/wp-completion.bash
wp_cli_packages: []
9 changes: 9 additions & 0 deletions roles/wp-cli/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,12 @@
warn: false
register: wp_cli_completion
changed_when: wp_cli_completion.stdout == 'wp-completion-' + wp_cli_version + '.bash'

- name: Install WP-CLI packages
command: wp package install {{ item }}
become_user: "{{ web_user }}"
register: wp_cli_packages_installed
changed_when:
- "'Nothing to install or update' not in wp_cli_packages_installed.stdout"
- "'Package operations: 0 installs, 0 updates, 0 removals' not in wp_cli_packages_installed.stdout"
with_items: "{{ wp_cli_packages }}"

0 comments on commit 44e65fe

Please sign in to comment.