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
afdfd53c
Commit
afdfd53c
authored
Dec 05, 2022
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
peertube: backup fixup
parent
ffacc1a7
Pipeline
#25183
passed with stage
in 0 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
19 deletions
+17
-19
software/peertube/buildout.hash.cfg
software/peertube/buildout.hash.cfg
+1
-1
software/peertube/template-peertube-restore.sh.in
software/peertube/template-peertube-restore.sh.in
+16
-9
software/theia/test/project_tests.py
software/theia/test/project_tests.py
+0
-9
No files found.
software/peertube/buildout.hash.cfg
View file @
afdfd53c
...
...
@@ -54,4 +54,4 @@ md5sum = e50daa16a2c1866997933981bed45271
[template-peertube-restore-script]
filename = template-peertube-restore.sh.in
md5sum =
04e1c0abe3d3c626e2f6e513d7e0d646
md5sum =
656b170ed264b749415f1d31a8c770b1
software/peertube/template-peertube-restore.sh.in
View file @
afdfd53c
...
...
@@ -43,25 +43,32 @@ $${postgresql:bin}/postgres -D $${postgresql:pgdata-directory} &
postgresql_pid=$!
trap "kill $postgresql_pid" EXIT TERM INT
# If postgres has stopped, abort
if ! [ -d /proc/$postgresql_pid ]; then
echo "postgresql exited, aborting."
exit 1
fi
echo "Parsing postgresql conf..."
postgresql_conf_file=$${postgresql:pgdata-directory}/postgresql.conf
tpgwait=60
while ! [ -e "$p
id
_file" ]; do
while ! [ -e "$p
ostgresql_conf
_file" ]; do
tpgwait=$(( $tpgwait - 1 ))
test $tpgwait = 0 && die "
Can not create pid_file
"
echo "
pid_file
not exist; will retry $tpgwait times..." 1>&2
test $tpgwait = 0 && die "
Postgresql conf file does not exist.
"
echo "
Postgresql conf file does
not exist; will retry $tpgwait times..." 1>&2
sleep 1
done
# If postgres has stopped, abort
if ! [ -d /proc/$postgresql_pid ]; then
echo "postgresql exited, aborting."
exit 1
fi
echo "Get the postgresql port number..."
port=$(awk '/^port/{print $3}' $postgresql_conf_file)
echo $port
# run psql
psql() {
$${postgresql:bin}/psql \
-h $${postgresql:pgdata-directory} \
-p $port \
-U $${postgresql:superuser} \
-d $${postgresql:dbname} \
"$@"
...
...
@@ -98,7 +105,7 @@ 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 $${peertube-backup-script:backup-file} || {
$${postgresql:bin}/pg_restore -h $${postgresql:pgdata-directory} -U peertube -
p $port -
e -c -C -d postgres $${peertube-backup-script:backup-file} || {
RESTORE_EXIT_CODE=$?
echo 'Backup restoration failed.'
exit $RESTORE_EXIT_CODE
...
...
software/theia/test/project_tests.py
View file @
afdfd53c
...
...
@@ -245,15 +245,6 @@ class TestTheiaResiliencePeertube(test_resiliency.TestTheiaResilience):
_connexion_parameters_regex
=
re
.
compile
(
r"{.*}"
,
re
.
DOTALL
)
_test_software_url
=
peertube_software_release_url
@
classmethod
def
setUpClass
(
cls
):
super
(
TestTheiaResiliencePeertube
,
cls
).
setUpClass
()
cls
.
computer_partition_root_path
=
cls
.
getPartitionPath
(
'import'
)
cls
.
_save_instance_file_pattern_list
+=
(
'*/srv/postgresql/*'
,
'*/srv/backup/peertube_prod-dump.db'
,
)
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