Skip to content
GitLab
About GitLab
GitLab: the DevOps platform
Explore GitLab
Install GitLab
How GitLab compares
Get started
GitLab docs
GitLab Learn
Pricing
Talk to an expert
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Projects
Groups
Snippets
Sign up now
Login
Sign in
Toggle navigation
Menu
Open sidebar
project
provision
Commits
b2b3e748
Commit
b2b3e748
authored
Dec 20, 2014
by
Grazyna Jaworska
Browse files
Use $new_name instead of $new_uri to avoid confusion.
parent
1cb848cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
platform/clone.provision.inc
View file @
b2b3e748
...
...
@@ -12,21 +12,21 @@
/**
* Make sure we have a valid site being cloned, and that the file being cloned from exists
*/
function
drush_provision_drupal_provision_clone_validate
(
$new_
uri
=
null
,
$platform
=
null
)
{
function
drush_provision_drupal_provision_clone_validate
(
$new_
name
=
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
(
$new_
uri
,
$platform
=
null
)
{
function
drush_provision_drupal_pre_provision_clone
(
$new_
name
,
$platform
=
null
)
{
drush_invoke
(
'provision-backup'
);
}
/**
* Remove the extracted site directory
*/
function
drush_provision_drupal_pre_provision_clone_rollback
(
$new_
uri
,
$platform
=
null
)
{
function
drush_provision_drupal_pre_provision_clone_rollback
(
$new_
name
,
$platform
=
null
)
{
$success
=
provision_file
()
->
unlink
(
drush_get_option
(
'backup_file'
))
->
succeed
(
'Removed unused clone site package'
)
->
fail
(
'Could not remove unused clone site package'
);
...
...
@@ -35,13 +35,13 @@ function drush_provision_drupal_pre_provision_clone_rollback($new_uri, $platform
/**
* Switch the clone directories around now that we have the new db installed
*/
function
drush_provision_drupal_provision_clone
(
$new_
uri
,
$platform
=
null
)
{
function
drush_provision_drupal_provision_clone
(
$new_
name
,
$platform
=
null
)
{
drush_set_option
(
'old_platform'
,
d
()
->
platform
->
name
);
$options
=
d
()
->
options
;
$options
[
'uri'
]
=
ltrim
(
$new_
uri
,
'@'
);
$options
[
'uri'
]
=
ltrim
(
$new_
name
,
'@'
);
$hash_name
=
drush_get_option
(
'#name'
)
?
'#name'
:
'name'
;
$options
[
$hash_name
]
=
$new_
uri
;
$options
[
$hash_name
]
=
$new_
name
;
$options
[
'platform'
]
=
(
isset
(
$platform
))
?
$platform
:
$options
[
'platform'
];
$options
[
'root'
]
=
d
(
$options
[
'platform'
])
->
root
;
$options
[
'aliases'
]
=
array
();
...
...
@@ -62,13 +62,13 @@ function drush_provision_drupal_provision_clone($new_uri, $platform = null) {
$options
[
'db_server'
]
=
$db_server
;
}
drush_invoke_process
(
'@none'
,
'provision-save'
,
array
(
$new_
uri
),
$options
);
drush_invoke_process
(
'@none'
,
'provision-save'
,
array
(
$new_
name
),
$options
);
# note that we reset the aliases so they don't conflict with the original site
provision_backend_invoke
(
$new_
uri
,
'provision-deploy'
,
array
(
drush_get_option
(
'backup_file'
)),
array
(
'old_uri'
=>
d
()
->
uri
));
provision_backend_invoke
(
$new_
name
,
'provision-deploy'
,
array
(
drush_get_option
(
'backup_file'
)),
array
(
'old_uri'
=>
d
()
->
uri
));
if
(
!
drush_get_error
())
{
provision_backend_invoke
(
$new_
uri
,
'provision-verify'
);
provision_backend_invoke
(
$new_
name
,
'provision-verify'
);
}
provision_reload_config
(
'site'
,
d
()
->
site_path
.
'/drushrc.php'
);
...
...
platform/migrate.provision.inc
View file @
b2b3e748
...
...
@@ -18,7 +18,7 @@ function drush_provision_drupal_provision_migrate_validate($platform = NULL) {
*
* Implementation of drush_hook_pre_COMMAND().
*/
function
drush_provision_drupal_pre_provision_migrate
(
$platform
,
$new_
uri
=
NULL
)
{
function
drush_provision_drupal_pre_provision_migrate
(
$platform
,
$new_
name
=
NULL
)
{
/* Set offline mode to true and re-generate the settings.php. This will write a
* $conf['site_offline'] = 1; to the settings.php
*/
...
...
@@ -31,8 +31,8 @@ function drush_provision_drupal_pre_provision_migrate($platform, $new_uri = NULL
drush_set_option
(
'old_platform'
,
d
()
->
platform
->
name
);
// If we are renaming the site, pick this up early.
if
(
!
is_null
(
$new_
uri
)
&&
(
$new_
uri
!=
d
()
->
name
))
{
drush_set_option
(
'target_name'
,
$new_
uri
);
if
(
!
is_null
(
$new_
name
)
&&
(
$new_
name
!=
d
()
->
name
))
{
drush_set_option
(
'target_name'
,
$new_
name
);
}
else
{
// the site url stays the same
...
...
@@ -53,7 +53,7 @@ function drush_provision_drupal_pre_provision_migrate($platform, $new_uri = NULL
*
* Implementation of drush_hook_pre_COMMAND_rollback().
*/
function
drush_provision_drupal_pre_provision_migrate_rollback
(
$platform
,
$new_
uri
=
NULL
)
{
function
drush_provision_drupal_pre_provision_migrate_rollback
(
$platform
,
$new_
name
=
NULL
)
{
// Set site_offline to false and regenerate the config
drush_log
(
dt
(
"Bringing site out of maintenance"
));
d
()
->
site_enabled
=
true
;
...
...
@@ -73,7 +73,7 @@ function drush_provision_drupal_pre_provision_migrate_rollback($platform, $new_u
*
* Implementation of drush_hook_COMMAND().
*/
function
drush_provision_drupal_provision_migrate
(
$platform
,
$new_
uri
=
NULL
)
{
function
drush_provision_drupal_provision_migrate
(
$platform
,
$new_
name
=
NULL
)
{
$target
=
drush_get_option
(
'target_name'
);
...
...
@@ -81,11 +81,11 @@ function drush_provision_drupal_provision_migrate($platform, $new_uri = NULL) {
$options
[
'uri'
]
=
d
()
->
uri
;
if
(
!
is_null
(
$new_
uri
)
&&
(
$new_
uri
!=
d
()
->
name
))
{
if
(
!
is_null
(
$new_
name
)
&&
(
$new_
name
!=
d
()
->
name
))
{
$options
=
d
()
->
options
;
$options
[
'uri'
]
=
ltrim
(
$new_
uri
,
'@'
);
$options
[
'uri'
]
=
ltrim
(
$new_
name
,
'@'
);
$hash_name
=
drush_get_option
(
'#name'
)
?
'#name'
:
'name'
;
$options
[
$hash_name
]
=
$new_
uri
;
$options
[
$hash_name
]
=
$new_
name
;
}
$options
[
'platform'
]
=
$platform
;
$options
[
'root'
]
=
d
(
$platform
)
->
root
;
...
...
@@ -124,7 +124,7 @@ function drush_provision_drupal_provision_migrate_rollback($platform) {
*
* Implementation of drush_hook_post_COMMAND().
*/
function
drush_provision_drupal_post_provision_migrate
(
$platform
,
$new_
uri
=
NULL
)
{
function
drush_provision_drupal_post_provision_migrate
(
$platform
,
$new_
name
=
NULL
)
{
drush_set_option
(
'installed'
,
FALSE
);
if
(
!
drush_get_option
(
'deploy_replace_site'
,
FALSE
))
{
...
...
@@ -137,7 +137,7 @@ function drush_provision_drupal_post_provision_migrate($platform, $new_uri = NUL
if
(
!
is_null
(
$new_
uri
)
&&
(
$new_
uri
!=
d
()
->
name
))
{
if
(
!
is_null
(
$new_
name
)
&&
(
$new_
name
!=
d
()
->
name
))
{
// remove the existing alias
$config
=
new
Provision_Config_Drushrc_Alias
(
d
()
->
name
);
$config
->
unlink
();
...
...
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