Forked from dfang/capistrano deploy to local vagrant
Last active
August 29, 2015 14:22
-
-
Save augmen/9a001fd5358782902942 to your computer and use it in GitHub Desktop.
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