setHostname('dedi10193.your-server.de') ->setRemoteUser('eptypo3') ->setForwardAgent(true) ->setSshMultiplexing(true) ->setDeployPath('/usr/home/eptypo3/public_html/{{application}}') ->set('bin/php', '/usr/bin/php85') ->set('http_user', 'eptypo3') ; task('deploy:build', function () { runLocally('rm -rf {{build_dir}} && mkdir -p {{build_dir}}'); runLocally('git archive HEAD | tar -x -C {{build_dir}}'); // Assets first: Composer only publishes the theme's Resources/Public to public/_assets // if the directory exists when it runs, and the asset build creates it runLocally('ddev exec bash -c "cd var/deploy-build && npm ci --no-audit --no-fund && npm run build"'); runLocally('ddev exec bash -c "cd var/deploy-build && composer install --no-dev --prefer-dist --no-progress --no-interaction --optimize-autoloader"'); })->once(); task('typo3:fileadmin', function () { // Relative (-r), like Deployer's shared dirs: the vhosts answer 403 for an absolute symlink here run('ln -sfnr {{fileadmin_path}} {{release_path}}/{{typo3/public_dir}}/fileadmin'); }); // current_path instead of the recipe's release_path, so it also works after a rollback task('typo3:cache:flush', function () { run('{{bin/php}} {{current_path}}/{{bin/typo3}} cache:flush'); }); task('deploy', [ 'deploy:info', // Build locally first, so a failing build aborts before the server is touched at all. 'deploy:build', 'deploy:setup', 'deploy:lock', 'deploy:release', 'rsync', 'deploy:shared', 'typo3:fileadmin', 'deploy:writable', // The schema has to exist before the new code starts serving traffic. 'typo3:extension:setup', // deploy:publish == deploy:symlink, deploy:unlock, deploy:cleanup, deploy:success 'deploy:publish', ]); // Caches belong to the release that goes live, so they are cleared after the symlink flip. Hooking // into deploy:symlink rather than appending to the list above keeps them inside deploy:publish, ahead // of deploy:unlock and deploy:success - a failing cache task must not follow a declared success. after('deploy:symlink', 'typo3:cache:flush'); // Pages cached by the other release must not survive a rollback after('rollback', 'typo3:cache:flush');