Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
provision
Commits
2a884bd3
Commit
2a884bd3
authored
Oct 06, 2009
by
Adrian Rossouw
Committed by
adrian
Oct 06, 2009
Browse files
Add a hostmaster migrate command
parent
c9679850
Changes
2
Hide whitespace changes
Inline
Side-by-side
migrate.hostmaster.inc
0 → 100644
View file @
2a884bd3
<?php
/**
* @file manual site migrate system
*/
function
drush_provision_hostmaster_migrate_validate
(
$site
,
$platform
)
{
// verify the target platform:
$data
=
drush_get_merged_options
();
// XXX: necessary because the remote
// platform may not have been
// initialised by the frontend (this
// should be checked instead)
$data
[
'root'
]
=
$platform
;
$data
[
'r'
]
=
$platform
;
drush_backend_invoke
(
'provision verify'
,
$data
);
// verify the current platform
drush_backend_invoke
(
'provision verify'
,
array
(
'root'
=>
drush_get_option
(
array
(
'r'
,
'root'
),
drush_locate_root
())));
// verify the site prior to migration
drush_backend_invoke
(
'provision verify'
,
array
(
$site
));
}
function
drush_provision_pre_hostmaster_migrate
(
$site
,
$platform
)
{
drush_backend_invoke
(
'hostmaster park'
,
array
(
$site
,
'uri'
=>
$site
));
}
function
drush_provision_hostmaster_migrate
(
$site
,
$platform
)
{
drush_backend_invoke
(
'provision clone'
,
array
(
$site
,
$site
,
$platform
));
}
function
drush_provision_hostmaster_migrate_rollback
(
$site
,
$platform
)
{
drush_backend_invoke
(
'provision delete '
,
array
(
$site
,
'root'
=>
$platform
));
}
function
drush_provision_post_hostmaster_migrate
(
$site
,
$platform
)
{
drush_backend_invoke
(
'hostmaster unpark'
,
array
(
$site
,
'uri'
=>
$site
,
'root'
=>
$platform
));
if
(
!
drush_get_error
())
{
drush_backend_invoke
(
'provision delete'
,
array
(
$site
));
drush_backend_invoke
(
'provision verify'
,
array
(
$site
,
'root'
=>
$platform
,
'publish_path'
=>
$platform
));
}
}
provision.drush.inc
View file @
2a884bd3
...
...
@@ -121,6 +121,15 @@ function provision_drush_command() {
'bootstrap'
=>
DRUSH_BOOTSTRAP_DRUPAL_ROOT
);
$items
[
'hostmaster migrate'
]
=
array
(
'description'
=>
dt
(
'Migrate an instance of the Hostmaster front end to a new platform'
),
'bootstrap'
=>
DRUSH_BOOTSTRAP_DRUPAL_ROOT
,
'arguments'
=>
array
(
'example.com'
=>
dt
(
'The name of the site to migrate'
),
'/path/to/platform'
=>
dt
(
'The platform to migrate the site to.'
)
),
);
return
$items
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment