Moin zusammen,
ich bin seit einiger Zeit dabei ein Deployment über die Gitlab CI/CD und Deployer zu konfigurieren.
Das Deployment an sich funktioniert auch eigentlich, allerdings habe ich das seltsame Verhalten, dass ich keinen Zugriff auf die Ordner habe, die ich als Shared Directories angebe.
Infos zum Deployment habe ich von folgenden Quellen:
Wenn ich die Shared Directories (fileadmin, typo3temp) aus den Shared Directories entferne, werden die Ordner logischerweise beim Deployment neu angelegt, allerdings habe ich dann den normalen Zugriff auf die Ordner. Ich kann Bilder über das Backend hochladen und diese werden auch im Forntend ausgegeben.
CSS- und Javascript-Dateien werden dann auch wie gewohnt geladen.
Zu Beginn hatte ich die Vermutung es könnte an der .htaccess liegen.
Oder aber am TYPO3-Core, da im Backend unter Enviroment > Directory Status folgende Fehler ausgegeben werden:

Zu diesem Fehler habe ich auch ein Ticket gefunden, welches eigentlich bereits geschlossen wurde: https://forge.typo3.org/issues/106448
Daten zum System:
Provider: Mittwald
TYPO3: 13.4.13 - 13.4.14 (Beide Versionen getestet)
Meine deploy.php
<?php
namespace Deployer;
/*
* This file is part of the TYPO3 project template.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read
* the LICENSE file that was distributed with this source code.
*/
require_once 'recipe/common.php';
require_once 'contrib/rsync.php';
$composerConfig = json_decode(file_get_contents('./composer.json'), true, 512, JSON_THROW_ON_ERROR);
import('.hosts.yaml');
/**
* DocumentRoot / WebRoot for the TYPO3 installation
*/
set('typo3_webroot', function () use ($composerConfig) {
if ($composerConfig['extra']['typo3/cms']['web-dir'] ?? false) {
return $composerConfig['extra']['typo3/cms']['web-dir'];
}
return 'public';
});
/**
* Path to TYPO3 cli
*/
set('bin/typo3', function () use ($composerConfig) {
if ($composerConfig['config']['bin-dir'] ?? false) {
return $composerConfig['config']['bin-dir'] . '/typo3';
}
return 'vendor/bin/typo3';
});
// Set maximum number of releases
set('keep_releases', 3);
/**
* Log files to display when running `./vendor/bin/dep logs:app`
*/
set('log_files', 'var/log/typo3_*.log');
/**
* Shared directories
*/
set('shared_dirs', [
'public/fileadmin',
'public/typo3temp',
'var/session',
'var/log',
'var/lock',
'var/charset',
]);
/**
* Shared files
*/
set('shared_files', [
// '{{typo3_webroot}}/.htaccess',
'config/system/additional.php',
]);
/**
* Writeable directories
*/
set('writable_dirs', [
'{{typo3_webroot}}/fileadmin',
'{{typo3_webroot}}/typo3temp',
'var',
]);
// set('writable_mode', 'chmod');
// set('writable_chmod_mode', '0755');
/**
* Composer options
*/
set('composer_options', ' --no-dev --verbose --prefer-dist --no-progress --no-interaction --optimize-autoloader');
$exclude = [
'.php-cs-fixer.dist.php',
'.phpstan.neon',
'/*.md',
'deploy.php',
'LICENSE',
'.Build',
'.git*',
'.gitlab',
'.ddev',
'.deployer',
'.idea',
'.DS_Store',
'.gitlab-ci.yml',
'.npm',
'.hosts.yaml',
'package.json',
'package-lock.json',
'node_modules/',
'var/',
'public/fileadmin/',
'public/typo3temp/',
'config/system/additional.php',
];
set('rsync', [
'exclude' => array_merge(get('shared_dirs'), get('shared_files'), $exclude),
'exclude-file' => false,
'include' => [],
'include-file' => false,
'filter' => [],
'filter-file' => false,
'filter-perdir' => false,
'flags' => 'avz',
'options' => ['delete'],
'timeout' => 600,
]);
task('deploy:update:code', function () {
invoke('rsync:warmup');
invoke('rsync');
});
desc('TYPO3 - Cache clearing all caches');
task('typo3:cache:flush', function () {
cd('{{release_path}}');
run('{{bin/php}} {{bin/typo3}} cache:flush');
});
desc('TYPO3 - Cache warmup all caches');
task('typo3:cache:warmup', function () {
cd('{{release_path}}');
run('{{bin/php}} {{bin/typo3}} cache:warmup');
});
desc('TYPO3 - Set up all extensions');
task('typo3:extension:setup', function () {
cd('{{release_path}}');
run('{{bin/php}} {{bin/typo3}} extension:setup');
});
desc('TYPO3 - Fix folder structure');
task('typo3:install:fixfolderstructure', function () {
cd('{{release_path}}');
run('{{bin/php}} {{bin/typo3}} install:fixfolderstructure');
});
desc('TYPO3 - Update the language files of all activated extensions');
task('typo3:language:update', function () {
cd('{{release_path}}');
run('{{bin/php}} {{bin/typo3}} language:update');
});
desc('TYPO3 - Update database schema');
task('typo3:database:updateschema', function () {
cd('{{release_path}}');
run("{{bin/php}} {{bin/typo3}} database:updateschema '*.add,*.change'");
});
desc('TYPO3 - Update reference index');
task('typo3:referenceindex:update', function () {
cd('{{release_path}}');
run('{{bin/php}} {{bin/typo3}} referenceindex:update');
});
desc('TYPO3 - Correct permissions');
task('system:correct:permissions', function () {
run("find {{release_path}} -type d -not -path '{{release_path}}/vendor/bin*' -print0 | xargs -0 chmod 0755");
run("find {{release_path}} -type f -not -path '{{release_path}}/vendor/bin*' -print0 | xargs -0 chmod 0644");
});
/**
* Configure "deploy" task group.
*/
desc('Deploys a TYPO3 project');
before('deploy:symlink', function() {
invoke('system:correct:permissions');
invoke('typo3:install:fixfolderstructure');
invoke('typo3:extension:setup');
invoke('typo3:database:updateschema');
invoke('typo3:referenceindex:update');
invoke('typo3:language:update');
});
task('deploy', [
'deploy:info',
'deploy:setup',
'deploy:lock',
'deploy:release',
'rsync',
'deploy:shared',
'deploy:writable',
'deploy:vendors',
'deploy:symlink',
'deploy:unlock',
'deploy:cleanup',
'deploy:success',
]);
after('deploy:symlink', function() {
invoke('typo3:cache:flush');
invoke('typo3:cache:warmup');
});
after('deploy:failed', 'deploy:unlock');
Würde mich freuen, wenn jemand einen Rat hat oder mir erklären könnte, was für Einstellungen mir noch fehlen. 😊