Module: Shuttle::WordpressCore
- Included in:
- Wordpress
- Defined in:
- lib/shuttle/deployment/wordpress/core.rb
Instance Method Summary collapse
-
#core_install(overwrite = true) ⇒ Boolean
Install wordpress shared core.
-
#core_installed? ⇒ Boolean
Check if wordpress core is installed.
-
#core_path ⇒ String
Get wordpress shared core path.
-
#core_remove ⇒ Boolean
Remove wordpress shared core.
Instance Method Details
#core_install(overwrite = true) ⇒ Boolean
Install wordpress shared core
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/shuttle/deployment/wordpress/core.rb', line 19 def core_install(overwrite=true) if core_installed? && overwrite == true core_remove end log "Installing WordPress core" unless ssh.directory_exists?(core_path) ssh.run("mkdir -p #{core_path}") end cmd = "cd #{core_path} && wp core download" if config.wordpress.core cmd << " --version=#{config.wordpress.core}" end result = ssh.run(cmd) if result.success? log "WordPress core installed" else error "Unable to install WordPress core: #{result.output}" end end |
#core_installed? ⇒ Boolean
Check if wordpress core is installed
11 12 13 14 |
# File 'lib/shuttle/deployment/wordpress/core.rb', line 11 def core_installed? ssh.directory_exists?(core_path) && !ssh.capture("ls #{core_path}").empty? end |
#core_path ⇒ String
Get wordpress shared core path
5 6 7 |
# File 'lib/shuttle/deployment/wordpress/core.rb', line 5 def core_path @core_path ||= shared_path('wordpress/core') end |
#core_remove ⇒ Boolean
Remove wordpress shared core
47 48 49 50 51 52 53 54 |
# File 'lib/shuttle/deployment/wordpress/core.rb', line 47 def core_remove if ssh.directory_exists?(core_path) log "Removing WordPress shared core" ssh.run("rm -rf #{core_path}") end ssh.directory_exists?(core_path) end |