Skip to content

Latest commit

 

History

History
127 lines (86 loc) · 4.8 KB

TYPO3.md

File metadata and controls

127 lines (86 loc) · 4.8 KB

TYPO3 Deployment

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.

Installation

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.

Tasks

The following tasks are TYPO3 specific and extend the default deployer deployment:

Default deployment

The default deployment task for TYPO3 applications can be found here deploy.php

Clearing the cache

dep deploy:cache:clear

Warming the cache

dep deploy:cache:warmup

Note

This is just a simple curl request for the public URL configuration of the deployer host.

dep cache:warmup

Note

This is using the EXT:typo3-warming extension to warm up the cache.

Clearing and warming the cache

Clearing and warming the cache in one combined task

dep deploy:cache:clear_and_warmup

Rollback

dep rollback runs this combined task afterwards, so the caches are flushed and warmed up.

Updating the database

dep deploy:database:update

Backup database

By 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();

Additional Setup

This command runs following TYPO3 CMS specific commands from the typo3_console:

  • typo3cms install:fixfolderstructure
  • typo3cms install:extensionsetupifpossible
dep deploy:additional_setup

Payload without dev packages

By 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:

  1. Copies {{app_path}} to {{payload_path}} (default .build/payload/{{alias}}), leaving out vendor/, the rsync_default_excludes and the payload itself. Files that no longer exist in the source are removed from the payload, vendor/ is kept between runs and reconciled by composer install. payload_path must be a path below .build/, because the copy deletes everything else in the target directory
  2. Runs composer install {{payload_composer_options}} in the payload, by default with --no-dev. The default also has --no-scripts, so scripts from composer.json do not run there. Override payload_composer_options if the project needs them
  3. Makes rsync_src point 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