Skip to content

Commit 5058268

Browse files
authored
Update README.md
1 parent 4fa38b5 commit 5058268

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

README.md

+46
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,51 @@ Example:
66

77
deploy.php
88
```
9+
<?php
10+
namespace Deployer;
11+
12+
require 'recipe/common.php';
913
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');
1056
```

0 commit comments

Comments
 (0)