A simple rake file for deploying sinatra app.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### change APP_NAME and REPO ### | |
### Also replace example.com with your domain, it requires DNS setup, atleast a local entry in ssh-config or hosts file | |
require 'rake/remote_task' | |
set :domain, 'example.com' | |
set :app_name, 'APP_NAME' | |
set :repo, 'ssh://REPO' | |
namespace :deploy do | |
desc "Server setup" | |
remote_task :setup do | |
puts "setting up the server for deployment......" | |
run "mkdir #{app_name} && cd #{app_name} && git init && git remote add origin #{repo}" | |
puts ".....setup completed successfully." | |
end | |
desc "deploy to server" | |
remote_task :server do | |
puts "deploying to the server......." | |
run "cd #{app_name} && git pull origin master" | |
puts ".....deployed successfully." | |
end | |
end | |
desc "Deploy to the server" | |
task :deploy => ["deploy:server"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment