forked from benjaminkott/bootstrap_package
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.php
More file actions
90 lines (80 loc) · 2.48 KB
/
Copy pathdeploy.php
File metadata and controls
90 lines (80 loc) · 2.48 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
<?php
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace Deployer;
require 'recipe/common.php';
// TYPO3
desc('Prepare Bootstrap Package');
task('typo3:prepare', function () {
run('rm -rf {{release_path}}/../tmp');
run('mkdir -p {{release_path}}/../tmp/extensions/bootstrap_package');
run('mv {{release_path}}/{,.[^.]}* {{release_path}}/../tmp/extensions/bootstrap_package');
run('mkdir -p {{release_path}}/extensions');
run('mv {{release_path}}/../tmp/extensions {{release_path}}');
run('rm -rf {{release_path}}/../tmp');
});
desc('Finish TYPO3 Deployment');
task('typo3:finish', function () {
run('cd {{release_path}} && {{bin/php}} ./bin/typo3cms install:fixfolderstructure');
run('cd {{release_path}} && {{bin/php}} ./bin/typo3cms database:updateschema');
run('cd {{release_path}} && {{bin/php}} ./bin/typo3cms language:update');
run('cd {{release_path}} && {{bin/php}} ./bin/typo3cms cache:flush');
});
// Main
task('deploy', [
'deploy:info',
'deploy:prepare',
'deploy:lock',
'deploy:release',
'deploy:update_code',
'typo3:prepare',
'deploy:shared',
'deploy:vendors',
'deploy:symlink',
'typo3:finish',
'deploy:unlock',
'cleanup',
])->desc('Deploy your project');
after('deploy', 'success');
// If deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');
// Shared Directories and Files
set('shared_dirs', [
'config',
'web/fileadmin',
'web/typo3temp',
'web/uploads'
]);
set('shared_files', [
'composer.json',
'web/.htaccess',
'web/typo3conf/AdditionalConfiguration.php',
'web/typo3conf/LocalConfiguration.php',
'web/typo3conf/PackageStates.php'
]);
// Set Writeable files
set('writable_dirs', [
'config',
'web/fileadmin',
'web/typo3temp',
'web/typo3conf',
'web/uploads'
]);
// Misc
set('allow_anonymous_stats', false);
// Hosts
host(getenv('DEPLOYER_HOST'))
->set('repository', 'https://github.com/benjaminkott/bootstrap_package')
->user(getenv('DEPLOYER_USER'))
->port('22')
->set('keep_releases', '3')
->set('bin/php', getenv('DEPLOYER_PHP'))
->set('deploy_path', '~/html/{{application}}')
->set('application', getenv('DEPLOYER_APPLICATION'))
->set('ssh_type', 'native')
->set('http_user', getenv('DEPLOYER_USER'))
->set('bin/composer', getenv('DEPLOYER_COMPOSER'));