Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

fwartner's avatar

Trouble while getting an envoy (laravel/envoy) task running

Hey everyone..

I´m working on an app right now that installs a git repo automatically on a predefined host (with vhost and db)..

For some reason, my task (pushed into a queue) wont work. In the job that executes the task is basically doing something like this:

public $instance;

    /**
     * Create a new job instance.
     *
     * @param Instance $instance
     */
    public function __construct(Instance $instance)
    {
        $this->instance = $instance;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        $path = $this->instance->appname;


        $instance = new Process(app_path().'envoy run deploy --appname="'. $path .'"');
        $instance->start();

        echo $instance->getOutput();
    }

And my Envoy.blade.php looks like this:

@servers(['host' => 'user@host'])

@setup
    if ( ! isset($appname) ) {
        throw new Exception('App Name is not set');
    }
@endsetup

@task('deploy')
    cd apps/{{ $appname }}/public/
    rm index.php
    git clone https://github.com/USERNAME/REPO.git .
    rm -rf .git
@endtask

Any suggestions? The server for the app is provisioned by forge and the worker is running on beanstalkd.

0 likes
2 replies
okaufmann's avatar

Hi Florian,

Whats not working exactly? Any logs/outputs?

Gruss

fwartner's avatar

Nothing was working. I´m running a simple ssh2 connection now.

Works fine! :)

Please or to participate in this conversation.