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
Kwabena Antwi-Boasiako
slapos
Commits
f4479fc5
Commit
f4479fc5
authored
Jul 16, 2014
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
abilian: optional backup_dir parameter in postgres_restore
parent
e8bd1134
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
8 deletions
+17
-8
software/abilian/extranet_spr/abilian-config.py
software/abilian/extranet_spr/abilian-config.py
+6
-3
software/abilian/extranet_spr/instance-postgres.cfg.in
software/abilian/extranet_spr/instance-postgres.cfg.in
+6
-2
software/abilian/extranet_spr/instance.cfg.in
software/abilian/extranet_spr/instance.cfg.in
+2
-0
software/abilian/extranet_spr/software.cfg
software/abilian/extranet_spr/software.cfg
+3
-3
No files found.
software/abilian/extranet_spr/abilian-config.py
View file @
f4479fc5
...
...
@@ -23,12 +23,15 @@ def load_config():
if
key
in
[
'SECRET_KEY'
]:
globals
()[
key
]
=
str
(
value
)
# interpolate password
if needed
# interpolate password
and host provided by separate files
try
:
globals
()[
'SQLALCHEMY_DATABASE_URI'
]
=
SQLALCHEMY_DATABASE_URI
%
{
'password'
:
SQLALCHEMY_DATABASE_PASSWORD
}
globals
()[
'SQLALCHEMY_DATABASE_URI'
]
=
SQLALCHEMY_DATABASE_URI
%
{
'password'
:
SQLALCHEMY_DATABASE_PASSWORD
,
'ipv4'
:
POSTGRES_IPV4
}
except
NameError
:
pass
raise
NameError
(
"The configuration is not complete yet"
)
load_config
()
...
...
software/abilian/extranet_spr/instance-postgres.cfg.in
View file @
f4479fc5
...
...
@@ -151,12 +151,16 @@ template = inline:
#!/bin/bash
. {{environment}}
# shut down postgres
backup_dir={{backup_dir}}
[ -n "$1" ] && backup_dir="$1"
$${directories:bin}/postgres-stop
# check that postgres is down or refuse to run
$${directories:bin}/postgres-status | grep STOPPED || exit 10
echo "restoring from {{backup_dir}}"
echo "restoring from $backup_dir"
mv {{pgdata}}/pg_hba.conf {{pgdata}}/hba.conf
rm -rf {{pgdata}}/pg_* {{pgdata}}/base {{pgdata}}/global {{pgdata}}/PG_VERSION
cp -a {{backup_dir}}/pg_* {{backup_dir}}/base {{backup_dir}}/global {{backup_dir}}/PG_VERSION {{pgdata}}/
mv {{pgdata}}/hba.conf {{pgdata}}/pg_hba.conf
cp -a $backup_dir/pg_* $backup_dir/base $backup_dir/global $backup_dir/PG_VERSION {{pgdata}}/
echo "restore done"
echo "SELECT 1" | postgres --single -D {{pgdata}} {{dbname}} || (rm {{pgdata}}/postmaster.pid; pg_resetxlog -f {{pgdata}})
for table in blob partenaire contact visite; do
...
...
software/abilian/extranet_spr/instance.cfg.in
View file @
f4479fc5
...
...
@@ -54,6 +54,8 @@ BROKER_URL = redis://:$${redis-requirepass:passwd}@[$${redis:ipv4}]:$${redis:por
CELERY_RESULT_BACKEND = redis://:$${redis-requirepass:passwd}@[$${redis:ipv4}]:$${redis:port}/2
SECRET_KEY = $${csrf-secret-key:passwd}
INSTANCE_HOST = $${instance-parameters:ipv6-random}
POSTGRES_IPV4 = $${postgres-promise:hostname}
SQLALCHEMY_DATABASE_URI = postgres://extranet_spr_production:%(password)s@%(ipv4)s:5432/extranet_spr_production
...
...
software/abilian/extranet_spr/software.cfg
View file @
f4479fc5
...
...
@@ -259,14 +259,14 @@ configure-command =
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg.in
output = ${buildout:directory}/instance.cfg
md5sum =
02e0a25e4ffdb63a18cc29d0c9055919
md5sum =
738b85f80484ff4d57d1218cf87b3c8a
mode = 0644
[instance-postgres]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-postgres.cfg.in
output = ${buildout:directory}/instance-postgres.cfg
md5sum =
16a2d43b29a3c497c03a496f423c1600
md5sum =
e2bcc3dafdfc5bf331b743952ed98be2
mode = 0644
[instance-redis]
...
...
@@ -295,7 +295,7 @@ mode = 0644
[abilian-config]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/abilian-config.py
md5sum =
e89ecb0293a49ab382337bdb1f676fb0
md5sum =
66bf5e8f6f763de85b474838e88753da
location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = abilian-config.py
download-only = true
...
...
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