Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
compoctl
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Open Source Software
compoctl
Commits
6e7812cc
Commit
6e7812cc
authored
Feb 18, 2019
by
∞
💻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mark restore compose internal
parent
9e7c04f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
compoctl.py
compoctl.py
+7
-7
No files found.
compoctl.py
View file @
6e7812cc
...
...
@@ -105,7 +105,7 @@ def backup():
io.compoctl.backup.cmd: pg_dumpall -U postgres -f /backup/data.dump
This will dump pg data into ./backup/postgres, and also export
docker-compose running config into ./backup/docker-compose.restore.yml
docker-compose running config into ./backup/docker-compose.
_
restore.yml
It will also execute the docker-compose.backup.yml if it exists. This is
were you can spawn a container that mounts ./backup and proceeds to the
...
...
@@ -142,7 +142,7 @@ def backup():
for
service
,
image
in
images
.
items
():
cfg
[
'services'
][
service
][
'image'
]
=
image
restore_content
=
yaml
.
dump
(
cfg
)
restore_path
=
'./backup/docker-compose.restore.yml'
restore_path
=
'./backup/docker-compose.
_
restore.yml'
yield
f
'Writing {restore_path} with hard coded images'
with
open
(
restore_path
,
'w+'
)
as
fh
:
fh
.
write
(
restore_content
)
...
...
@@ -181,20 +181,20 @@ def restore():
Also, the cluster will be unusable/down during the restore operation.
"""
if
not
os
.
path
.
exists
(
'./backup/docker-compose.restore.yml'
):
if
not
os
.
path
.
exists
(
'./backup/docker-compose.
_
restore.yml'
):
raise
cli2
.
Cli2Exception
(
'./backup not found !'
)
shutil
.
copyfile
(
'./backup/docker-compose.restore.yml'
,
'docker-compose.restore.yml'
,
'./backup/docker-compose.
_
restore.yml'
,
'docker-compose.
_
restore.yml'
,
)
console_script
.
options
+=
[
'-f'
,
'./docker-compose.restore.yml'
]
console_script
.
options
+=
[
'-f'
,
'./docker-compose.
_
restore.yml'
]
compose
(
'pull'
)
compose
(
'down'
)
with
open
(
'docker-compose.restore.yml'
,
'r'
)
as
fh
:
with
open
(
'docker-compose.
_
restore.yml'
,
'r'
)
as
fh
:
content
=
fh
.
read
()
cfg
=
yaml
.
load
(
content
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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