/deployment-script

Deployment Script to run it with each update of your application

Primary LanguagePHPMIT LicenseMIT

The backe add artisan commond that all user to do collected artisan or terminal command at once.

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Package Description

This package provides a convenient way to run groups of Artisan commands through a pre-defined configuration file. This can be useful for automating tasks such as deployment, database maintenance, and testing.

Features

  • Run groups of Artisan commands with a single command
  • Override command options in the configuration file
  • Pass values to artisan commands like --force.
  • Run command like git pull.

Example

For example, to run the following commands:

php artisan migrate:fresh
php artisan cache:clear
php artisan route:cache
return [
    'commands' => [
        [
            "type" => "artisan",
            "command" => "migrate:fresh"
        ],
        [
            "type" => "artisan",
            "command" => "cache:clear"
        ],
        [
            "type" => "artisan",
            "command" => "route:cache"
        ],
    ],
];

Then, you would run the following command:

php artisan deploy

This package is a valuable tool for any Laravel developer who needs to automate tasks or run groups of Artisan commands on a regular basis.

Installation

You can install the package via composer:

composer require bitcodesa/deployment-script

You can publish the config file with:

php artisan vendor:publish --tag="deployment-script-config"

This is the contents of the published config file:

return [
     "commands" => [
        [
            "type" => "console",
            "command" => "git pull"
        ],
        [
            "type" => "console",
            "command" => "composer install --optimize-autoloader",
        ],
        [
            "type" => "artisan",
            "command" => "migrate",
            "values" => [
                "--force" => true
            ]
        ],
        [
            "type" => "artisan",
            "command" => "cache:clear",
        ],
    ]
];

Usage

php artisan deploy

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.