@@ -6,5 +6,51 @@ Example:
6
6
7
7
deploy.php
8
8
```
9
+ <?php
10
+ namespace Deployer;
11
+
12
+ require 'recipe/common.php';
9
13
require 'contrib/telegram.php';
14
+
15
+ set('telegram_token', getenv('TELEGRAM_TOKEN'));
16
+ set('telegram_chat_id', getenv('TELEGRAM_CHAT_ID'));
17
+
18
+ // Project name
19
+ set('application', 'promo');
20
+
21
+ // Project repository
22
+ set('repository', 'ssh://[email protected] /group/repo.git');
23
+
24
+ // [Optional] Allocate tty for git clone. Default value is false.
25
+ set('git_tty', true);
26
+
27
+ // Shared files/dirs between deploys
28
+ set('shared_files', ['data/config.inc.php']);
29
+ set('shared_dirs', ['www/files']);
30
+
31
+ // Writable dirs by web server
32
+ set('writable_dirs', ['data/tpl_cache', 'data/templates_c', 'www/files']);
33
+ set('allow_anonymous_stats', false);
34
+
35
+ // Hosts
36
+
37
+ host('domain.com')
38
+ ->set('remote_user', 'promo')
39
+ ->set('hostname', 'domain.com')
40
+ ->set('labels', ['stage' => 'production'])
41
+ ->set('deploy_path', '~/{{application}}');
42
+
43
+ // Tasks
44
+
45
+ desc('Deploy your project');
46
+ task('deploy', [
47
+ 'deploy:prepare',
48
+ 'deploy:publish',
49
+ ]);
50
+
51
+ // [Optional] If deploy fails automatically unlock.
52
+ after('deploy:failed', 'deploy:unlock');
53
+ after('deploy:failed', 'telegram:notify:failure');
54
+
55
+ after('deploy:success', 'telegram:notify:success');
10
56
```
0 commit comments