contao-manager/login.lock'); }); desc('Enable maintenance mode'); task('contao:maintenance:enable', function () { // Enable maintenance mode in both the current and release build, so that the maintenance mode will be enabled // for the current installation before the symlink changes and the new installation after the symlink changed. foreach (array_unique([parse('{{current_path}}'), parse('{{release_or_current_path}}')]) as $path) { // The current path might not be present during first deploy. if (!test("[ -d $path ]")) { continue; } cd($path); run('{{bin/console}} contao:maintenance-mode enable {{console_options}}'); } }); desc('Disable maintenance mode'); task('contao:maintenance:disable', function () { foreach (array_unique([parse('{{current_path}}'), parse('{{release_or_current_path}}')]) as $path) { if (!test("[ -d $path ]")) { continue; } cd($path); run('{{bin/console}} contao:maintenance-mode disable {{console_options}}'); } }); desc('Deploy the project'); task('deploy', [ 'deploy:prepare', 'deploy:vendors', 'contao:maintenance:enable', 'contao:migrate', 'contao:maintenance:disable', 'deploy:publish', ]);