Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
provision
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
provision
Commits
b5851a3b
Commit
b5851a3b
authored
Nov 10, 2016
by
Jon Pugh
Committed by
GitHub
Nov 10, 2016
Browse files
Options
Downloads
Plain Diff
Merge pull request
#10
from aegir-project/2826388-check-hostmaster
Issue
#2826388
check hostmaster using root and uri comparison.
parents
428bf48f
07e9a918
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
platform/migrate.provision.inc
+3
-3
3 additions, 3 deletions
platform/migrate.provision.inc
provision.inc
+11
-0
11 additions, 0 deletions
provision.inc
with
14 additions
and
3 deletions
platform/migrate.provision.inc
+
3
−
3
View file @
b5851a3b
...
@@ -80,7 +80,7 @@ function drush_provision_drupal_provision_migrate($platform, $new_name = NULL) {
...
@@ -80,7 +80,7 @@ function drush_provision_drupal_provision_migrate($platform, $new_name = NULL) {
// If the site is migrated between platforms and not just renamed,
// If the site is migrated between platforms and not just renamed,
// we should update the info collected about source and target platform first.
// we should update the info collected about source and target platform first.
// Note that we have to exclude Hostmaster platform from this extra verify.
// Note that we have to exclude Hostmaster platform from this extra verify.
if
(
d
()
->
profile
!=
'
hostmaster
'
)
{
if
(
!
provision_is_
hostmaster
_site
()
)
{
if
(
!
is_null
(
d
(
$platform
)
->
name
)
&&
(
d
(
$platform
)
->
name
!=
d
()
->
platform
->
name
))
{
if
(
!
is_null
(
d
(
$platform
)
->
name
)
&&
(
d
(
$platform
)
->
name
!=
d
()
->
platform
->
name
))
{
provision_backend_invoke
(
'@hostmaster'
,
'hosting-task'
,
array
(
d
()
->
platform
->
name
,
'verify'
),
array
(
'force'
=>
TRUE
));
provision_backend_invoke
(
'@hostmaster'
,
'hosting-task'
,
array
(
d
()
->
platform
->
name
,
'verify'
),
array
(
'force'
=>
TRUE
));
sleep
(
5
);
// A small trick to avoid high load and race conditions.
sleep
(
5
);
// A small trick to avoid high load and race conditions.
...
@@ -136,7 +136,7 @@ function drush_provision_drupal_provision_migrate($platform, $new_name = NULL) {
...
@@ -136,7 +136,7 @@ function drush_provision_drupal_provision_migrate($platform, $new_name = NULL) {
}
}
else
{
else
{
// We have to exclude Hostmaster site from any extra verify steps.
// We have to exclude Hostmaster site from any extra verify steps.
if
(
d
()
->
profile
!=
'
hostmaster
'
)
{
if
(
!
provision_is_
hostmaster
_site
()
)
{
// We should update also the info collected about the site before running migrate task.
// We should update also the info collected about the site before running migrate task.
// Doing this is safe only when the site is migrated with the same name - see issue #1067702.
// Doing this is safe only when the site is migrated with the same name - see issue #1067702.
$local_uri_verify
=
'@'
.
d
()
->
uri
;
$local_uri_verify
=
'@'
.
d
()
->
uri
;
...
@@ -219,7 +219,7 @@ function drush_provision_drupal_post_provision_migrate($platform, $new_name = NU
...
@@ -219,7 +219,7 @@ function drush_provision_drupal_post_provision_migrate($platform, $new_name = NU
$rename_only
=
drush_get_option
(
'rename_only'
);
$rename_only
=
drush_get_option
(
'rename_only'
);
if
(
$rename_only
)
{
if
(
$rename_only
)
{
// We run this extra tricky backend verify to avoid issue #1004526.
// We run this extra tricky backend verify to avoid issue #1004526.
if
(
d
()
->
profile
!=
'
hostmaster
'
)
{
if
(
!
provision_is_
hostmaster
_site
()
)
{
$deploy_replace_site
=
drush_get_option
(
'deploy_replace_site'
);
$deploy_replace_site
=
drush_get_option
(
'deploy_replace_site'
);
$final_aliases
=
drush_get_option
(
'aliases'
);
$final_aliases
=
drush_get_option
(
'aliases'
);
provision_reload_config
(
'site'
,
drush_get_option
(
'new_site_path'
,
d
(
$new_name
)
->
site_path
)
.
'/drushrc.php'
);
provision_reload_config
(
'site'
,
drush_get_option
(
'new_site_path'
,
d
(
$new_name
)
->
site_path
)
.
'/drushrc.php'
);
...
...
This diff is collapsed.
Click to expand it.
provision.inc
+
11
−
0
View file @
b5851a3b
...
@@ -131,6 +131,17 @@ function provision_is_local_host($host) {
...
@@ -131,6 +131,17 @@ function provision_is_local_host($host) {
(
$host
==
provision_fqdn
());
(
$host
==
provision_fqdn
());
}
}
/**
* Determine if the currently acting context is the server's hostmaster site.
*
* @return
* Boolean TRUE if the current drush context is "@hostmaster".
*/
function
provision_is_hostmaster_site
()
{
// If the current root and URI matches "@hostmaster" root and URI, this is hostmaster.
return
d
()
->
root
==
d
(
'@hostmaster'
)
->
root
&&
d
()
->
uri
==
d
(
'@hostmaster'
)
->
uri
;
}
/**
/**
* return the FQDN of the machine or provided host
* return the FQDN of the machine or provided host
*
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment