This package provides deploy task for deploying TYPO3 CMS with deployer (deployer.org).
Install package with composer:
composer require sourcebroker/deployer-typo3
Its advisable that you put
alias dep="vendor/bin/dep"
in your~/.profile
to be able to run deployer with regulardep
command. Otherwise you will need to run deployer like this./vendor/bin/dep ...
Put following lines on the beginning of your deploy.php:
require_once(__DIR__ . '/vendor/sourcebroker/deployer-loader/autoload.php'); new \SourceBroker\DeployerExtendedTypo3\Loader();
Remove task "deploy" from your deploy.php. Otherwise you will overwrite deploy task defined in
vendor/sourcebroker/deployer-typo3/deployer/default/deploy/task/deploy.php
. Look at Example of working configuration to see how simple can be workingdeploy.php
file.If you want to update language files on each deploy add task
typo3cms:language:update
beforedeploy_symlink
. Read https://github.com/sourcebroker/deployer-typo3/discussions/14 to see why updating language labels on each deploy is very arguable and generally not advised.before('deploy_symlink', 'typo3cms:language:update');
Run:
dep deploy [host]
For TYPO3 13 the shared dirs are:
set('shared_dirs', function () { return [ get('web_path') . 'fileadmin', get('web_path') . 'typo3temp/assets/_processed_', get('web_path') . 'typo3temp/assets/images', 'var/charset', 'var/lock', 'var/log', 'var/session', ]; });
The shared file for TYPO3 13 is:
set('shared_files', ['.env']);
You can set proper version of composer with composer_channel
(values: 1, 2, stable, prelive, snapshot) or with
composer_version
which takes exact tags as arguments (https://github.com/composer/composer/tags). For stability and
security it is advised that you set composer_channel
with value 1
or 2
so it will be automatically updated
but will not install any new major version in future so your deploy will remain fairly stable. The default value is 2
.
set('composer_channel', 2);
This is example of working configuration for TYPO3 13. The aim of sourcebroker/deployer-typo3
is to
have very slim deploy.php
file in order to have nice possibility to upgrade to future versions of
sourcebroker/deployer-typo3
.
<?php namespace Deployer; require_once(__DIR__ . '/vendor/sourcebroker/deployer-loader/autoload.php'); new \SourceBroker\DeployerExtendedTypo3\Loader(); set('repository', '[email protected]:sourcebrokergit/t3base13.git'); host('production') ->setHostname('vm-dev.example.com') ->setRemoteUser('deploy') ->set('branch', 'master') ->set('bin/php', '/home/www/t3base13-public/production/.bin/php'); ->set('public_urls', ['https://production-t3base13.example.com']) ->set('deploy_path', '/home/www/t3base13/production'); host('staging') ->setHostname('vm-dev.example.com') ->setRemoteUser('deploy') ->set('branch', 'master') ->set('bin/php', '/home/www/t3base13-public/staging/.bin/php'); ->set('public_urls', ['https://staging-t3base13.example.com']) ->set('deploy_path', '/home/www/t3base13/staging'); localhost('local') ->set('bin/php', 'php') ->set('deploy_path', getcwd());
See https://github.com/sourcebroker/deployer-typo3/blob/master/CHANGELOG.rst