deploy.php 1.73 KB
Newer Older
1
2
3
4
5
6
<?php

namespace Deployer;

require_once '/composer/vendor/deployer/deployer/recipe/common.php';
require_once '/composer/vendor/deployer/recipes/rsync.php';
Thomas Löffler's avatar
Thomas Löffler committed
7
require_once '/composer/vendor/deployer/recipes/cachetool.php';
8
9

$sharedDirectories = [
10
11
12
    'html/fileadmin',
    'html/uploads',
    'html/.well-known'
13
14
15
16
];
set('shared_dirs', $sharedDirectories);

$sharedFiles = [
17
    'html/typo3conf/AdditionalConfiguration.php',
18
19
20
21
];
set('shared_files', $sharedFiles);

$writeableDirectories = [
22
23
24
    'html/typo3temp',
    'html/fileadmin',
    'html/uploads'
25
26
27
28
29
];
set('writable_dirs', $writeableDirectories);

$exclude = [
    '.gitignore',
30
    '.htaccess',
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
    '.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,
    'flags' => 'az',
    'options' => ['delete'],
    'timeout' => 300
]);
52
set('rsync_src', './');
53
set('keep_releases', 10);
Thomas Löffler's avatar
Thomas Löffler committed
54
inventory('./.gitlab-ci/deployer/servers.yml');
55

56
task('typo3', function() {
57
    run('cd {{release_path}} && /opt/php/php70/bin/php bin/typo3cms install:extensionsetupifpossible');
58
59
});

Thomas Löffler's avatar
Thomas Löffler committed
60
61
62
63
64
65
host('production')->set('cachetool', '/var/run/php7-fpm-extensions.sock');
host('stage')->set('cachetool', '/var/run/php7-fpm-extensionsstage.sock');
task('opcache', function() {

});

66
67
68
69
70
71
72
73
task('deploy', [
    'deploy:prepare',
    'deploy:release',
    'rsync:warmup',
    'rsync',
    'deploy:shared',
    'deploy:writable',
    'deploy:symlink',
Thomas Löffler's avatar
Thomas Löffler committed
74
    'cachetool:clear:opcache',
75
76
    'cleanup',
    'typo3'
77
]);