forked from dingproject/ding-deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
drakefile.php
168 lines (151 loc) · 4.01 KB
/
drakefile.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
155
156
157
158
159
160
161
162
163
164
165
166
167
<?php
/**
* @file
* Drakefile for Kolding Bibliotek. Requires drake_reload.
*
* Custom modifications should go at the end of the file to be retained by
* drake-rebuild-generate.
*
* You can override standard tasks by simply moving them below the marker line
* (search for "retained" to find it) and modifying them.
*/
$api = 1;
/*
* Drake Reload settings. This allows us to re-run drg.
*/
$drake_reload = array(
'core' => '6.x',
'site_name' => 'Kolding Bibliotek',
'type' => 'ding',
'ding_url' => '[email protected]:kbib/ding-deploy.git',
'envs' => array(
'prod' => array(
'alias' => '@r.kolding.prod',
'name' => 'Prod',
),
'test' => array(
'alias' => '@r.kolding.test',
'name' => 'Test',
),
),
);
/*
* Global context.
*/
$context = array(
// Drupal core version.
'core' => '6.x',
// Prod site alias.
'@env.prod' => '@r.kolding.prod',
// Test site alias.
'@env.test' => '@r.kolding.test',
// ding_deploy repository.
'repository' => '[email protected]:kbib/ding-deploy.git',
);
/*
* Build site via ding_deploy.
*/
$tasks['build'] = array(
'depends' => array('reload-ding-build'),
'help' => 'Build site from a ding_deploy repo.',
'context' => array(
'root' => drake_argument(1, 'Directory to build to.'),
'repo' => context('repository'),
),
);
/*
* Rebuild site via ding_deploy.
*/
$tasks['rebuild'] = array(
'depends' => array('reload-ding-rebuild'),
'help' => 'Rebuild the current site.',
'context' => array(
'root' => context('@self:site:root'),
'repo' => context('repository'),
),
);
/*
* Import database from "Prod".
*/
$tasks['import-prod'] = array(
'depends' => array('reload-import-site'),
'help' => 'Import database form "Prod".',
'context' => array(
'@sync_source' => context('@env.prod'),
'@sync_target' => drake_argument('1', "Target alias."),
),
);
/*
* Import database from "Test".
*/
$tasks['import-test'] = array(
'depends' => array('reload-import-site'),
'help' => 'Import database form "Test".',
'context' => array(
'@sync_source' => context('@env.test'),
'@sync_target' => drake_argument('1', "Target alias."),
),
);
/*
* Import database from a file.
*/
$tasks['import-sql'] = array(
'depends' => array('reload-import-file'),
'help' => 'Import database form SQL dump.',
'context' => array(
'@sync_target' => drake_argument('1', "Target alias."),
'file' => drake_argument('2', 'SQL file to load.'),
),
);
/*
* Defines some way of loading an existing database from somewhere. It is
* invoked by reload-import-site.
*
* This is just a normal task, but it is recommended that it's implemented by
* depending on a reload helper task such as reload-sync-db or reload-import-db.
*/
$tasks['import-db'] = array(
'depends' => array('reload-sync-db', 'sanitize'),
);
/*
* Load a database from a SQL dump.
*/
$tasks['import-file'] = array(
'depends' => array('reload-load-db', 'sanitize'),
);
/*
* Custom sanitation function. Invoked by our own import-db.
*/
$tasks['sanitize'] = array(
'depends' => array('reload-ding-fix-error-level', 'sanitize-drush', 'reload-fix-mobile-tools'),
'help' => 'Sanitizes database post-import.',
);
/*
* Runs misc sanitation drush commands.
*/
$tasks['sanitize-drush'] = array(
'action' => 'drush',
'commands' => array(
// Disable trampoline first thing, or else it'll kill everything later on.
// Same for memcache_admin.
array(
'command' => 'pm-disable',
'args' => array('trampoline', 'memcache_admin', 'securepages', 'y' => TRUE),
),
// Set site name to "Kolding Bibliotek [hostname]"
array(
'command' => 'vset',
'args' => array('site_name', 'Kolding Bibliotek ' . php_uname('n')),
),
),
);
/*
* Regenerate drakefile.
*/
$tasks['redrake'] = array(
'action' => 'drush',
'help' => 'Regenerate the drakefile using drake-reload-generate',
'command' => 'drake-reload-generate',
'args' => array(__FILE__, 'y' => TRUE),
);
// ### Everything below this will be retained by drush-reload-generate ###