summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--files/wordpress.sh6
-rw-r--r--manifests/init.pp12
2 files changed, 13 insertions, 5 deletions
diff --git a/files/wordpress.sh b/files/wordpress.sh
index 055f204..3497a93 100644
--- a/files/wordpress.sh
+++ b/files/wordpress.sh
@@ -5,7 +5,7 @@
BASE="/var/www/data"
LOCALE="-pt_BR"
-WP_CLI="/usr/local/bin/wp-cli"
+WP_CLI="/usr/local/bin/wp"
BASENAME="`basename $0`"
WHOAMI="`whoami`"
@@ -55,7 +55,7 @@ function wordpress_deploy {
# Upgrade a wordpress instance using upstream source.
function wordpress_upgrade {
if [ -z "2" ]; then
- echo "Usage: `basename $0` upgrade <old_version> <new_version> [folder]"
+ echo "Usage: `basename $0` upgrade <old_version> <new_version> [base-folder]"
exit 1
fi
@@ -139,7 +139,7 @@ function wordpress_upgrade {
function wordpress_usage {
echo "Installation management commands:"
echo " $BASENAME deploy <version>"
- echo " $BASENAME upgrade <old-version> <new-version>"
+ echo " $BASENAME upgrade <old-version> <new-version> [base-folder]"
echo ""
echo -n "Wordpress CLI "
$WP_CLI help
diff --git a/manifests/init.pp b/manifests/init.pp
index 4bc2a34..93befc8 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -1,6 +1,8 @@
class wordpress {
$wp_cli = 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar'
+ include php::composer
+
file { "/usr/local/bin/wordpress":
ensure => present,
source => "puppet:///modules/wordpress/wordpress.sh",
@@ -9,11 +11,17 @@ class wordpress {
mode => 755,
}
- # Composer
+ # Wordpress command line
exec { 'getwp':
- command => "/usr/bin/wget ${wp_cli} -O /usr/local/bin/wp-cli && chmod +x /usr/local/bin/wp-cli",
+ command => "/usr/bin/wget ${wp_cli} -O /usr/local/bin/wp && chmod +x /usr/local/bin/wp",
user => 'root',
cwd => '/tmp',
creates => '/usr/local/bin/wp-cli',
+ require => Exec['getcomposer'],
+ }
+
+ # Old location
+ file { '/usr/local/bin/wp-cli':
+ ensure => absent,
}
}