2014年11月25日星期二

Rob Allen: Using Phing to SSH into a Vagrant box


In a quick new post to his site Rob Allen shows you how to have Phing SSH into a Vagrant box as a part of the VM creation process. In his case, he uses it to run database migrations.



Now that I've started using migrations, I've discovered a minor irritant. I run this project on a Vagrant VM and have discovered that I keep forgetting to ssh into the vagrant box before running the migrations script. The obvious solution is to automate this and I decided to use Phing to do so.


He walks through the installation of the libssh2 software (if you don't already have it) and the ssh2 PHP extensionSshTask to make the connection as the "vagrant" user and execute the given PHP command.


Link: http://akrabat.com/php/using-phing-to-ssh-into-a-vagrant-box/

没有评论:

发表评论