|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Sfneal\Cruise\Providers; |
|
4
|
|
|
|
|
5
|
|
|
use Illuminate\Support\ServiceProvider; |
|
6
|
|
|
use Sfneal\Cruise\Commands\Bump; |
|
7
|
|
|
use Sfneal\Cruise\Commands\CruiseInstall; |
|
8
|
|
|
use Sfneal\Cruise\Commands\CruiseUninstall; |
|
9
|
|
|
use Sfneal\Cruise\Commands\MigrateDbInProduction; |
|
10
|
|
|
use Sfneal\Cruise\Commands\Version; |
|
11
|
|
|
use Sfneal\Cruise\Commands\WaitForDb; |
|
12
|
|
|
|
|
13
|
|
|
class CruiseServiceProvider extends ServiceProvider |
|
14
|
|
|
{ |
|
15
|
|
|
/** |
|
16
|
|
|
* Bootstrap any Users services. |
|
17
|
|
|
*/ |
|
18
|
|
|
public function boot(): void |
|
19
|
|
|
{ |
|
20
|
|
|
// Publish config file |
|
21
|
|
|
$this->publishes([ |
|
22
|
|
|
__DIR__.'/../../config/cruise.php' => config_path('cruise.php'), |
|
23
|
|
|
], ['config', 'cruise-config']); |
|
24
|
|
|
|
|
25
|
|
|
// Load commands |
|
26
|
|
|
if ($this->app->runningInConsole()) { |
|
27
|
|
|
$this->commands([ |
|
28
|
|
|
// DB commands |
|
29
|
|
|
MigrateDbInProduction::class, |
|
30
|
|
|
WaitForDb::class, |
|
31
|
|
|
|
|
32
|
|
|
// Semver bump commands |
|
33
|
|
|
Bump::class, |
|
34
|
|
|
Version::class, |
|
35
|
|
|
|
|
36
|
|
|
// Install/uninstall command |
|
37
|
|
|
CruiseInstall::class, |
|
38
|
|
|
CruiseUninstall::class, |
|
39
|
|
|
]); |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
// Docker compose & dockerfiles |
|
43
|
|
|
$this->publishes([ |
|
44
|
|
|
__DIR__.'/../../docker/services' => base_path(''), |
|
45
|
|
|
], 'docker'); |
|
46
|
|
|
|
|
47
|
|
|
// Supervisor configs |
|
48
|
|
|
$this->publishes([ |
|
49
|
|
|
__DIR__.'/../../docker/supervisor' => base_path('docker/supervisor'), |
|
50
|
|
|
], 'docker'); |
|
51
|
|
|
|
|
52
|
|
|
// Docker scripts configs |
|
53
|
|
|
$this->publishes([ |
|
54
|
|
|
__DIR__.'/../../docker/scripts' => base_path('docker/scripts'), |
|
55
|
|
|
], 'docker'); |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* Register any Users services. |
|
60
|
|
|
*/ |
|
61
|
|
|
public function register(): void |
|
62
|
|
|
{ |
|
63
|
|
|
// Load config file |
|
64
|
|
|
$this->mergeConfigFrom(__DIR__.'/../../config/cruise.php', 'cruise'); |
|
65
|
|
|
} |
|
66
|
|
|
} |
|
67
|
|
|
|