Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
docker
osticket
Commits
35db37d4
Commit
35db37d4
authored
9 years ago
by
Jared Hancock
Browse files
Options
Downloads
Patches
Plain Diff
cli: deploy: Don't remove the .MANIFEST or ost-config.php files
parent
93402825
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/cli/modules/deploy.php
+12
-9
12 additions, 9 deletions
include/cli/modules/deploy.php
with
12 additions
and
9 deletions
include/cli/modules/deploy.php
+
12
−
9
View file @
35db37d4
...
@@ -48,13 +48,14 @@ class Deployment extends Unpacker {
...
@@ -48,13 +48,14 @@ class Deployment extends Unpacker {
* Removes files from the deployment location that no longer exist in
* Removes files from the deployment location that no longer exist in
* the local repository
* the local repository
*/
*/
function
clean
(
$local
,
$destination
,
$recurse
=
0
,
$exclude
=
false
)
{
function
clean
(
$local
,
$destination
,
$root
,
$recurse
=
0
,
$exclude
=
false
)
{
$dryrun
=
$this
->
getOption
(
'dry-run'
,
false
);
$dryrun
=
$this
->
getOption
(
'dry-run'
,
false
);
$verbose
=
$dryrun
||
$this
->
getOption
(
'verbose'
);
$verbose
=
$dryrun
||
$this
->
getOption
(
'verbose'
);
$destination
=
rtrim
(
$destination
,
'/'
)
.
'/'
;
$destination
=
rtrim
(
$destination
,
'/'
)
.
'/'
;
$contents
=
glob
(
$destination
.
'{,.}*'
,
GLOB_BRACE
|
GLOB_NOSORT
);
$contents
=
glob
(
$destination
.
'{,.}*'
,
GLOB_BRACE
|
GLOB_NOSORT
);
foreach
(
$contents
as
$i
=>
$file
)
{
foreach
(
$contents
as
$i
=>
$file
)
{
if
(
$this
->
exclude
(
$exclude
,
$file
))
$relative
=
str_replace
(
$root
,
""
,
$file
);
if
(
$this
->
exclude
(
$exclude
,
$relative
))
continue
;
continue
;
if
(
is_file
(
$file
))
{
if
(
is_file
(
$file
))
{
$ltarget
=
$local
.
'/'
.
basename
(
$file
);
$ltarget
=
$local
.
'/'
.
basename
(
$file
);
...
@@ -77,12 +78,13 @@ class Deployment extends Unpacker {
...
@@ -77,12 +78,13 @@ class Deployment extends Unpacker {
foreach
(
$folders
as
$dir
)
{
foreach
(
$folders
as
$dir
)
{
if
(
in_array
(
basename
(
$dir
),
array
(
'.'
,
'..'
)))
if
(
in_array
(
basename
(
$dir
),
array
(
'.'
,
'..'
)))
continue
;
continue
;
elseif
(
$this
->
exclude
(
$exclude
,
$dir
))
$relative
=
str_replace
(
$root
,
""
,
$dir
);
if
(
$this
->
exclude
(
$exclude
,
"
$relative
/"
))
continue
;
continue
;
$this
->
clean
(
$this
->
clean
(
$local
.
'/'
.
basename
(
$dir
),
$local
.
'/'
.
basename
(
$dir
),
$destination
.
basename
(
$dir
),
$destination
.
basename
(
$dir
),
$recurse
-
1
,
$exclude
);
$root
,
$recurse
-
1
,
$exclude
);
}
}
}
}
if
(
!
$contents
||
!
glob
(
$destination
.
'{,.}*'
,
GLOB_BRACE
|
GLOB_NOSORT
))
{
if
(
!
$contents
||
!
glob
(
$destination
.
'{,.}*'
,
GLOB_BRACE
|
GLOB_NOSORT
))
{
...
@@ -259,7 +261,7 @@ class Deployment extends Unpacker {
...
@@ -259,7 +261,7 @@ class Deployment extends Unpacker {
$exclusions
);
$exclusions
);
# Unpack the include folder
# Unpack the include folder
$this
->
unpackage
(
"
$root
/include/
{
,.
}
*"
,
$include
,
-
1
,
$this
->
unpackage
(
"
$root
/include/
{
,.
}
*"
,
$include
,
-
1
,
array
(
"*/include/ost-config.php"
));
array
(
"*/include/ost-config.php"
,
"*.sw[a-z]"
));
if
(
!
$options
[
'dry-run'
])
{
if
(
!
$options
[
'dry-run'
])
{
if
(
$include
!=
"
{
$this
->
destination
}
/include/"
)
if
(
$include
!=
"
{
$this
->
destination
}
/include/"
)
$this
->
change_include_dir
(
$include
);
$this
->
change_include_dir
(
$include
);
...
@@ -267,11 +269,12 @@ class Deployment extends Unpacker {
...
@@ -267,11 +269,12 @@ class Deployment extends Unpacker {
if
(
$options
[
'clean'
])
{
if
(
$options
[
'clean'
])
{
// Clean everything but include folder first
// Clean everything but include folder first
$this
->
clean
(
$root
,
$this
->
destination
,
-
1
,
$local_include
=
str_replace
(
$this
->
destination
,
""
,
$include
);
array
(
$include
,
"setup/"
));
$this
->
clean
(
$root
,
$this
->
destination
,
$this
->
destination
,
-
1
,
$this
->
clean
(
"
$root
/include"
,
$include
,
-
1
,
array
(
$local_include
,
"setup/"
));
$this
->
clean
(
"
$root
/include"
,
$include
,
$include
,
-
1
,
array
(
"ost-config.php"
,
"settings.php"
,
"plugins/"
,
array
(
"ost-config.php"
,
"settings.php"
,
"plugins/"
,
"*/.htaccess"
));
"*/.htaccess"
,
".MANIFEST"
));
}
}
if
(
!
$options
[
'dry-run'
])
if
(
!
$options
[
'dry-run'
])
...
...
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