Skip to content

Commit

Permalink
[TASK] Add TYPO3 rsync recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
ochorocho committed Dec 17, 2023
1 parent 11cef74 commit 5e08f2d
Show file tree
Hide file tree
Showing 3 changed files with 304 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/recipe/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* [Sulu Recipe](/docs/recipe/sulu.md)
* [Symfony Recipe](/docs/recipe/symfony.md)
* [TYPO3 Recipe](/docs/recipe/typo3.md)
* [TYPO3-rsync Recipe](/docs/recipe/typo3-rsync.md)
* [WordPress Recipe](/docs/recipe/wordpress.md)
* [Yii2 Recipe](/docs/recipe/yii.md)
* [Zend Framework Recipe](/docs/recipe/zend_framework.md)
178 changes: 178 additions & 0 deletions docs/recipe/typo3-rsync.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
<!-- DO NOT EDIT THIS FILE! -->
<!-- Instead edit recipe/typo3-rsync.php -->
<!-- Then run bin/docgen -->

# Typo3-rsync Recipe

```php
require 'recipe/typo3-rsync.php';
```

[Source](/recipe/typo3-rsync.php)

* Requires
* [common](/docs/recipe/common.md)
* [rsync](/docs/recipe/../contrib/rsync.md)

## Configuration
### typo3_webroot
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3-rsync.php#L12)

DocumentRoot / WebRoot for the TYPO3 installation

```php title="Default value"
'public'
```


### bin/typo3
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3-rsync.php#L17)

Path to TYPO3 cli

```php title="Default value"
'vendor/bin/typo3'
```


### shared_dirs
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3-rsync.php#L22)

Overrides [shared_dirs](/docs/recipe/deploy/shared.md#shared_dirs) from `recipe/deploy/shared.php`.

Shared directories

```php title="Default value"
[
'{{typo3_webroot}}/fileadmin',
'{{typo3_webroot}}/typo3temp',
'{{typo3_webroot}}/uploads'
]
```


### shared_files
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3-rsync.php#L31)

Overrides [shared_files](/docs/recipe/deploy/shared.md#shared_files) from `recipe/deploy/shared.php`.

Shared files

```php title="Default value"
[
'{{typo3_webroot}}/.htaccess',
'config/system/settings.php',
]
```


### writable_dirs
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3-rsync.php#L39)

Overrides [writable_dirs](/docs/recipe/deploy/writable.md#writable_dirs) from `recipe/deploy/writable.php`.

Writeable directories

```php title="Default value"
[
'{{typo3_webroot}}/fileadmin',
'var',
]
```


### rsync
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3-rsync.php#L65)



```php title="Default value"
[
'exclude' => array_merge(get('shared_dirs'), get('shared_files'), $exclude),
'exclude-file' => false,
'include' => ['vendor'],
'include-file' => false,
'filter' => ['dir-merge,-n /.gitignore'],
'filter-file' => false,
'filter-perdir' => false,
'flags' => 'avz',
'options' => ['delete', 'keep-dirlinks', 'links'],
'timeout' => 600
]
```



## Tasks

### typo3:cache:warmup
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3-rsync.php#L79)

TYPO3 - Cache warmup for all caches.




### typo3:cache:flush
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3-rsync.php#L85)

TYPO3 - Cache clearing for all caches.




### typo3:language:update
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3-rsync.php#L91)

TYPO3 - Update the language files of all activated extensions.




### typo3:extension:setup
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3-rsync.php#L97)

TYPO3 - Set up extensions.




### deploy:update_code
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3-rsync.php#L105)



Configure "deploy" task group.


### deploy:info
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3-rsync.php#L106)






### deploy
[Source](https://github.com/deployphp/deployer/blob/master/recipe/typo3-rsync.php#L109)

Deploys a TYPO3 project.




This task is group task which contains next tasks:
* [deploy:setup](/docs/recipe/deploy/setup.md#deploysetup)
* [deploy:lock](/docs/recipe/deploy/lock.md#deploylock)
* [deploy:release](/docs/recipe/deploy/release.md#deployrelease)
* [rsync](/docs/contrib/rsync.md#rsync)
* [deploy:shared](/docs/recipe/deploy/shared.md#deployshared)
* [deploy:writable](/docs/recipe/deploy/writable.md#deploywritable)
* [deploy:symlink](/docs/recipe/deploy/symlink.md#deploysymlink)
* [typo3:extension:setup](/docs/recipe/typo3-rsync.md#typo3extensionsetup)
* [typo3:cache:flush](/docs/recipe/typo3-rsync.md#typo3cacheflush)
* [typo3:language:update](/docs/recipe/typo3-rsync.md#typo3languageupdate)
* [deploy:unlock](/docs/recipe/deploy/lock.md#deployunlock)
* [deploy:cleanup](/docs/recipe/deploy/cleanup.md#deploycleanup)


125 changes: 125 additions & 0 deletions recipe/typo3-rsync.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<?php
namespace Deployer;

require_once __DIR__ . '/common.php';
require_once __DIR__ . '/../contrib/rsync.php';

add('recipes', ['typo3_rsync']);

/**
* DocumentRoot / WebRoot for the TYPO3 installation
*/
set('typo3_webroot', 'public');

/**
* Path to TYPO3 cli
*/
set('bin/typo3', 'vendor/bin/typo3');

/**
* Shared directories
*/
set('shared_dirs', [
'{{typo3_webroot}}/fileadmin',
'{{typo3_webroot}}/typo3temp',
'{{typo3_webroot}}/uploads'
]);

/**
* Shared files
*/
set('shared_files', [
'{{typo3_webroot}}/.htaccess',
'config/system/settings.php',
]);

/**
* Writeable directories
*/
set('writable_dirs', [
'{{typo3_webroot}}/fileadmin',
'var',
]);

$exclude = [
'.Build',
'.git',
'.gitlab',
'.ddev',
'.deployer',
'.idea',
'.DS_Store',
'.gitlab-ci.yml',
'.npm',
'deploy.yaml',
'package.json',
'package-lock.json',
'node_modules/',
'var/',
'public/fileadmin/',
'public/typo3temp/',
'config/system/additional.php',
'config/system/settings.php',
];

set('rsync', [
'exclude' => array_merge(get('shared_dirs'), get('shared_files'), $exclude),
'exclude-file' => false,
'include' => ['vendor'],
'include-file' => false,
'filter' => ['dir-merge,-n /.gitignore'],
'filter-file' => false,
'filter-perdir' => false,
'flags' => 'avz',
'options' => ['delete', 'keep-dirlinks', 'links'],
'timeout' => 600
]);

desc('TYPO3 - Cache warmup for all caches');
task('typo3:cache:warmup', function () {
cd('{{release_path}}');
run('{{bin/php}} {{bin/typo3}} cache:warmup');
});

desc('TYPO3 - Cache clearing for all caches');
task('typo3:cache:flush', function () {
cd('{{release_path}}');
run('{{bin/php}} {{bin/typo3}} cache:flush');
});

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 - Set up extensions');
task('typo3:extension:setup', function () {
cd('{{release_path}}');
run('{{bin/php}} {{bin/typo3}} extension:setup');
});

/**
* Configure "deploy" task group.
*/
task('deploy:update_code')->hidden()->disable();
task('deploy:info')->hidden()->disable();

desc('Deploys a TYPO3 project');
task('deploy', [
'deploy:setup',
'deploy:lock',
'deploy:release',
'rsync',
'deploy:shared',
'deploy:writable',
'deploy:symlink',
'typo3:extension:setup',
'typo3:cache:flush',
'typo3:language:update',
'deploy:unlock',
'deploy:cleanup',
'deploy:success'
]);

after('deploy:failed', 'deploy:unlock');

0 comments on commit 5e08f2d

Please sign in to comment.