14
14
/**
15
15
* @internal
16
16
*/
17
- #[AsCommand(name: 'nightwatch:deploy ' , description: 'Notice the Nightwatch agent that a new deployment has been made . ' )]
17
+ #[AsCommand(name: 'nightwatch:deploy ' , description: 'Notify Nightwatch of a deployment. ' )]
18
18
final class DeployCommand extends Command
19
19
{
20
20
/**
@@ -27,11 +27,10 @@ final class DeployCommand extends Command
27
27
/**
28
28
* @var string
29
29
*/
30
- protected $ description = 'Notice the Nightwatch agent that a new deployment has been made . ' ;
30
+ protected $ description = 'Notify Nightwatch of a deployment. ' ;
31
31
32
32
public function __construct (
33
33
private HttpFactory $ http ,
34
- private ?string $ baseUrl ,
35
34
#[SensitiveParameter] private ?string $ token ,
36
35
) {
37
36
parent ::__construct ();
@@ -41,11 +40,7 @@ public function handle(): void
41
40
{
42
41
$ tag = config ('nightwatch.deployment ' ) ?? '' ;
43
42
44
- if (! $ this ->baseUrl ) {
45
- $ this ->error ('No Nightwatch base URL configured. ' );
46
-
47
- return ;
48
- }
43
+ $ baseUrl = $ _SERVER ['NIGHTWATCH_BASE_URL ' ] ?? 'https://nightwatch.laravel.com ' ;
49
44
50
45
if (! $ this ->token ) {
51
46
$ this ->error ('No Nightwatch token configured. ' );
@@ -60,7 +55,7 @@ public function handle(): void
60
55
'Accept ' => 'application/json ' ,
61
56
'Content-Type ' => 'application/json ' ,
62
57
])
63
- ->post ("{$ this -> baseUrl }/api/deployments " , [
58
+ ->post ("{$ baseUrl }/api/deployments " , [
64
59
'timestamp ' => now ()->timestamp ,
65
60
'version ' => $ tag ,
66
61
]);
0 commit comments