Skip to content

Instantly share code, notes, and snippets.

View dantiel's full-sized avatar

dantiel

View GitHub Profile
@stravid
stravid / task.thor
Created November 13, 2012 12:18
Thor FTP deploy task
desc "deploy", "deploys the site via LFTP to the location specified in the environment"
def deploy
load_ftp_configuration
start_timestamp = Time.now.to_i
if system("lftp -e 'mirror -R -v #{ENV['PUBLIC_DIRECTORY']} #{ENV['FTP_TARGET_DIRECTORY']}; bye' -u #{ENV['FTP_USER']},#{ENV['FTP_PASSWORD']} #{ENV['FTP_SERVER']}")
puts "Deploy finished. (Duration: #{Time.now.to_i - start_timestamp} seconds)"
else
puts 'Deploy aborted, something went wrong.'