adamgaskins/deployed

A package for Laravel apps to send beautiful deployment notifications on Slack.

Fund package maintenance!
AdamGaskins

v1.1.0 2022-06-07 20:04 UTC

This package is auto-updated.

Last update: 2024-04-08 00:06:25 UTC


README

screenshot.png

An opinionated deployment notification generator for Laravel applications.

68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6164616d6761736b696e732f6465706c6f7965642e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6164616d6761736b696e732f6465706c6f7965642e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6164616d6761736b696e732f6465706c6f7965642f72756e2d74657374733f7374796c653d666c61742d737175617265266c6162656c3d7465737473 GitHub license

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.