/[drupal]/contributions/modules/provision/migrate.hostmaster.inc
ViewVC logotype

Contents of /contributions/modules/provision/migrate.hostmaster.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Thu Nov 5 16:59:47 2009 UTC (3 weeks, 2 days ago) by adrian
Branch: MAIN
Changes since 1.1: +7 -0 lines
File MIME type: text/x-php
Add a confirmation to the hostmaster migrate command and wipe out the crontab so that the dispatcher is no longer invoked
1 <?php
2
3 /**
4 * @file manual site migrate system
5 */
6
7 function drush_provision_hostmaster_migrate_validate($site, $platform) {
8 // verify the target platform:
9 $data = drush_get_merged_options(); // XXX: necessary because the remote
10 // platform may not have been
11 // initialised by the frontend (this
12 // should be checked instead)
13 $data['root'] = $platform;
14 $data['r'] = $platform;
15 drush_backend_invoke('provision verify', $data);
16 // verify the current platform
17 drush_backend_invoke('provision verify', array('root' => drush_get_option(array('r', 'root'), drush_locate_root())));
18 // verify the site prior to migration
19 drush_backend_invoke('provision verify', array($site));
20 }
21
22 function drush_provision_pre_hostmaster_migrate($site, $platform) {
23 if (!drush_confirm("This command will replace your crontab entry. continue?")) {
24 drush_set_error('PROVISION_CANCEL_MIGRATE', 'Cancelling');
25 }
26 // wipe out cron entry
27 exec('crontab -r');
28
29 // we can't rely on the park command to exist in pre-0.4 alpha 2 releases
30 drush_backend_invoke('hostmaster park', array($site, 'uri' => $site));
31 }
32
33 function drush_provision_hostmaster_migrate($site, $platform) {
34 drush_backend_invoke('provision clone', array($site, $site, $platform));
35 }
36
37 function drush_provision_hostmaster_migrate_rollback($site, $platform) {
38 drush_backend_invoke('provision delete ', array($site, 'root' => $platform));
39 }
40
41 function drush_provision_post_hostmaster_migrate($site, $platform) {
42 drush_backend_invoke('hostmaster unpark', array($site, 'uri' => $site, 'root' => $platform));
43 if (!drush_get_error()) {
44 drush_backend_invoke('provision delete', array($site));
45 drush_backend_invoke('provision verify', array($site, 'root' => $platform, 'publish_path' => $platform));
46 }
47 }

  ViewVC Help
Powered by ViewVC 1.1.2