Skip to content

tangoslee/post-script

Repository files navigation

Installing

  • This package publishes a config/post_script.php file. If you already have a file by that name, please rename or remove it.
  • You can install the package via composer:
 composer require tangoslee/post-script
  • Optional: The service provider will automatically get registered. Or you may manually add the service provider in your config/app.php file:
'providers' => [
    // ...
    Tangoslee\PostScript\PostScriptServiceProvider::class,
];
  • You should publish the migration and the config/post_script.php config file with:
php artisan vendor:publish --provider="Tangoslee\PostScript\PostScriptServiceProvider"
  • Run the migrations: After the config and migration have been published and configured, you can create the tables for this package by running:
php artisan migrate

Usages

Create new post-script

php artissan make:post-script foo_bar
  • output example
/home/user/project/post-scripts/2024/08/2024_08_19_125037_foo_bar.sh created

Edit a script

  • Edit a shell script

Show status

php artisan post-script:status
  • output example
+------+------------------------------+------------+----+
| Ran? | Script                       | Batch      | ID |
+------+------------------------------+------------+----+
| Yes  | 2024_08_09_123456_script.sh  | 1723977236 | 1  |
| No   | 2024_08_19_125037_foo_bar.sh |            |    |
+------+------------------------------+------------+----+

Run all scripts that have not been executed.

php artisan post-script:run

Run script again

  • example. If you want to run ID 1 script again for some reason.
+------+------------------------------+------------+----+
| Ran? | Script                       | Batch      | ID |
+------+------------------------------+------------+----+
| Yes  | 2024_08_09_123456_script.sh  | 1723977236 | 1  |
| No   | 2024_08_19_125037_foo_bar.sh |            |    |
+------+------------------------------+------------+----+
php artisan post-script:run --replay 1

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages