adamgaskins / deployed
A package for Laravel apps to send beautiful deployment notifications on Slack.
Fund package maintenance!
AdamGaskins
Installs: 1 518
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^7.4|^8.0
- guzzlehttp/guzzle: ^7.3
- illuminate/contracts: ^8.37|^9.0
- league/commonmark: ^2.0
- slack-php/slack-block-kit: ^0.19.0
- spatie/browsershot: ^3.50
- spatie/laravel-package-tools: ^1.4.3
Requires (Dev)
- brianium/paratest: ^6.2
- nunomaduro/collision: ^5.3
- orchestra/testbench: ^6.15
- phpunit/phpunit: ^9.3
- spatie/laravel-ray: ^1.23
- vimeo/psalm: ^4.8
README
An opinionated deployment notification generator for Laravel applications.
Installation
You can install the package via composer:
composer require adamgaskins/deployed
You should publish the config file so you can customize the buttons sent with the notification:
php artisan vendor:publish --provider="AdamGaskins\Deployed\DeployedServiceProvider" --tag="deployed-config"
Below are the contents of the published config file. You'll want to at least update vendor/app
in the Changelog path to point to your app, and make sure you have a white, transparent logo PNG uploaded.
return [ 'links' => [ 'Changelog' => 'https://github.com/vendor/app/blob/v{appVersion}/CHANGELOG.md', 'Visit Site' => '{appUrl}', ], 'logo' => public_path('img/logo.png'), 'slack' => [ 'webhook' => env('DEPLOYED_SLACK_WEBHOOK') ], 'default_emoji' => '✨', 'emojis' => [ 'feature' => '✨', 'bug' => '🐛', 'docs' => '📝', 'tests' => '✅' ] ];
You'll also want to add a version
field to your config/app.php
file. This is how Deployed obtains the version number.
[ 'name' => env('APP_NAME'), 'version' => '1.0.0' ]
Finally, add the slack webhook to your .env
file
DEPLOYED_SLACK_WEBHOOK=https://hooks.slack.com/services/xxx/xxx/xxx
Usage
Run this command after a successful deploy to send a beautiful slack notification with a changelog.
php artisan deployed --notify
Deployed will parse the CHANGELOG.md
in the root of your application. Each version is expected to begin with a heading and contain a list of changes. For each change in the list, put the type (feature/bug/etc.) in bold at the beginning of the line. Here is an example of a changelog entry that generates the notification at the top of this readme:
### Version 10.3.23 > Released 09/10/2021 - **FEATURE:** Added **Duplicate** button to product editor. - **BUG:** Deleting a product with no image but with image dimensions specified causes an error. - **DOCS:** Updated `README.md` to document new deployment steps. - **TESTS:** Added tests for new **Duplicate** button. ...
Testing
composer test
License
The MIT License (MIT). Please see License File for more information.