lib/ash/wordpress.rb in capistrano-ash-0.0.16 vs lib/ash/wordpress.rb in capistrano-ash-0.0.17
- old
+ new
@@ -4,10 +4,15 @@
configuration = Capistrano::Configuration.respond_to?(:instance) ?
Capistrano::Configuration.instance(:must_exist) :
Capistrano.configuration(:must_exist)
configuration.load do
+
+# --------------------------------------------
+# Setting defaults
+# --------------------------------------------
+set :uploads_dir, "wp-content/uploads"
# --------------------------------------------
# Calling our Methods
# --------------------------------------------
after "deploy:setup", "deploy:setup_shared"
@@ -34,11 +39,11 @@
end
desc "[internal] Touches up the released code. This is called by update_code after the basic deploy finishes."
task :finalize_update, :except => { :no_release => true } do
# remove shared directories
- run "rm -Rf #{latest_release}/uploads"
+ run "rm -Rf #{latest_release}/#{uploads_dir}"
run "rm -Rf #{latest_release}/wp-content/cache"
# Removing cruft files.
run "rm -Rf #{latest_release}/license.txt"
run "rm -Rf #{latest_release}/readme.html"
end
@@ -48,12 +53,12 @@
# Wordpress-specific methods
# --------------------------------------------
namespace :wordpress do
desc "Links the correct settings file"
task :symlink do
- run "ln -nfs #{shared_path}/uploads #{current_release}/uploads"
+ run "ln -nfs #{shared_path}/uploads #{current_release}/#{uploads_dir}"
run "ln -nfs #{shared_path}/cache #{current_release}/wp-content/cache"
- run "ln -nfs #{latest_release}/wp-config.php #{latest_release}/wp-config.php.#{stage}"
+ run "ln -nfs #{latest_release}/wp-config.php.#{stage} #{latest_release}/wp-config.php"
end
desc "Set URL in database"
task :updatedb do
run "mysql -u #{dbuser} -p #{dbpass} #{dbname} -e 'UPDATE #{dbprefix}options SET option_value = \"#{application}\" WHERE option_name = \"siteurl\" OR option_name = \"home\"'"
\ No newline at end of file