Skip to content

Commit 6258260

Browse files
author
Jan
authored
Also publish database init scripts (#592)
Publish the testing database init scripts so containers can be build even without vendor dir present.
1 parent 03ee630 commit 6258260

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/Console/PublishCommand.php

+5
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class PublishCommand extends Command
2828
public function handle()
2929
{
3030
$this->call('vendor:publish', ['--tag' => 'sail-docker']);
31+
$this->call('vendor:publish', ['--tag' => 'sail-database']);
3132

3233
file_put_contents(
3334
$this->laravel->basePath('docker-compose.yml'),
@@ -36,11 +37,15 @@ public function handle()
3637
'./vendor/laravel/sail/runtimes/8.2',
3738
'./vendor/laravel/sail/runtimes/8.1',
3839
'./vendor/laravel/sail/runtimes/8.0',
40+
'./vendor/laravel/sail/database/mysql',
41+
'./vendor/laravel/sail/database/pgsql'
3942
],
4043
[
4144
'./docker/8.2',
4245
'./docker/8.1',
4346
'./docker/8.0',
47+
'./docker/mysql',
48+
'./docker/pgsql'
4449
],
4550
file_get_contents($this->laravel->basePath('docker-compose.yml'))
4651
)

src/SailServiceProvider.php

+4
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ protected function configurePublishing()
5252
$this->publishes([
5353
__DIR__ . '/../bin/sail' => $this->app->basePath('sail'),
5454
], ['sail', 'sail-bin']);
55+
56+
$this->publishes([
57+
__DIR__ . '/../database' => $this->app->basePath('docker'),
58+
], ['sail', 'sail-database']);
5559
}
5660
}
5761

0 commit comments

Comments
 (0)