How do I get the environment I'm 'on' in Laravel Envoy?

282 Views Asked by At

I want to use Laravel Envoy to deploy my Laravel app, but my staging server has the Laravel project in a different path to where it is on the Production server.

So I've got something like this in Envoy.blade.php

@servers(['staging' => ['[email protected]'], 'production' => ['[email protected]']])

@task('deploy', ['on' => 'staging'])

    @if ($on === 'staging')
        cd /my/staging/path
    @elseif ($on === 'production')
        cd /my/production/path
    @endif

@endtask

But $on doesn't work - it doesn't tell me what server we're on.

Is there a way to know what server I'm 'on', according to the Envoy deploy task?

0

There are 0 best solutions below