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
hosting_deploy
Commits
2cdc3518
Commit
2cdc3518
authored
Jun 08, 2020
by
Christopher Gervais
Browse files
Issue
#2960237
by drou7, ergonlogic: Adjust sync path when platform is built with Composer and Git.
parent
b34f9f12
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/platform_composer_git/drush/platform_composer_git.drush.inc
View file @
2cdc3518
...
...
@@ -71,3 +71,38 @@ function platform_composer_git_provision_services() {
platform_composer_git_register_autoload
();
return
array
(
'platform_composer_git'
=>
NULL
);
}
/**
* Implements hook_provision_platform_sync_path_alter().
*
* Changes the sync_path to ensure that composer-built platforms get all of the
* code moved to remote servers.
*
* @param $sync_path
*/
function
platform_composer_git_provision_platform_sync_path_alter
(
&
$sync_path
)
{
switch
(
d
()
->
type
)
{
case
'site'
:
$composer_git_path
=
d
()
->
platform
->
composer_git_path
;
break
;
case
'platform'
:
$composer_git_path
=
d
()
->
composer_git_path
;
break
;
default
:
return
;
}
if
(
!
empty
(
$composer_git_path
)
&&
!
file_exists
(
$composer_git_path
))
{
return
drush_set_error
(
'PROVISION_ERROR'
,
dt
(
"Platform path '!path' does not exist."
,
array
(
'!path'
=>
$composer_git_path
,
)));
}
if
(
$composer_git_path
==
d
()
->
root
)
{
// Nothing to do here.
return
;
}
$sync_path
=
$composer_git_path
;
drush_log
(
dt
(
'Adjusted sync path to match `@attribute`.'
,
[
'@attribute'
=>
'composer_git_path'
]),
'info'
);
}
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