-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.php
154 lines (129 loc) · 3.53 KB
/
deploy.php
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?php
namespace Deployer;
require 'recipe/typo3.php';
require 'contrib/rsync.php';
//** Config **
//$deployPath = '/home/www/p485699/html/t3-dep-ws';
$deployPath = '/var/www/vhosts/901046.jweiland-hosting.de/httpdocs/typo3cms/dworkshop3';
//$deployPath = 'typo3cms/dworkshop3';
//$deployPathProd = '/var/www/virtual/snowowl/serve';
$deployPathProd = '/var/www/vhosts/901046.jweiland-hosting.de/httpdocs/typo3cms/dworkshop3';
// Set TYPO3 Docroot/ Webroot
set('typo3_webroot', '/public');
set('keep_releases', 5);
// Set repository not needed for rsync deployments
//set('repository', '[email protected]:snowowl78/t3-deployment-workshop');
// rsync options
set('rsync', [
'exclude' =>[
'composer.json',
'composer.lock',
'.ddev',
'.editorconfig',
'.env',
'.git',
'.github',
'.idea',
'.gitignore',
'deploy.php',
'LICENSE',
'README.md',
'Workshop-Docs',
'/public/fileadmin',
'/public/typo3temp',
],
'exclude-file' => false,
'filter' => [],
'filter-file' => false,
'filter-perdir' => false,
'flags' => 'az',
'include' => [],
'include-file' => false,
'options' => ['info=progress2', 'delete-after'],
]);
set('rsync_src', __DIR__);
set('rsync_dest','{{release_path}}');
// Set up / extend options for shared/ writable
add('shared_files', [
'.env',
// '{{typo3_webroot}}/typo3conf/AdditionalConfiguration.php',
// '{{typo3_webroot}}/typo3conf/LocalConfiguration.php'
]);
add('shared_dirs', [
'{{typo3_webroot}}/fileadmin',
'{{typo3_webroot}}/typo3temp',
'/var/lock',
'/var/log',
]);
add('writable_dirs', []);
set('writable_mode', 'skip');
// ** Hosts **
// Staging
//using alias
host('stage')
->setLabels([
'stage' => 'Staging'
])
->set('stageDir', 'stage')
->setHostname(getenv('STAGING_SSH_HOST'))
->setDeployPath($deployPath . '/{{stageDir}}')
->setRemoteUser( getenv('STAGING_SSH_USER'))
->setPort(getenv('STAGING_SSH_PORT'))
->set('http_user', getenv('STAGING_SSH_USER'))
/*->set('deploy_path', '~/t3deployws')*/
;
/** demo task
*
* description first
* task definition
*/
desc('DEMO TASK showing writeln, run and get');
// then task
task('demo_task', function() {
writeln('run ls command:');
if (test("[ -d {{deploy_path}} ]")) {
writeln("found deploy path");
writeln("{{deploy_path}}");
}
run('cd {{deploy_path}} && ls -al');
writeln('show shared_files for stage = '. get('labels')['stage'] .':');
foreach(get('shared_files') as $file) {
writeln($file);
}
writeln('releasePath set to {{release_or_current_path}}' );
writeln('current + web Path set to "{{current_path}}" + "{{typo3_webroot}}"' );
});
desc('DEMO TASK showing writeln, run and get');
// then task
task('check_deploy_path', function() {
writeln('run ls command:');
if (test("[ -d {{deploy_path}} ]")) {
writeln("found deploy path");
writeln("{{deploy_path}}");
}
});
/**
* Rsync deployment task
* set description
* configure task
*/
desc('Prepare with Rsync deployment, without use of git and composer');
task('deploy:prepare', [
'deploy:info',
'check_deploy_path',
'deploy:setup',
'deploy:lock',
'deploy:release',
'rsync',
'deploy:shared',
// 'deploy:writable'
]);
desc('Deploy customized');
task('deploy', [
'deploy:prepare',
// 'deploy:vendors',
'deploy:publish'
]);
// Hooks
after('deploy:release', 'rsync:warmup');
after('deploy:failed', 'deploy:unlock');