Capistrano deploy within Vagrant on Windows 7

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Capistrano deploy within Vagrant on Windows 7

Andres Clari
I've recently had an issue where I was not able to deploy via capistrano within Vagrant on Windows 7,
and I found the right configuration to get it working, so I figured I share, so future people looking for this
can find it.

In case of doubt, this solution works using Bash GIT standard, on Windows 7 64 -bit. with a precise64 VM.

Basically, you need to disable SSH forwarding on your Vagrantfile, just manually copy your .ssh folder
or individual keys to the /home/vagrant folder on the VM.

And get your ssh-agent going:

Edit .bashrc, and add this script to autostart and import your keys when you login.

---

SSH_ENV="${HOME}/.ssh/environment"
SSHAGENT=/usr/bin/ssh-agent
SSHAGENTARGS="-s"

function start_agent {
     echo "Initialising new SSH agent…"
     ${SSHAGENT} | sed 's/^echo/#echo/' > "${SSH_ENV}"
     echo succeeded
     chmod 600 "${SSH_ENV}"
     . "${SSH_ENV}" > /dev/null
     ssh-add
}

# Source SSH settings, if applicable
if [ -f "${SSH_ENV}" ]; then
     . "${SSH_ENV}" > /dev/null
     ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
         start_agent;
     }
else
     start_agent;
fi

--

That should solve the issue.

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.