The TYPO3 documentation describes the deployment and initialization process of a TYPO3 CMS application.
The deployment package is inspired by deployer-extended-typo3.
The deployment workflow uses the deployer package deployer-extended as basis.
The default configuration for TYPO3 applications is located at set.php and can be overwritten optionally.
If you want to use the TYPO3 deployment functionalities add the belonging autoloader to your project deploy.php:
require_once(__DIR__ . '/vendor/move-elevator/deployer-tools/deployer/typo3/autoload.php');See an example configuration here: typo3 example.
The following tasks are TYPO3 specific and extend the default deployer deployment:
The default deployment task for TYPO3 applications can be found here deploy.php
dep deploy:cache:cleardep deploy:cache:warmupNote
This is just a simple curl request for the public URL configuration of the deployer host.
dep cache:warmupNote
This is using the EXT:typo3-warming extension to warm up the cache.
Clearing and warming the cache in one combined task
dep deploy:cache:clear_and_warmupdep rollback runs this combined task afterwards, so the caches are flushed and warmed up.
dep deploy:database:updateBy default a database dump is created on deployments to prod environment. The default configuration file used by the task is:
'.deployment/db-sync-tool/backup-prod.yaml'This can be overwritten by setting 'sync_database_backup_config'. For example:
set('sync_database_backup_config', __DIR__ . '/.deployment/db-sync-tool/some-configation.json');To disable the database backup you can disable the task like this:
task('database:backup')->disable();This command runs following TYPO3 CMS specific commands from the typo3_console:
- typo3cms install:fixfolderstructure
- typo3cms install:extensionsetupifpossible
dep deploy:additional_setupBy default rsync transfers the workspace including vendor/, so every require-dev package reaches the host. The dev package check lists them. In TYPO3 Composer mode a dev-only extension is active in production.
With deploy_payload the deployment builds a separate copy of the application and transfers that instead:
set('deploy_payload', true);deploy:payload runs after deploy:lock and before the dev package check, so the check inspects the payload. It does the following:
- Copies
{{app_path}}to{{payload_path}}(default.build/payload/{{alias}}), leaving outvendor/, thersync_default_excludesand the payload itself. Files that no longer exist in the source are removed from the payload,vendor/is kept between runs and reconciled bycomposer install.payload_pathmust be a path below.build/, because the copy deletes everything else in the target directory - Runs
composer install {{payload_composer_options}}in the payload, by default with--no-dev. The default also has--no-scripts, so scripts fromcomposer.jsondo not run there. Overridepayload_composer_optionsif the project needs them - Makes
rsync_srcpoint to the payload
Deployer keeps running from the workspace vendor/, which still has the dev packages. The deploy job needs Composer, plus Composer authentication for private packages. Add /.build to the project's .gitignore.
The settings are read per host, and the payload is built for every selected host that enables it. The default payload_path contains the host alias, so hosts of one run each get their own payload and cannot overwrite each other. A custom payload_path has to keep that property when a run selects more than one host.
| Setting | Default |
|---|---|
deploy_payload |
false |
payload_path |
.build/payload/{{alias}} |
payload_composer_options |
--prefer-dist --no-progress --no-interaction --no-dev --optimize-autoloader --no-scripts |