-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdrupal10.deploy.php
91 lines (76 loc) · 1.9 KB
/
drupal10.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
<?php
namespace Deployer;
require 'recipe/drupal8.php';
// [Optional] Allocate tty for git clone. Default value is false.
set('git_tty', false);
//Drupal 8 shared dirs
set('shared_dirs', [
'web/sites/{{drupal_site}}/files',
'private',
]);
//Drupal 8 shared files
set('shared_files', [
'web/sites/{{drupal_site}}/settings.php',
'web/sites/{{drupal_site}}/services.yml',
'.env',
]);
//Drupal 8 Writable dirs
set('writable_dirs', [
'web/sites/{{drupal_site}}/files',
]);
set('writable_mode', 'chmod');
set('clear_paths', [
'README.md',
'COPYRIGHT.md',
'deploy.php',
'.editorconfig',
'phpunit.xml.dist',
'export',
'.gitattributes',
'.gitignore',
'phpunit.xml.dist',
'.env.example',
'.lando.yml',
'web/sites/development.services.yml',
'web/sites/sites.local.php',
'web/sites/{{drupal_site}}/settings.local.php',
]);
task('deploy:update_code', function () {
run('git clone {{repository}} --depth=1 -b {{branch}} {{release_path}} && rm -rf {{release_path}}/.git');
});
set('bin/drush', function () {
return '{{bin/php}} {{release_path}}/vendor/bin/drush';
});
task('deploy:vendors', function () {
run('cd {{release_path}} && {{bin/composer}} install');
});
task('drupal:config:import', function () {
run('cd {{release_path}} && {{bin/drush}} cim -y');
});
task('drupal:cache:rebuild', function () {
run('cd {{release_path}} && {{bin/drush}} cr');
});
/**
* We replace the default release_name with a date based.
*/
set('release_name', function () {
return date('Y-m-d-H-i-s');
});
task('deploy', [
'deploy:setup',
'deploy:info',
'deploy:lock',
'deploy:release',
'deploy:update_code',
'deploy:vendors',
'deploy:shared',
'deploy:writable',
'deploy:clear_paths',
'deploy:symlink',
'drupal:config:import',
'drupal:cache:rebuild',
'deploy:unlock',
'deploy:cleanup'
]);
// [Optional] if deploy fails automatically unlock.
after('deploy:failed', 'deploy:unlock');