Skip to content

Commit

Permalink
Also publish database init scripts (#592)
Browse files Browse the repository at this point in the history
Publish the testing database init scripts so containers can be build
even without vendor dir present.
  • Loading branch information
Jan authored Jun 28, 2023
1 parent 03ee630 commit 6258260
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Console/PublishCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class PublishCommand extends Command
public function handle()
{
$this->call('vendor:publish', ['--tag' => 'sail-docker']);
$this->call('vendor:publish', ['--tag' => 'sail-database']);

file_put_contents(
$this->laravel->basePath('docker-compose.yml'),
Expand All @@ -36,11 +37,15 @@ public function handle()
'./vendor/laravel/sail/runtimes/8.2',
'./vendor/laravel/sail/runtimes/8.1',
'./vendor/laravel/sail/runtimes/8.0',
'./vendor/laravel/sail/database/mysql',
'./vendor/laravel/sail/database/pgsql'
],
[
'./docker/8.2',
'./docker/8.1',
'./docker/8.0',
'./docker/mysql',
'./docker/pgsql'
],
file_get_contents($this->laravel->basePath('docker-compose.yml'))
)
Expand Down
4 changes: 4 additions & 0 deletions src/SailServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ protected function configurePublishing()
$this->publishes([
__DIR__ . '/../bin/sail' => $this->app->basePath('sail'),
], ['sail', 'sail-bin']);

$this->publishes([
__DIR__ . '/../database' => $this->app->basePath('docker'),
], ['sail', 'sail-database']);
}
}

Expand Down

0 comments on commit 6258260

Please sign in to comment.