Last active
March 1, 2018 21:45
-
-
Save dfang/4334056 to your computer and use it in GitHub Desktop.
very very very basic guide for deploy rails application to local application
This file contains hidden or 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
# assumptions: virtualbox, vagrant already installed | |
# and there is a box lucid32 | |
1. rails new appdmeo , gem capistrano , then bundle | |
2. vagrant init lucid32 | |
3. capify . | |
# !important | |
# vagrant ssh-config >> ~/.ssh/config | |
# vagrant ssh-config | grep IdentityFile | awk '{print $2}' that's where private key located | |
# then change the file's(~/.ssh/config) first line "host localhost" to "host vagrant" | |
# then modify deploy.rb: | |
set :application, "capdemo" | |
set :scm, :none | |
set :repository, "." | |
set :local_repository, "." | |
server 'vagrant', :web, :app, :db | |
set :user, "vagrant" | |
set :use_sudo, false | |
set :deploy_to, "/home/#{user}/apps" | |
set :deploy_via, :copy | |
set :copy_exclude, "log/*" | |
4. cap deploy:setup | |
5. ssh to your vagrant box , you'll find the deployed app location in /home/vagrant/apps | |
ssh vagrant or vagrant ssh , both are ok now , because in ~/.ssh/confg there is a config file we copyed from vagrant ssh-config | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://stackoverflow.com/questions/10353530
https://coderwall.com/p/hfuimq
https://makandracards.com/makandra/1180-speed-up-capistrano-deployments-using-a-remote-cached-copy-of-repository
http://jpsilvashy.com/posts/deploying-a-rails-application-on-amazon-ec2/
https://help.github.com/articles/using-ssh-agent-forwarding
http://www.unixwiz.net/techtips/ssh-agent-forwarding.html
https://help.github.com/articles/deploying-with-capistrano