lib/shuttle/deployment/wordpress.rb in shuttle-deploy-0.2.0.beta3 vs lib/shuttle/deployment/wordpress.rb in shuttle-deploy-0.2.0.beta4
- old
+ new
@@ -17,12 +17,26 @@
super
setup_shared_dirs
check_dependencies
- cli_install if !cli_installed?
- core_install if !core_installed?
+
+ if !cli_installed?
+ cli_install
+ else
+ version = ssh.capture("cd #{core_path} && wp --version")
+ version.gsub!('wp-cli', '').strip!
+ log "WordPress CLI version: #{version}"
+ end
+
+ if !core_installed?
+ core_install
+ else
+ version = ssh.capture("cd #{core_path} && wp core version")
+ log "WordPress core version: #{version}"
+ end
+
check_config
end
def deploy
setup
@@ -85,16 +99,16 @@
res = ssh.run("cd #{core_path} && #{cmd.join(' ')}")
if res.success?
log "A new wordpress config has been generated"
else
- error "Unable to generate config"
+ error "Unable to generate config. Error: #{res.output}"
end
end
def check_config
- if !ssh.file_exists?(shared_path('wp-config.php'))
- log "Creating wordpress config at 'shared/wp-config.php'"
+ if !ssh.file_exists?(shared_path('wordpress/core/wp-config.php'))
+ log "Creating wordpress config"
generate_config
end
end
def site_installed?
\ No newline at end of file