Skip to content

Commit

Permalink
Merge pull request #1851 from mrrobot47/add/disk-space-check
Browse files Browse the repository at this point in the history
Add minimum 5GB free disk requirement for update
  • Loading branch information
mrrobot47 committed Aug 8, 2024
2 parents a946ec3 + ea9b415 commit f5485c1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions php/EE/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,15 @@ public function check_requirements( $show_error = true ) {
*/
private function migrate() {

// Check if minimum 5GB disk space is available
$free_space = disk_free_space( EE_ROOT_DIR );
$docker_dir = EE::launch( 'docker info --format \'{{.DockerRootDir}}\'' )->stdout;
$free_space_docker = disk_free_space( $docker_dir );

if ( $free_space < 5 * 1024 * 1024 * 1024 || $free_space_docker < 5 * 1024 * 1024 * 1024 ) {
EE::error( 'EasyEngine update requires minimum 5GB disk space to run. Please free up some space and try again.' );
}

$rsp = new \EE\RevertableStepProcessor();

$rsp->add_step( 'ee-db-migrations', 'EE\Migration\Executor::execute_migrations' );
Expand Down

0 comments on commit f5485c1

Please sign in to comment.