-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.php
More file actions
120 lines (107 loc) · 2.72 KB
/
deploy.php
File metadata and controls
120 lines (107 loc) · 2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php
namespace Deployer;
require 'recipe/common.php';
require 'contrib/rsync.php';
require 'contrib/cachetool.php';
// Project name
set('application', 'guestlist');
set('application_path', '~/html/application/{{application}}');
set('application_public', '~/html/application/{{application}}/data');
set('rsync', [
'exclude' => [
'/.ddev',
'/.github',
'/.git',
'/assets',
'/data',
'/ssh',
'/var',
'/.editorconfig',
'/.gitattributes',
'/.gitignore',
'/.env.local',
'/.php-cs-fixer.cache',
'/.php-cs-fixer.dist.php',
'/deploy.php',
'/deployer.phar',
'/internal_accounts',
'/README.md',
],
'exclude-file' => false,
'include' => [],
'include-file' => false,
'filter' => [],
'filter-file' => false,
'filter-perdir' => false,
'flags' => 'az',
'options' => ['delete', 'delete-after', 'force'],
'timeout' => 3600,
]);
set('shared_files', [
'.env.local'
]);
set('shared_dirs', [
'var/lock',
'var/log',
'public/uploads'
]);
set('bin/php', 'php_cli');
set(
'bin/console',
'{{bin/php}} {{release_or_current_path}}/bin/console'
);
// Hosts
host(getenv('SSH_HOST'))
->set('remote_user', getenv('SSH_USER'))
->set('keep_releases', '1')
->set('deploy_path', '{{application_path}}')
->set('rsync_src', __DIR__)
->set('rsync_dest','{{release_path}}')
->set('ssh_arguments', ['-o UserKnownHostsFile=/dev/null']);
// TYPO3 Tasks
task('symfony:migrate', function () { run("{{bin/console}} doctrine:migrations:migrate --no-interaction"); });
task('symfony:assets:install', function () { run("{{bin/console}} assets:install"); });
task('symfony:cache:clear', function () { run("{{bin/console}} cache:clear"); });
task('symfony:cache:warmup', function () { run("{{bin/console}} cache:warmup"); });
task('symfony', [
'symfony:migrate',
'symfony:assets:install',
'symfony:cache:clear',
'symfony:cache:warmup',
]);
// Task to only deploy code
task('deploy:data', [
'deploy:info',
'deploy:setup',
'deploy:lock',
'deploy:release',
'rsync',
'deploy:shared',
'deploy:writable',
'deploy:symlink',
'deploy:unlock',
'deploy:cleanup',
'deploy:success',
]);
// Main Task
task('deploy', [
'deploy:info',
'deploy:setup',
'deploy:lock',
'deploy:release',
'rsync',
'deploy:shared',
'deploy:writable',
'deploy:symlink',
// 'cachetool:clear:opcache',
// 'cachetool:clear:apcu',
'symfony',
'deploy:unlock',
'deploy:cleanup',
'deploy:success',
])->desc('Deploy your project');
// Unlock after failed
after(
'deploy:failed',
'deploy:unlock'
);