PHP code example of bitcodesa / deployment-script
1. Go to this page and download the library: Download bitcodesa/deployment-script library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bitcodesa / deployment-script example snippets
return [
'commands' => [
[
"type" => "artisan",
"command" => "migrate:fresh"
],
[
"type" => "artisan",
"command" => "cache:clear"
],
[
"type" => "artisan",
"command" => "route:cache"
],
],
];
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",
],
]
];
[
// config/deployment-script.php
"allow_in_production" => true;
]
[
// config/deployment-script.php
"production_commands" => [
[
"type" => "artisan",
"command" => "migrate",
"values" => [
"--force" => true
]
],
[
"type" => "artisan",
"command" => "cache:clear",
],
]
"production" => "production_commands";
];
bash
php artisan migrate:fresh
php artisan cache:clear
php artisan route:cache
php artisan deploy
bash
php artisan vendor:publish --tag="deployment-script-config"
bash
php artisan deploy