Skip to content
This repository has been archived by the owner on Feb 15, 2021. It is now read-only.

Commit

Permalink
Adding QAs + Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dbpolito committed Mar 19, 2019
1 parent 2d875bd commit c751055
Show file tree
Hide file tree
Showing 30 changed files with 539 additions and 93 deletions.
3 changes: 2 additions & 1 deletion .fwd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ FWD_IMAGE_APP="fireworkweb/app:7.2-alpine"
FWD_IMAGE_NODE="fireworkweb/node:alpine"
FWD_IMAGE_CACHE="redis:alpine"
FWD_IMAGE_DATABASE="mysql:5.7"
FWD_IMAGE_QA="jakzal/phpqa:alpine"
FWD_IMAGE_NODE_QA="fireworkweb/node:qa"
FWD_IMAGE_PHP_QA="jakzal/phpqa:alpine"

# Database
DB_DATABASE="docker"
Expand Down
8 changes: 4 additions & 4 deletions app/Commands/Artisan.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
namespace App\Commands;

use App\Commands\Traits\HasDynamicArgs;
use App\Commands\Traits\Process;
use App\Process;
use LaravelZero\Framework\Commands\Command;

class Artisan extends Command
{
use HasDynamicArgs, Process;
use HasDynamicArgs;

/**
* The name of the command.
Expand All @@ -29,8 +29,8 @@ class Artisan extends Command
*
* @return mixed
*/
public function handle()
public function handle(Process $process)
{
$this->dockerCompose('exec app php artisan', $this->getArgs());
$process->dockerCompose('exec app php artisan', $this->getArgs());
}
}
46 changes: 46 additions & 0 deletions app/Commands/Buddy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

namespace App\Commands;

use App\Commands\Traits\HasDynamicArgs;
use App\Process;
use LaravelZero\Framework\Commands\Command;

class Buddy extends Command
{
use HasDynamicArgs;

/**
* The name of the command.
*
* @var string
*/
protected $name = 'buddy';

/**
* The description of the command.
*
* @var string
*/
protected $description = 'Run buddy in the NODE-QA container.';

/**
* Execute the console command.
*
* @return mixed
*/
public function handle(Process $process)
{
$process->dockerRun(env('FWD_IMAGE_NODE_QA'), 'buddy', $this->getArgs());
}

/**
* Get default args when empty.
*
* @return string
*/
public function getDefaultArgs(): string
{
return 'src/';
}
}
8 changes: 4 additions & 4 deletions app/Commands/Composer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace App\Commands;

use App\Commands\Traits\Process;
use App\Commands\Traits\HasDynamicArgs;
use App\Process;
use LaravelZero\Framework\Commands\Command;

class Composer extends Command
{
use HasDynamicArgs, Process;
use HasDynamicArgs;

/**
* The name of the command.
Expand All @@ -29,8 +29,8 @@ class Composer extends Command
*
* @return mixed
*/
public function handle()
public function handle(Process $process)
{
$this->dockerCompose('exec app composer', $this->getArgs());
$process->dockerCompose('exec app composer', $this->getArgs());
}
}
8 changes: 4 additions & 4 deletions app/Commands/DockerCompose.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
namespace App\Commands;

use App\Commands\Traits\HasDynamicArgs;
use App\Commands\Traits\Process;
use App\Process;
use LaravelZero\Framework\Commands\Command;

class DockerCompose extends Command
{
use HasDynamicArgs, Process;
use HasDynamicArgs;

/**
* The name of the command.
Expand All @@ -29,9 +29,9 @@ class DockerCompose extends Command
*
* @return mixed
*/
public function handle()
public function handle(Process $process)
{
$this->dockerCompose($this->getArgs());
$process->dockerCompose($this->getArgs());
}

/**
Expand Down
8 changes: 4 additions & 4 deletions app/Commands/Down.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
namespace App\Commands;

use App\Commands\Traits\HasDynamicArgs;
use App\Commands\Traits\Process;
use App\Process;
use LaravelZero\Framework\Commands\Command;

class Down extends Command
{
use HasDynamicArgs, Process;
use HasDynamicArgs;

/**
* The name of the command.
Expand All @@ -29,8 +29,8 @@ class Down extends Command
*
* @return mixed
*/
public function handle()
public function handle(Process $process)
{
$this->dockerCompose('down', $this->getArgs());
$process->dockerCompose('down', $this->getArgs());
}
}
3 changes: 0 additions & 3 deletions app/Commands/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@

namespace App\Commands;

use App\Commands\Traits\Process;
use App\Environment;
use Illuminate\Support\Facades\File;
use LaravelZero\Framework\Commands\Command;

class Install extends Command
{
use Process;

/**
* The signature of the command.
*
Expand Down
46 changes: 46 additions & 0 deletions app/Commands/JsInspect.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

namespace App\Commands;

use App\Commands\Traits\HasDynamicArgs;
use App\Process;
use LaravelZero\Framework\Commands\Command;

class JsInspect extends Command
{
use HasDynamicArgs;

/**
* The name of the command.
*
* @var string
*/
protected $name = 'jsinspect';

/**
* The description of the command.
*
* @var string
*/
protected $description = 'Run jsinspect in the NODE-QA container.';

/**
* Execute the console command.
*
* @return mixed
*/
public function handle(Process $process)
{
$process->dockerRun(env('FWD_IMAGE_NODE_QA'), 'jsinspect', $this->getArgs());
}

/**
* Get default args when empty.
*
* @return string
*/
public function getDefaultArgs(): string
{
return 'src/';
}
}
8 changes: 4 additions & 4 deletions app/Commands/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
namespace App\Commands;

use App\Commands\Traits\HasDynamicArgs;
use App\Commands\Traits\Process;
use App\Process;
use LaravelZero\Framework\Commands\Command;

class Node extends Command
{
use HasDynamicArgs, Process;
use HasDynamicArgs;

/**
* The name of the command.
Expand All @@ -29,9 +29,9 @@ class Node extends Command
*
* @return mixed
*/
public function handle()
public function handle(Process $process)
{
$this->dockerRun(env('FWD_IMAGE_NODE'), 'node', $this->getArgs());
$process->dockerRun(env('FWD_IMAGE_NODE'), 'node', $this->getArgs());
}

/**
Expand Down
46 changes: 46 additions & 0 deletions app/Commands/NodeQa.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

namespace App\Commands;

use App\Commands\Traits\HasDynamicArgs;
use App\Process;
use LaravelZero\Framework\Commands\Command;

class NodeQa extends Command
{
use HasDynamicArgs;

/**
* The name of the command.
*
* @var string
*/
protected $name = 'node-qa';

/**
* The description of the command.
*
* @var string
*/
protected $description = 'Run shell commands in the NODE-QA container.';

/**
* Execute the console command.
*
* @return mixed
*/
public function handle(Process $process)
{
$process->dockerRun(env('FWD_IMAGE_NODE_QA'), $this->getArgs());
}

/**
* Get default args when empty.
*
* @return string
*/
public function getDefaultArgs(): string
{
return 'node -v';
}
}
8 changes: 4 additions & 4 deletions app/Commands/Npm.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
namespace App\Commands;

use App\Commands\Traits\HasDynamicArgs;
use App\Commands\Traits\Process;
use App\Process;
use LaravelZero\Framework\Commands\Command;

class Npm extends Command
{
use HasDynamicArgs, Process;
use HasDynamicArgs;

/**
* The name of the command.
Expand All @@ -29,9 +29,9 @@ class Npm extends Command
*
* @return mixed
*/
public function handle()
public function handle(Process $process)
{
$this->dockerRun(env('FWD_IMAGE_NODE'), 'npm', $this->getArgs());
$process->dockerRun(env('FWD_IMAGE_NODE'), 'npm', $this->getArgs());
}

/**
Expand Down
46 changes: 46 additions & 0 deletions app/Commands/Phan.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

namespace App\Commands;

use App\Commands\Traits\HasDynamicArgs;
use App\Process;
use LaravelZero\Framework\Commands\Command;

class Phan extends Command
{
use HasDynamicArgs;

/**
* The name of the command.
*
* @var string
*/
protected $name = 'phan';

/**
* The description of the command.
*
* @var string
*/
protected $description = 'Run phan in the PHP-QA container.';

/**
* Execute the console command.
*
* @return mixed
*/
public function handle(Process $process)
{
$process->dockerRun(env('FWD_IMAGE_PHP_QA'), 'phan', $this->getArgs());
}

/**
* Get default args when empty.
*
* @return string
*/
public function getDefaultArgs(): string
{
return '--color -p -l app -iy 5';
}
}
Loading

0 comments on commit c751055

Please sign in to comment.