Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send Slack Notification on Deployment #78

Merged
merged 35 commits into from
Mar 5, 2024
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f16e559
Add Slack Webhook URL config setting
shawnhooper Mar 3, 2024
af89d05
Configure Slack Announcement
shawnhooper Mar 3, 2024
9d66452
Register the Notification Service Provider
shawnhooper Mar 3, 2024
69ba69f
Remove debug code
shawnhooper Mar 3, 2024
45c03b4
Try it with the bus service provider
shawnhooper Mar 3, 2024
d3f91d6
Reference notification by class name
shawnhooper Mar 3, 2024
d113c6b
Specify Channel Name
shawnhooper Mar 3, 2024
2697e61
Pass channel as "route"
shawnhooper Mar 3, 2024
f011f5a
Pass channel as "route"
shawnhooper Mar 3, 2024
5602c24
Pass channel as "route"
shawnhooper Mar 3, 2024
c562ceb
DEbug
shawnhooper Mar 3, 2024
8d99a9b
DEbug
shawnhooper Mar 3, 2024
ee365a4
DEbug
shawnhooper Mar 3, 2024
8ce2db5
DEbug
shawnhooper Mar 3, 2024
588fa77
DEbug
shawnhooper Mar 3, 2024
5369e29
Use NotifyNow so we don't need the bus
shawnhooper Mar 3, 2024
f606a57
Get it right from the env
shawnhooper Mar 3, 2024
739507d
Manual token ID
shawnhooper Mar 3, 2024
63b4d1f
Add SLACK_ANNOUNCEMENT_ENABLED support
shawnhooper Mar 3, 2024
cd23205
Dump the token length
shawnhooper Mar 3, 2024
1aaa95c
Dump the token length
shawnhooper Mar 3, 2024
367e6ca
Fix title text
shawnhooper Mar 3, 2024
b4b1e96
Fix title text
shawnhooper Mar 3, 2024
88ae950
Fix title text
shawnhooper Mar 3, 2024
4bb3d22
Fix title text
shawnhooper Mar 3, 2024
3567c84
Use default slack bot env variables
shawnhooper Mar 3, 2024
1ab4915
Fix branch name display
shawnhooper Mar 3, 2024
41760d1
Only announce once
shawnhooper Mar 3, 2024
978a444
Link to correct branch
shawnhooper Mar 3, 2024
b373214
Only display branch name
shawnhooper Mar 3, 2024
743b8ec
Merge remote-tracking branch 'upstream/main' into slack
shawnhooper Mar 3, 2024
c9d73fb
Removed slack token & channel condition check
mehrancodes Mar 5, 2024
c7f3731
Made the class strict
mehrancodes Mar 5, 2024
f9db886
Run Pint
mehrancodes Mar 5, 2024
7a18338
Updated AnnounceSiteOnSlack comment
mehrancodes Mar 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix title text
shawnhooper committed Mar 3, 2024
commit 367e6caca05f7c5fa2ea0f008234cf60cde0ed33
2 changes: 1 addition & 1 deletion app/Notifications/SiteProvisionedNotification.php
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ public function toSlack(object $notifiable): SlackMessage
->to($this->service->setting->slackChannel)
->text('A new site has been provisioned!')
->sectionBlock(function (SectionBlock $block) {
$block->text('An invoice has been paid.');
$block->text('An preview site has been deployed with Laravel Harbor');

$block->field("*Branch Name URL:*\n{$this->service->setting->branch}")->markdown();
$block->field("*Environment URL:*\n{$this->service->getSiteLink()}")->markdown();
2 changes: 0 additions & 2 deletions app/Services/Forge/Pipeline/AnnounceSiteOnSlack.php
Original file line number Diff line number Diff line change
@@ -43,8 +43,6 @@ public function __invoke(ForgeService $service, Closure $next)
$notification = new SiteProvisionedNotification($service);
$slack_notification = $notification->toSlack(new AnonymousNotifiable());

$slack_notification->dd();

Notification::send(
new SlackRoute($service->setting->slackChannel, $service->setting->slackBotToken),
$notification