Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
P
provision
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
provision
Commits
91f0154d
Commit
91f0154d
authored
Sep 07, 2009
by
mig5
Committed by
mig5
Sep 07, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#448692
by yrocq et al - site clone support
parent
6493b93d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
0 deletions
+63
-0
db_server/clone.provision.inc
db_server/clone.provision.inc
+7
-0
platform/clone.provision.inc
platform/clone.provision.inc
+48
-0
provision.drush.inc
provision.drush.inc
+8
-0
No files found.
db_server/clone.provision.inc
0 → 100644
View file @
91f0154d
<?php
// $Id$
function
drush_provision_mysql_provision_clone_validate
()
{
provision_db_connect
();
}
platform/clone.provision.inc
0 → 100644
View file @
91f0154d
<?php
/**
* Restore command implementation
*
* This command when called will
* 1. Make a backup of the current site, before modifications are made.
* 2. Extract the backup that is being cloned to to a temporary folder in the sites directory.
* 3. Create a new database, belonging to the site's user, and switch it around with the current site's database.
* 4. Import the old database and site.php details.
* 5. Regenerate configuration files.
* 6. TODO: diagnostic to test that everything is ok?
* 7. Restart apache so the previous site is available again.
*
* If at any time an error occurs, before step 9. It should reverse all the changes it has made,
* and leave the current site directory and database in the right place, and remove all cruft that
* was created by this process.
*/
/**
* Make sure we have a valid site being cloned, and that the file being cloned from exists
*/
function
drush_provision_drupal_provision_clone_validate
(
$url
=
null
,
$new_url
=
null
,
$platform
=
null
)
{
drush_bootstrap
(
DRUSH_BOOTSTRAP_DRUPAL_SITE
);
}
/**
* Make a backup before making any changes, and add extract the file we are restoring from
*/
function
drush_provision_drupal_pre_provision_clone
(
$url
,
$new_url
,
$platform
=
null
)
{
drush_invoke
(
'provision backup'
,
$url
);
}
/**
* Remove the extracted site directory
*/
function
drush_provision_drupal_pre_provision_clone_rollback
(
$url
,
$new_url
,
$platform
=
null
)
{
$success
=
provision_path
(
"unlink"
,
drush_get_option
(
'backup_file'
),
TRUE
,
dt
(
'Removed unused clone site package'
),
dt
(
'Could not remove unused clone site package'
));
}
/**
* Switch the clone directories around now that we have the new db installed
*/
function
drush_provision_drupal_provision_clone
(
$url
,
$new_url
,
$platform
=
null
)
{
drush_backend_invoke
(
'provision deploy'
,
array
(
$new_url
,
drush_get_option
(
'backup_file'
),
'root'
=>
$platform
,
'web_host'
=>
drush_get_option
(
'web_host'
),
'web_ip'
=>
drush_get_option
(
'web_ip'
),
'db_host'
=>
drush_get_option
(
'db_host'
)));
}
provision.drush.inc
View file @
91f0154d
...
...
@@ -107,6 +107,14 @@ function provision_drush_command() {
'/path/to/platform'
=>
dt
(
'The platform to migrate the site to.'
)),
'bootstrap'
=>
DRUSH_BOOTSTRAP_DRUPAL_ROOT
);
$items
[
'provision clone'
]
=
array
(
'description'
=>
'Clone a site between platforms.'
,
'arguments'
=>
array
(
'domain.com'
=>
dt
(
'The domain to clone. Any outstanding updates will be run.'
),
'new.domain.com'
=>
dt
(
'The new domain name to use.'
),
'/path/to/platform'
=>
dt
(
'The platform to clone the site to.'
)),
'bootstrap'
=>
DRUSH_BOOTSTRAP_DRUPAL_ROOT
);
$items
[
'provision delete'
]
=
array
(
'description'
=>
'Delete a site.'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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