Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
slapos
Commits
7565bcdd
Commit
7565bcdd
authored
Dec 02, 2022
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
peertube: backup fixup
parent
bfc1cf0d
Pipeline
#25148
passed with stage
in 0 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
29 deletions
+8
-29
software/peertube/buildout.hash.cfg
software/peertube/buildout.hash.cfg
+3
-3
software/peertube/instance-peertube.cfg.in
software/peertube/instance-peertube.cfg.in
+2
-1
software/peertube/template-peertube-backup.sh.in
software/peertube/template-peertube-backup.sh.in
+1
-1
software/peertube/template-peertube-restore.sh.in
software/peertube/template-peertube-restore.sh.in
+2
-2
software/theia/test/project_tests.py
software/theia/test/project_tests.py
+0
-22
No files found.
software/peertube/buildout.hash.cfg
View file @
7565bcdd
...
...
@@ -18,7 +18,7 @@ md5sum = 35690065ba18dc49d0108fc1f0a07b9e
[instance-peertube]
_update_hash_filename_ = instance-peertube.cfg.in
md5sum = d
edf43efb45743e6401cebec57fc2e8e
md5sum = d
b076bb9b8e5392ec560b15236c8f1d0
[template-nginx-service]
filename = template-nginx-service.sh.in
...
...
@@ -50,8 +50,8 @@ md5sum = f1f82101258de19068262b7213fc478b
[template-peertube-backup-script]
filename = template-peertube-backup.sh.in
md5sum =
58d1a4fe246169dea94d7d243b4bac9e
md5sum =
e50daa16a2c1866997933981bed45271
[template-peertube-restore-script]
filename = template-peertube-restore.sh.in
md5sum = 0
e8e0380887083b0dbb81ffa4016b431
md5sum = 0
b35d69cd3cc3602c9b66f1e1baaf719
software/peertube/instance-peertube.cfg.in
View file @
7565bcdd
...
...
@@ -195,7 +195,8 @@ logfile = ${directory:log}/crond.log
[peertube-backup-script]
recipe = slapos.recipe.template
url = {{ template_peertube_backup }}
output = ${directory:etc}/${:_buildout_section_name_}
backup-file = ${directory:srv}/backup/peertube_prod-dump.db
output = ${directory:bin}/${:_buildout_section_name_}
mode = 0744
[peertube-backup-cron]
...
...
software/peertube/template-peertube-backup.sh.in
View file @
7565bcdd
#!${dash-output:dash}
# Dump the databse
$${postgresql:bin}/pg_dump -h $${postgresql:pgdata-directory} -U $${postgresql:superuser} -Fc peertube_prod > $${
directory:srv}/backup/peertube_prod-dump.db
$${postgresql:bin}/pg_dump -h $${postgresql:pgdata-directory} -U $${postgresql:superuser} -Fc peertube_prod > $${
peertube-backup-script:backup-file}
software/peertube/template-peertube-restore.sh.in
View file @
7565bcdd
...
...
@@ -93,10 +93,10 @@ fi
echo "Postgresql is running, ready to restore"
# Restore the database
$${postgresql:bin}/pg_restore -h $${postgresql:pgdata-directory} -U peertube -e -c -C -d postgres $${
directory:srv}/backup/peertube_prod-dump.db
|| {
$${postgresql:bin}/pg_restore -h $${postgresql:pgdata-directory} -U peertube -e -c -C -d postgres $${
peertube-backup-script:backup-file}
|| {
RESTORE_EXIT_CODE=$?
echo 'Backup restoration failed.'
exit $RESTORE_EXIT_CODE
}
echo "Postgresql restore finished"
\ No newline at end of file
echo "Postgresql restore finished"
software/theia/test/project_tests.py
View file @
7565bcdd
...
...
@@ -245,28 +245,6 @@ class TestTheiaResiliencePeertube(test_resiliency.TestTheiaResilience):
_connexion_parameters_regex
=
re
.
compile
(
r"{.*}"
,
re
.
DOTALL
)
_test_software_url
=
peertube_software_release_url
def
_waitTakeoverReady
(
self
,
takeover_url
,
start
,
maxtries
,
interval
):
export_exitfile
=
self
.
getExportExitfile
()
export_errorfile
=
self
.
getExportErrorfile
()
tries
=
self
.
_waitScriptDone
(
'Export'
,
start
,
export_exitfile
,
export_errorfile
,
maxtries
,
interval
)
import_exitfile
=
self
.
getImportExitfile
()
import_errorfile
=
self
.
getImportErrorfile
()
tries
=
self
.
_waitScriptDone
(
'Import'
,
start
,
import_exitfile
,
import_errorfile
,
tries
,
interval
)
print
(
'tries after Import is: '
+
str
(
tries
))
for
_
in
range
(
40
):
info
=
self
.
_getTakeoverPage
(
takeover_url
)
if
"No backup downloaded yet, takeover should not happen now."
in
info
:
print
(
'Takeover page still reports export script in progress'
)
elif
"<b>Importer script(s) of backup in progress:</b> True"
in
info
:
print
(
'Takeover page still reports import script in progress'
)
else
:
return
time
.
sleep
(
interval
)
return
self
.
fail
(
'Takeover page failed to report readiness'
)
def
_getPeertubeConnexionParameters
(
self
,
instance_type
=
'export'
):
out
=
self
.
captureSlapos
(
'request'
,
'test_instance'
,
self
.
_test_software_url
,
...
...
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