Skip to content

Instantly share code, notes, and snippets.

@wowaTYPO3
Created April 19, 2022 12:58
Show Gist options
  • Save wowaTYPO3/56a2323ab4d1b5749aa99eb55092d484 to your computer and use it in GitHub Desktop.
Save wowaTYPO3/56a2323ab4d1b5749aa99eb55092d484 to your computer and use it in GitHub Desktop.
<?php
namespace Deployer;
# Call default recipe
require 'recipe/common.php';
require 'recipe/cachetool.php';
set('cachetool', '127.0.0.1:9000');
set('bin/php', function () {
return '/usr/bin/php7.4';
});
set('bin/composer', function () {
return '/usr/bin/php7.4 /home/.local/bin/composer';
});
# Project name
set('application', 'projektname');
# Define Git-Repository
set('repository', 'git@github.com:deinname/deinprojekt.git');
# [Optional] Allocate tty for git clone. The default value is false.
set('git_tty', true);
# Set maximum releases backup
set('keep_releases', 5);
# To solve this issue: Can't detect http user name. Please set up the `http_user` config parameter.
# set('http_user', 'www-data');
# set('writable_mode', 'chmod');
# set('use_relative_symlink', '0');
# Set Server
inventory('.hosts.yaml');
# DocumentRoot / WebRoot for the TYPO3 installation
set('typo3_webroot', 'public');
# Shared directories
set('shared_dirs', [
'{{typo3_webroot}}/fileadmin',
'{{typo3_webroot}}/typo3temp',
'{{typo3_webroot}}/uploads',
]);
# Shared files
set('shared_files', [
'{{typo3_webroot}}/.htaccess',
'{{typo3_webroot}}/typo3conf/AdditionalConfiguration.php',
]);
# Writeable directories
set('writable_dirs', [
'config',
'var',
'{{typo3_webroot}}/fileadmin',
'{{typo3_webroot}}/typo3temp',
'{{typo3_webroot}}/typo3conf',
'{{typo3_webroot}}/uploads'
]);
task('linkmatomo', function(){
run('cd {{release_path}}/{{typo3_webroot}} && ln -s /home/www/matomo');
});
# Main TYPO3 task
task('deploy', [
'deploy:info',
'deploy:prepare',
'deploy:lock',
'deploy:release',
'deploy:update_code',
'deploy:shared',
'deploy:vendors',
'deploy:writable',
'deploy:symlink',
'linkmatomo',
'deploy:unlock',
'cleanup',
])->desc('Deploy your project');
after('deploy', 'success');
# [Optional] If the deployment fails automatically unlock.
after('deploy:failed', 'deploy:unlock');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment