deploy.php 1.81 KB
Newer Older
Sascha Marcel Schmidt's avatar
Sascha Marcel Schmidt committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php

namespace Deployer;

require_once '/composer/vendor/deployer/deployer/recipe/common.php';
require_once '/composer/vendor/deployer/recipes/rsync.php';

$sharedDirectories = [
    'html/fileadmin',
    'html/uploads',
    'html/.well-known'
];
set('shared_dirs', $sharedDirectories);

$sharedFiles = [
16
    'html/typo3conf/AdditionalConfiguration.php',
Sascha Marcel Schmidt's avatar
Sascha Marcel Schmidt committed
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
];
set('shared_files', $sharedFiles);

$writeableDirectories = [
    'html/typo3temp',
    'html/fileadmin',
    'html/uploads'
];
set('writable_dirs', $writeableDirectories);

$exclude = [
    '.gitignore',
    '.htaccess',
    '.git',
    'Readme.rst',
    'Readme.txt',
    'Upgrading.rst',
    'Upgrading.txt',
    'README',
    '*.example',
    'AdditionalConfiguration.sample.php'
];
set('rsync', [
    'exclude' => array_merge($sharedDirectories, $sharedFiles, $exclude),
    'exclude-file' => false,
    'include' => [],
    'include-file' => false,
    'filter' => [],
    'filter-file' => false,
    'filter-perdir' => false,
47
    'flags' => 'avz',
Sascha Marcel Schmidt's avatar
Sascha Marcel Schmidt committed
48
49
50
    'options' => ['delete'],
    'timeout' => 300
]);
Sascha Marcel Schmidt's avatar
Sascha Marcel Schmidt committed
51
set('rsync_src', './');
Sascha Marcel Schmidt's avatar
Sascha Marcel Schmidt committed
52
set('keep_releases', 10);
53
serverList('.gitlab-ci/deployer/servers.yml');
Sascha Marcel Schmidt's avatar
Sascha Marcel Schmidt committed
54

55
task('typo3', function () {
56
    run('cd {{release_path}} && /opt/php/php70/bin/php bin/typo3cms install:generatepackagestates 0 1');
57
58
59
60
61
62
    run('cd {{release_path}} && /opt/php/php70/bin/php bin/typo3cms database:updateschema');
    run('cd {{release_path}} && /opt/php/php70/bin/php bin/typo3cms language:update');
    run('cd {{release_path}} && /opt/php/php70/bin/php bin/typo3cms install:fixfolderstructure');
    run('cd {{release_path}} && /opt/php/php70/bin/php bin/typo3cms cache:flush');
});

63

Sascha Marcel Schmidt's avatar
Sascha Marcel Schmidt committed
64
65
66
67
68
69
70
71
task('deploy', [
    'deploy:prepare',
    'deploy:release',
    'rsync:warmup',
    'rsync',
    'deploy:shared',
    'deploy:writable',
    'deploy:symlink',
72
    'cleanup',
73
    'typo3'
Sascha Marcel Schmidt's avatar
Sascha Marcel Schmidt committed
74
]);