Skip to content

Commit

Permalink
Merge pull request #16336 from snipe/change_order_in_upgrade_script
Browse files Browse the repository at this point in the history
Fixed #16334 - Changed composer order in upgrade script
  • Loading branch information
snipe authored Feb 25, 2025
2 parents b7821a6 + 3718f08 commit 18c7cbb
Showing 1 changed file with 28 additions and 23 deletions.
51 changes: 28 additions & 23 deletions upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function url_get_contents ($Url) {
echo "- check directory permissions \n";
echo "- do a git pull to bring you to the latest version \n";
echo "- run composer install to get your vendors up to date \n";
echo "- run a backup \n";
echo "- run migrations to get your schema up to date \n";
echo "- clear out old cache settings\n\n";

Expand Down Expand Up @@ -419,29 +420,9 @@ function url_get_contents ($Url) {



echo "--------------------------------------------------------\n";
echo "STEP 4: Backing up database: \n";
echo "--------------------------------------------------------\n\n";
$backup = exec('php artisan snipeit:backup', $backup_results, $return_code);
echo '-- ' . implode("\n", $backup_results) . "\n\n";
if ($return_code > 0) {
die("Something went wrong with your backup. Aborting!\n\n");
}
unset($return_code);

echo "--------------------------------------------------------\n";
echo "STEP 5: Putting application into maintenance mode: \n";
echo "--------------------------------------------------------\n\n";
exec('php artisan down', $down_results, $return_code);
echo '-- ' . implode("\n", $down_results) . "\n";
if ($return_code > 0) {
die("Something went wrong with downing you site. This can't be good. Please investigate the error. Aborting!n\n");
}
unset($return_code);


echo "--------------------------------------------------------\n";
echo "STEP 6: Pulling latest from Git (".$branch." branch): \n";
echo "STEP 4: Pulling latest from Git (".$branch." branch): \n";
echo "--------------------------------------------------------\n\n";
$git_version = shell_exec('git --version');

Expand All @@ -467,7 +448,7 @@ function url_get_contents ($Url) {


echo "--------------------------------------------------------\n";
echo "STEP 7: Cleaning up old cached files:\n";
echo "STEP 5: Cleaning up old cached files:\n";
echo "--------------------------------------------------------\n\n";

// Build an array of the files we generally want to delete because they
Expand Down Expand Up @@ -500,7 +481,7 @@ function url_get_contents ($Url) {
echo "\n";

echo "--------------------------------------------------------\n";
echo "STEP 8: Updating composer dependencies:\n";
echo "STEP 6: Updating composer dependencies:\n";
echo "(This may take a moment.)\n";
echo "--------------------------------------------------------\n\n";
echo "-- Running the app in ".$app_environment." mode.\n";
Expand Down Expand Up @@ -548,6 +529,30 @@ function url_get_contents ($Url) {
echo $composer;



echo "--------------------------------------------------------\n";
echo "STEP 7: Putting application into maintenance mode: \n";
echo "--------------------------------------------------------\n\n";
exec('php artisan down', $down_results, $return_code);
echo '-- ' . implode("\n", $down_results) . "\n";
if ($return_code > 0) {
die("Something went wrong with downing your site. This can't be good. Please investigate the error. Aborting!n\n");
}
unset($return_code);


echo "--------------------------------------------------------\n";
echo "STEP 8: Backing up database: \n";
echo "--------------------------------------------------------\n\n";
$backup = exec('php artisan snipeit:backup', $backup_results, $return_code);
echo '-- ' . implode("\n", $backup_results) . "\n\n";
if ($return_code > 0) {
die("Something went wrong with your backup. Aborting!\n\n");
}
unset($return_code);



echo "--------------------------------------------------------\n";
echo "STEP 9: Migrating database:\n";
echo "--------------------------------------------------------\n\n";
Expand Down

0 comments on commit 18c7cbb

Please sign in to comment.