dshoreman / servidor

A modern web application for managing servers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Step Detection

dshoreman opened this issue · comments

We need a way of setting the actions that are expected to happen, so that when someone clicks the "Laravel" template, the progress modal will know, "okay this'll create an app, clone, composer install, enable the project and reload nginx" all before the process has started.

We could hack the data into templates.json, but then we'd have to keep it in sync with the backend. A better solution would be setting an actions var/method on the template classes, e.g. on a Laravel project...

class Laravel extends Php
{
    protected $actions = [
        new GitCloneAction(...), // app.clone
        new ComposerInstallAction(...) // app.install
        new NginxReloadAction(), // nginx.reload
    ];
}

The problem there is when the project is created, the backend has no idea what app or redirect will be attached. We'd need to return the actions list with the created app or redirect, but that still beats adding in sequence.

ezoic increase your site revenue