laravel/envoy — pull request #43 by bexarcreative-daniel (2014-05-08 17:40:28+00:00)
Title: Added ability to run scripts locally without SSH.

@taylorotwell This is a first pass at getting this working. I'm sure you could come up with a more elegant way of doing it. The main idea is that I'd like to use Envoy to handle a deploy process and the first step is to run some commands locally before running the deploy commands remotely. We don't want to have Node dependencies or the build process on remote servers so we need to run all those processes on the local machine prior to deploy (which is essentially an rsync operation). This patch just bypasses the SSH process when the `$target` is a localhost hostname.

Below is an example `Envoy.blade.php` that will run tasks and macros using this patch. An example run would be something like `envoy run installer`.

```php
@servers([ 'vagrant' => '127.0.0.1' ])

@task('init')
git commit -am 'Initial commit.'
git push origin master
@endtask

@task('install')
composer install --no-dev
npm install
bower install
@endtask

@task('update')
composer update --no-dev
npm update
bower update
@endtask

@task('keygen')
php artisan key:generate
@endtask

@task('migrate')
php artisan migrate --package="foo/bar"
php artisan migrate
@endtask

@task('seed')
php artisan db:seed
@endtask

@task('build')
php artisan build
@endtask

@macro('setup')
install
keygen
migrate
seed
build
init
@endmacro

@macro('installer')
install
migrate
build
@endmacro

@macro('updater')
update
migrate
build
@endmacro

@macro('migrator')
migrate
@endmacro

@macro('seeder')
seed
@endmacro

@macro('builder')
build
@endmacro
```