mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 14:36:17 +00:00
Add notification for deployment completion (#445)
* Add notification for deployment completion Add notification for deployment completion status. * Create `DeploymentCompleted` notification class in `app/Notifications/DeploymentCompleted.php` to handle deployment completion notifications. * Update `app/Actions/Site/Deploy.php` to send `DeploymentCompleted` notification using `Notifier` when a deployment completes or fails. * Import `Notifier` and `DeploymentCompleted` classes in `app/Actions/Site/Deploy.php`. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/vitodeploy/vito?shareId=XXXX-XXXX-XXXX-XXXX). * Format with pint * Add tests * Pint format * Delete tests/Feature/Notifications/DeploymentCompletedTest.php * Delete tests/Unit/Notifications/DeploymentCompletedTest.php * 🍻🍻 * tests --------- Co-authored-by: Saeed Vaziry <61919774+saeedvaziry@users.noreply.github.com> Co-authored-by: Saeed Vaziry <mr.saeedvaziry@gmail.com>
This commit is contained in:
committed by
GitHub
parent
7b723bcba5
commit
d702b95e0c
@ -5,10 +5,12 @@
|
||||
use App\Enums\DeploymentStatus;
|
||||
use App\Facades\SSH;
|
||||
use App\Models\GitHook;
|
||||
use App\Notifications\DeploymentCompleted;
|
||||
use App\Web\Pages\Servers\Sites\View;
|
||||
use App\Web\Pages\Servers\Sites\Widgets\DeploymentsList;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
use Livewire\Livewire;
|
||||
use Tests\TestCase;
|
||||
|
||||
@ -65,6 +67,7 @@ public function test_deploy(): void
|
||||
],
|
||||
]),
|
||||
]);
|
||||
Notification::fake();
|
||||
|
||||
$this->site->deploymentScript->update([
|
||||
'content' => 'git pull',
|
||||
@ -88,6 +91,8 @@ public function test_deploy(): void
|
||||
SSH::assertExecutedContains('cd /home/vito/'.$this->site->domain);
|
||||
SSH::assertExecutedContains('git pull');
|
||||
|
||||
Notification::assertSentTo($this->notificationChannel, DeploymentCompleted::class);
|
||||
|
||||
$this->get(
|
||||
View::getUrl([
|
||||
'server' => $this->server,
|
||||
|
Reference in New Issue
Block a user