Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
automatic_updates-3449631
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
automatic_updates-3449631
Commits
faa96332
Commit
faa96332
authored
3 years ago
by
Ted Bowman
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3228806
by tedbow: Exclude setting files from being copied to staging directory
parent
f274d875
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Updater.php
+14
-7
14 additions, 7 deletions
src/Updater.php
tests/src/Build/AttendedCoreUpdateTest.php
+1
-3
1 addition, 3 deletions
tests/src/Build/AttendedCoreUpdateTest.php
with
15 additions
and
10 deletions
src/Updater.php
+
14
−
7
View file @
faa96332
...
@@ -168,30 +168,37 @@ class Updater {
...
@@ -168,30 +168,37 @@ class Updater {
}
}
/**
/**
* Gets
directorie
s that should be excluded from the staging area.
* Gets
the path
s that should be excluded from the staging area.
*
*
* @return string[]
* @return string[]
* The
absolute paths of
director
ies
to exclude
from the staging area
.
* The
paths relative to the active
director
y
to exclude.
*/
*/
private
function
getExclusions
():
array
{
private
function
getExclusions
():
array
{
$
directorie
s
=
[];
$
exclusion
s
=
[];
$make_relative
=
function
(
$path
)
{
$make_relative
=
function
(
$path
)
{
return
str_replace
(
static
::
getActiveDirectory
()
.
'/'
,
''
,
$path
);
return
str_replace
(
static
::
getActiveDirectory
()
.
'/'
,
''
,
$path
);
};
};
if
(
$public
=
$this
->
fileSystem
->
realpath
(
'public://'
))
{
if
(
$public
=
$this
->
fileSystem
->
realpath
(
'public://'
))
{
$
directorie
s
[]
=
$make_relative
(
$public
);
$
exclusion
s
[]
=
$make_relative
(
$public
);
}
}
if
(
$private
=
$this
->
fileSystem
->
realpath
(
'private://'
))
{
if
(
$private
=
$this
->
fileSystem
->
realpath
(
'private://'
))
{
$
directorie
s
[]
=
$make_relative
(
$private
);
$
exclusion
s
[]
=
$make_relative
(
$private
);
}
}
/** @var \Drupal\Core\Extension\ModuleHandlerInterface $module_handler */
/** @var \Drupal\Core\Extension\ModuleHandlerInterface $module_handler */
$module_handler
=
\Drupal
::
service
(
'module_handler'
);
$module_handler
=
\Drupal
::
service
(
'module_handler'
);
$module_path
=
$this
->
fileSystem
->
realpath
(
$module_handler
->
getModule
(
'automatic_updates'
)
->
getPath
());
$module_path
=
$this
->
fileSystem
->
realpath
(
$module_handler
->
getModule
(
'automatic_updates'
)
->
getPath
());
if
(
is_dir
(
"
$module_path
/.git"
))
{
if
(
is_dir
(
"
$module_path
/.git"
))
{
// If the current module is git clone. Don't copy it.
// If the current module is git clone. Don't copy it.
$
directorie
s
[]
=
$make_relative
(
$module_path
);
$
exclusion
s
[]
=
$make_relative
(
$module_path
);
}
}
return
$directories
;
$settings_files
=
[
'settings.php'
,
'settings.local.php'
,
'services.yml'
];
foreach
(
$settings_files
as
$settings_file
)
{
$file_path
=
"sites/default/
$settings_file
"
;
if
(
file_exists
(
$file_path
))
{
$exclusions
[]
=
$make_relative
(
$this
->
fileSystem
->
realpath
(
"sites/default/
$settings_file
"
));
}
}
return
$exclusions
;
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
tests/src/Build/AttendedCoreUpdateTest.php
+
1
−
3
View file @
faa96332
...
@@ -123,9 +123,7 @@ class AttendedCoreUpdateTest extends AttendedUpdateTestBase {
...
@@ -123,9 +123,7 @@ class AttendedCoreUpdateTest extends AttendedUpdateTestBase {
$assert_session
->
pageTextContains
(
'Ready to update'
);
$assert_session
->
pageTextContains
(
'Ready to update'
);
$page
->
pressButton
(
'Continue'
);
$page
->
pressButton
(
'Continue'
);
$this
->
waitForBatchJob
();
$this
->
waitForBatchJob
();
// @todo This message isn't showing up, for some reason. Figure out what the
$assert_session
->
pageTextContains
(
'Update complete!'
);
// eff is going on.
// $assert_session->pageTextContains('Update complete!');
$this
->
assertCoreVersion
(
'9.8.1'
);
$this
->
assertCoreVersion
(
'9.8.1'
);
$placeholder
=
file_get_contents
(
$this
->
getWorkspaceDirectory
()
.
'/core/README.txt'
);
$placeholder
=
file_get_contents
(
$this
->
getWorkspaceDirectory
()
.
'/core/README.txt'
);
...
...
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