mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-24 09:12:51 +01:00
Added a new class ConsoleApplicationTester, which during E2E tests will create a separate isolated process for the Deployer to run in. This class exposes methods for interacting with stdin and to grab stdout, stderr and status code of finished process.
33 lines
834 B
PHP
33 lines
834 B
PHP
<?php declare(strict_types=1);
|
|
namespace Deployer;
|
|
|
|
require_once __DIR__ . '/hosts.php';
|
|
require_once __DIR__ . '/../../../recipe/laravel.php';
|
|
|
|
getHost('server.test')
|
|
->set('timeout', 600);
|
|
|
|
set('repository', 'https://github.com/deployphp/test-laravel.git');
|
|
set('branch', 'main');
|
|
|
|
task('laravel:setup-env', function(): void {
|
|
$sharedPath = "{{deploy_path}}/shared";
|
|
$envFile = "$sharedPath/.env";
|
|
|
|
$releasePath = get('release_path');
|
|
$envExampleFile = "$releasePath/.env.example";
|
|
|
|
if (!test("[ -d $sharedPath ]")) {
|
|
run("mkdir $sharedPath");
|
|
}
|
|
|
|
if (!test("[ -f $envFile ]")) {
|
|
run("cp $envExampleFile $envFile");
|
|
}
|
|
});
|
|
|
|
task('artisan:key:generate', artisan('key:generate'));
|
|
|
|
before('deploy:shared', 'laravel:setup-env');
|
|
before('artisan:storage:link', 'artisan:key:generate');
|