Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Commit

Permalink
Fix #142
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Louapre committed Apr 24, 2014
1 parent 11625c9 commit bdc8859
Showing 1 changed file with 29 additions and 15 deletions.
44 changes: 29 additions & 15 deletions deploy/lib/server_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -411,23 +411,37 @@ def bootstrap
end

def wipe
logger.info "Wiping MarkLogic setup for your project on #{@hostname}..."
setup = File.read(ServerConfig.expand_path("#{@@path}/lib/xquery/setup.xqy"))
r = execute_query %Q{#{setup} setup:do-wipe(#{get_config})}
logger.debug r.body

if r.body.match("<error:error")
logger.error r.body
logger.error "... Wipe FAILED"
return false

if @environment != "local"
print "This command will remove the application, \n"
print "include the content database and all its content, from #{@hostname}.\n"
print "\nAre you ready to proceed? [y/N]\n"
confirm = gets.chomp
else
if r.body.match("(note: restart required)")
logger.warn "************************************"
logger.warn "*** RESTART OF MARKLOGIC IS REQUIRED"
logger.warn "************************************"
confirm = 'yes'
end

if confirm.match(/^y(es)?$/i)
logger.info "Wiping MarkLogic setup for your project on #{@hostname}..."
setup = File.read(ServerConfig.expand_path("#{@@path}/lib/xquery/setup.xqy"))
r = execute_query %Q{#{setup} setup:do-wipe(#{get_config})}
logger.debug r.body

if r.body.match("<error:error")
logger.error r.body
logger.error "... Wipe FAILED"
return false
else
if r.body.match("(note: restart required)")
logger.warn "************************************"
logger.warn "*** RESTART OF MARKLOGIC IS REQUIRED"
logger.warn "************************************"
end
logger.info "... Wipe Complete"
return true
end
logger.info "... Wipe Complete"
return true
else
puts "Aborting wipe command"
end
end

Expand Down

0 comments on commit bdc8859

Please sign in to comment.