New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

adamgaskins/deployed

A package for Laravel apps to send beautiful deployment notifications on Slack.
1,525
Install
composer require adamgaskins/deployed
Latest Version:v1.1.0
PHP:^7.4|^8.0
Laravel:8 · 9
License:MIT
Last Updated:Jun 7, 2022
Links: GitHub  ·  Packagist
Maintainer: AdamGaskins

An opinionated deployment notification generator for Laravel applications.

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.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

648,266,899 9,701
laravel/framework

The Laravel Framework.

604,216,237 34,982
laravel/tinker

Powerful REPL for the Laravel framework.

512,508,631 7,443
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

429,221,767 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

403,217,078 4,664

Version History

Version Released PHP Laravel License
v1.1.0 ^7.4|^8.0 ^8.37|^9.0 MIT
v1.0.0 ^7.4|^8.0 ^8.37 MIT