Skip to content

Commit 5a72e9e

Browse files
authored
v1.0.6 (#10)
2 parents 2ef50ef + 266ef54 commit 5a72e9e

File tree

9 files changed

+304
-57
lines changed

9 files changed

+304
-57
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ Usage is extremely straight forward. Use the `artisan deploy` command optionally
4747
$ php artisan deploy [alias]
4848
```
4949

50+
You can also get detailed information on your project using the `artisan deploy:info` command:
51+
52+
```bash
53+
$ php artisan deploy:info [alias]
54+
```
55+
5056
## Bug Reports
5157

5258
If you discover a bug in Envoyer Deploy Commands, please [open an issue](https://github.com/Log1x/envoyer-deploy-commands/issues).

composer.lock

Lines changed: 44 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/envoyer.php

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/*
1818
|--------------------------------------------------------------------------
19-
| The deployment projects.
19+
| Envoyer Projects
2020
|--------------------------------------------------------------------------
2121
|
2222
| Here you will configure the projects you wish to deploy to. You must
@@ -30,4 +30,29 @@
3030
// 'staging' => 111111,
3131
],
3232

33+
/*
34+
|--------------------------------------------------------------------------
35+
| Confirmation Prompt
36+
|--------------------------------------------------------------------------
37+
|
38+
| Here you can toggle the default confirmation prompt when deploying.
39+
| You can also toggle this on a per-project basis by passing the
40+
| `--confirm` flag when deploying.
41+
|
42+
*/
43+
44+
'confirm' => true,
45+
46+
/*
47+
|--------------------------------------------------------------------------
48+
| Show Monitor URL
49+
|--------------------------------------------------------------------------
50+
|
51+
| Here you can toggle displaying the monitor URL after deploying. You can
52+
| optionally set this to a string to override the URL with a custom value.
53+
|
54+
*/
55+
56+
'url' => true,
57+
3358
];

src/Console/DeployCommand.php

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ class DeployCommand extends Command
1818
* @var string
1919
*/
2020
protected $signature = 'deploy
21-
{project? : The project to deploy to}';
21+
{project? : The project to deploy to}
22+
{--confirm : Confirm the deployment}';
2223

2324
/**
2425
* The console command description.
@@ -93,16 +94,20 @@ public function handle(): void
9394
->filter(fn ($item) => $item->id === $project)
9495
->first();
9596

96-
$this->newLine();
97-
9897
if (! $this->project) {
98+
$this->newLine();
99+
99100
$this->components->error("The project with ID <fg=red>{$project}</> could not be found.");
100101

101102
return;
102103
}
103104

104-
if (! $this->components->confirm("Deploy to <fg=blue>{$this->project->name}</>?", true)) {
105-
return;
105+
if (! $this->option('confirm') && $this->envoyer->confirm()) {
106+
$this->newLine();
107+
108+
if (! $this->components->confirm("Deploy to <fg=blue>{$this->project->name}</>?", true)) {
109+
return;
110+
}
106111
}
107112

108113
$this->components->task("<fg=blue>✔</> Starting Deployment for <fg=blue>{$this->project->name}</>", function () {
@@ -141,6 +146,21 @@ public function handle(): void
141146
if (Str::is($this->deployment->status, 'finished')) {
142147
$this->line(" 🎉 Deployment <options=bold>completed</> in <fg=blue>{$elapsed}</> seconds.");
143148

149+
if ($this->envoyer->url()) {
150+
if (is_string($this->envoyer->url())) {
151+
$this->line(" <fg=blue>↳</> <options=underscore>{$this->envoyer->url()}</>");
152+
153+
return;
154+
}
155+
156+
if ($this->project->monitor) {
157+
$scheme = parse_url($this->project->monitor, PHP_URL_SCHEME);
158+
$url = parse_url($this->project->monitor, PHP_URL_HOST);
159+
160+
$this->line(" <fg=blue>↳</> <options=underscore>{$scheme}://{$url}</>");
161+
}
162+
}
163+
144164
return;
145165
}
146166

0 commit comments

Comments
 (0)