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

Commit

Permalink
Adding pnpm + fix docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
dbpolito committed May 16, 2020
1 parent 80c5b54 commit 6ae3f6e
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 2 deletions.
21 changes: 21 additions & 0 deletions app/Builder/Pnpm.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace App\Builder;

class Pnpm extends Builder
{
public function getProgramName() : string
{
return 'pnpm';
}

public function makeWrapper() : ?Builder
{
return (new DockerRun())->addArgument(env('FWD_IMAGE_NODE'));
}

public static function getDefaultArgs(): array
{
return ['-v'];
}
}
37 changes: 37 additions & 0 deletions app/Commands/Pnpm.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

namespace App\Commands;

use App\Builder\Pnpm as PnpmBuilder;
use App\Commands\Traits\HasDynamicArgs;

class Pnpm extends Command
{
use HasDynamicArgs;

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

/**
* The description of the command.
*
* @var string
*/
protected $description = 'Run pnpm in a new container.';

/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
return $this->commandExecutor->run(
PnpmBuilder::makeWithDefaultArgs($this->getArgs())
);
}
}
Binary file modified builds/fwd
Binary file not shown.
2 changes: 1 addition & 1 deletion docker-compose-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
image: ${FWD_IMAGE_APP}
volumes:
- ${FWD_CONTEXT_PATH}:/app:cached
- ${FWD_SSH_PATH}:/home/developer/.ssh:cached
- ${FWD_SSH_PATH}:/home/fwd/.ssh:cached
environment:
ASUSER: ${FWD_ASUSER}
http:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-v3.7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
init: true
volumes:
- ${FWD_CONTEXT_PATH}:/app:cached
- ${FWD_SSH_PATH}:/home/developer/.ssh:cached
- ${FWD_SSH_PATH}:/home/fwd/.ssh:cached
environment:
ASUSER: ${FWD_ASUSER}
networks:
Expand Down
22 changes: 22 additions & 0 deletions tests/Feature/PnpmTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace Tests\Feature;

use Tests\TestCase;

class PnpmTest extends TestCase
{
public function testPnpm()
{
$this->artisan('pnpm')->assertExitCode(0);

$this->assertDockerRun('fireworkweb/node:12 pnpm -v');
}

public function testPnpmCustom()
{
$this->artisan('pnpm install')->assertExitCode(0);

$this->assertDockerRun('fireworkweb/node:12 pnpm install');
}
}

0 comments on commit 6ae3f6e

Please sign in to comment.