deployer/tests/e2e/recipe/laravel-boilerplate.php
Sacharski Bartłomiej 165ffa119a
Implemented ConsoleApplicationTester for isolated E2E tests (#2513)
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.
2021-04-17 23:11:26 +03:00

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');