Vlado Cingel / vlado@cingel.hr
Most Rails applications are deployed in a Unix server environment. Tools like Capistrano make this dead easy. For those working in a Windows environment, deployment can get considerably harder. The good news is that it’s still possible and just got a lot easier.
Brian Hogan has developed a series of articles with instructions for various methods of deploying Rails applications in a Windows server environment.
http://napcs.com/howto/rails/deploy
+
Point www.hidroing-os.hr to it
+
wget http://example.com \
--domains example.com \
--recursive \
--page-requisites \
--no-clobber \
--html-extension \
--convert-links
class NewReleaseWorker
def perform
require 'ftp_sync'
domain = ENV['HIDROING_DOMAIN_NAME']
login = ENV['HIDROING_FTP_LOGIN']
password = ENV['HIDROING_FTP_PASSWORD']
wget_domains = ENV['WGET_DOMAINS']
wget_host = ENV['WGET_HOST']
timestamp = Time.now.strftime("%Y%m%d%H%M%S")
local_root = "#{Rails.root}/tmp/site/#{timestamp}"
msg "Downloading site to #{local_root}"
FileUtils.mkdir_p(local_root)
run("wget --domains #{wget_domains} --recursive --no-parent --html-extension --convert-links --restrict-file-names=windows #{wget_host}/index -P #{local_root}")
release_dir_name = Dir.entries(local_root).select { |e| !e.start_with?(".") }.first
ftp = FtpSync.new(domain, login, password, passive: true)
ftp.push_dir "#{local_root}/#{release_dir_name}", "hidroing-os.hr/wwwroot/cingel"
end
private
def msg(text)
puts "[NewReleaseWorker] #{text}"
end
def run(command)
msg "Running #{command}"
system command
end
end