Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beat.web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
beat
beat.web
Commits
4849e004
Commit
4849e004
authored
8 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[utils] Handle backup and re-store of optional apps in a better way
parent
c2ecace5
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
beat/web/utils/management/commands/backup.py
+1
-0
1 addition, 0 deletions
beat/web/utils/management/commands/backup.py
beat/web/utils/management/commands/restore.py
+5
-0
5 additions, 0 deletions
beat/web/utils/management/commands/restore.py
with
6 additions
and
0 deletions
beat/web/utils/management/commands/backup.py
+
1
−
0
View file @
4849e004
...
@@ -59,6 +59,7 @@ APPS = [ #dump and load order are respected
...
@@ -59,6 +59,7 @@ APPS = [ #dump and load order are respected
'
search
'
,
'
search
'
,
'
reports
'
,
'
reports
'
,
'
actstream
'
,
'
actstream
'
,
'
post_office
'
,
]
]
...
...
This diff is collapsed.
Click to expand it.
beat/web/utils/management/commands/restore.py
+
5
−
0
View file @
4849e004
...
@@ -74,6 +74,10 @@ class Command(BaseCommand):
...
@@ -74,6 +74,10 @@ class Command(BaseCommand):
def
add_arguments
(
self
,
parser
):
def
add_arguments
(
self
,
parser
):
parser
.
add_argument
(
'
-e
'
,
'
--exclude
'
,
dest
=
'
exclude
'
,
action
=
'
append
'
,
default
=
[],
help
=
'
An app_label to exclude (use multiple
'
\
'
--exclude to exclude multiple apps).
'
)
parser
.
add_argument
(
'
backup
'
,
type
=
str
,
parser
.
add_argument
(
'
backup
'
,
type
=
str
,
help
=
'
The backup you wish to restore from
'
)
help
=
'
The backup you wish to restore from
'
)
...
@@ -115,6 +119,7 @@ class Command(BaseCommand):
...
@@ -115,6 +119,7 @@ class Command(BaseCommand):
# and loads the apps respecting the imposed order
# and loads the apps respecting the imposed order
for
app
in
APPS
:
for
app
in
APPS
:
if
app
in
arguments
.
get
(
'
exclude
'
):
continue
# copy prefix data
# copy prefix data
path
=
os
.
path
.
join
(
settings
.
PREFIX
,
app
)
path
=
os
.
path
.
join
(
settings
.
PREFIX
,
app
)
srcdir
=
os
.
path
.
join
(
tmpdir
,
'
prefix
'
,
app
)
srcdir
=
os
.
path
.
join
(
tmpdir
,
'
prefix
'
,
app
)
...
...
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