diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2012-06-26 14:22:08 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2012-06-26 14:22:08 -0300 |
commit | 1ae3d5f61324eed1922e44d6de15c587b4eaac47 (patch) | |
tree | 4b8433eda0684b6eec44fb9a03e040cadeda8163 | |
parent | 0d1dcfcfd51c53555cf736cd944ce3a3bf475b7b (diff) | |
download | puppet-wordpress-1ae3d5f61324eed1922e44d6de15c587b4eaac47.tar.gz puppet-wordpress-1ae3d5f61324eed1922e44d6de15c587b4eaac47.tar.bz2 |
Adding wp-cli support for wordpress script
-rw-r--r-- | manifests/init.pp | 8 | ||||
-rw-r--r-- | templates/wordpress.sh.erb | 14 |
2 files changed, 21 insertions, 1 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index e144c1d..d3a162b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -22,4 +22,12 @@ class wordpress { mode => 755, } + vcsrepo { "/usr/local/share/wp-cli": + ensure => present, + provider => git, + source => 'git://github.com/wp-cli/wp-cli.git', + revision => '0d8487b771afbaf1acd8c086e088f9d3601c3395', + owner => 'root', + group => 'root', + } } diff --git a/templates/wordpress.sh.erb b/templates/wordpress.sh.erb index 05ab928..9fccd26 100644 --- a/templates/wordpress.sh.erb +++ b/templates/wordpress.sh.erb @@ -126,9 +126,14 @@ function wordpress_upgrade { echo "Check procedure and remove wordpress-$old once you make sure that everything is fine." } +# Usage +function wordpress_usage { + echo "Usage: `basename $0` <deploy|upgrade> [arguments]" +} + # Main procedure if [ -z "$1" ]; then - echo "Usage: `basename $0` <deploy|upgrade> [arguments]" + wordpress_usage exit 1 elif [ "$1" == "deploy" ]; then shift @@ -136,4 +141,11 @@ elif [ "$1" == "deploy" ]; then elif [ "$1" == "upgrade" ]; then shift wordpress_upgrade $* +elif [ "$1" == "help" ]; then + wordpress_usage + /usr/local/share/wp-cli/src/bin/wp help +else + # Send all other requests to wp-cli + shift + /usr/local/share/wp-cli/src/bin/wp $* fi |