Sha256: cffeaee9381b8a3caf90401818f1c74dc1ee7e8860fa2e9258052856ccb5e36f

Contents?: true

Size: 1.16 KB

Versions: 12

Compression:

Stored size: 1.16 KB

Contents

namespace :cul do
  namespace :wp do

    desc "Runs a WordPress installation for a newly set up instance and creates a new admin user"
    task :install do
      unless enter_y_to_continue(color_text("This will drop any existing database for #{fetch(:stage)}."))
        puts 'Operation cancelled because "y" was not entered.'
        next
      end

      puts "Please provide administrative user credentials for this new WP instance:"
      ask(:admin_user, "Admin username:")
      ask(:admin_password, "Admin password:", echo: false)
      ask(:admin_email, "Admin email:")

      require_cap_variables!([:url, :title, :admin_user, :admin_password, :admin_email])

      on roles(:web) do
        within fetch(:wp_docroot) do

          # Drop existing database
          execute :wp, 'db', 'reset', '--yes'

          execute :wp, 'core', fetch(:multisite) ? 'multisite-install' : 'install',
            "--url='#{fetch(:url)}'",
            "--title='#{fetch(:title)}'",
            "--admin_user='#{fetch(:admin_user)}'",
            "--admin_password='#{fetch(:admin_password)}'",
            "--admin_email='#{fetch(:admin_email)}'"
        end
      end
    end

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
capistrano-cul-0.3.2 lib/capistrano/tasks/wp/install.cap
capistrano-cul-0.3.1 lib/capistrano/tasks/wp/install.cap
capistrano-cul-0.3.0 lib/capistrano/tasks/wp/install.cap
capistrano-cul-0.1.7 lib/capistrano/tasks/wp/install.cap
capistrano-cul-0.1.6 lib/capistrano/tasks/wp/install.cap
capistrano-cul-0.1.4 lib/capistrano/tasks/wp/install.cap
capistrano-cul-0.1.3 lib/capistrano/tasks/wp/install.cap
capistrano-cul-0.1.2 lib/capistrano/tasks/wp/install.cap
capistrano-cul-0.1.1 lib/capistrano/tasks/wp/install.cap
capistrano-cul-0.1.0 lib/capistrano/tasks/wp/install.cap
capistrano-cul-0.0.19 lib/capistrano/tasks/wp/install.cap
capistrano-cul-0.0.18 lib/capistrano/tasks/wp/install.cap