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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aurel
slapos
Commits
e6d8839c
Commit
e6d8839c
authored
Feb 17, 2015
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5: add webrunner import script for zeo instance.
parent
4533aa04
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
1 deletion
+46
-1
stack/erp5/buildout.cfg
stack/erp5/buildout.cfg
+1
-1
stack/erp5/instance-zeo.cfg.in
stack/erp5/instance-zeo.cfg.in
+45
-0
No files found.
stack/erp5/buildout.cfg
View file @
e6d8839c
...
@@ -301,7 +301,7 @@ md5sum = 28db329061ae863367a76951b9b1152c
...
@@ -301,7 +301,7 @@ md5sum = 28db329061ae863367a76951b9b1152c
[template-zeo]
[template-zeo]
< = download-base
< = download-base
filename = instance-zeo.cfg.in
filename = instance-zeo.cfg.in
md5sum =
5b8639e77217d4fbdee19338a25b6128
md5sum =
cc91f5a4778153dc1d34398b9a80150d
[template-zope]
[template-zope]
< = download-base
< = download-base
...
...
stack/erp5/instance-zeo.cfg.in
View file @
e6d8839c
...
@@ -125,12 +125,57 @@ recipe = collective.recipe.template
...
@@ -125,12 +125,57 @@ recipe = collective.recipe.template
input = inline: {{ default_zodb_path }}/**
input = inline: {{ default_zodb_path }}/**
output = ${directory:srv}/exporter.exclude
output = ${directory:srv}/exporter.exclude
[{{ section("resiliency-after-import-script") }}]
# Generate after import script used by importer instance of webrunner
recipe = collective.recipe.template
input = inline: #!/bin/sh
# DO NOT RUN THIS SCRIPT ON PRODUCTION INSTANCE
# OR ZODB DATA WILL BE ERASED.
# This script will restore the repozo backup to the real
# zodb location. It is launched by the clone (importer) instance of webrunner
# in the end of the import script.
# Depending on the output, it will create a file containing
# the status of the restoration (success or failure).
zodb_directory="${directory:zodb}"
zodb_backup_directory="{{ default_backup_path }}"
repozo="${tidstorage:repozo-binary}"
EXIT_CODE=0
{% for family, zodb in zodb_dict.iteritems() -%}
{% for name, zodb in zodb -%}
{% set zeo_section_name = 'zeo-' ~ family %}
storage_name="{{ name }}"
zodb_path="$storage_name.fs"
pid_file={{ "${" ~ zeo_section_name ~ ":pid-path}" }}
if [ -e "$pid_file" ]; then
pid=$(cat $pid_file) > /dev/null 2>&1
if kill -0 "$pid"; then
echo "Zeo is already running with pid $pid. Aborting."
exit 1
fi
fi
echo "Removing $zodb_path..."
echo "Restoring $storage_name into $zodb_path..."
$repozo --recover --output="$zodb_directory/$zodb_path" --repository="$zodb_backup_directory/$storage_name"
CURRENT_EXIT_CODE=$?
if [ ! "$CURRENT_EXIT_CODE"="0" ]; then
EXIT_CODE="$CURRENT_EXIT_CODE"
echo "$storage_name Backup restoration failed."
fi
{% endfor -%}
{% endfor -%}
exit $EXIT_CODE
output = ${directory:srv}/runner-import-restore
mode = 755
[directory]
[directory]
recipe = slapos.cookbook:mkdirectory
recipe = slapos.cookbook:mkdirectory
bin = ${buildout:directory}/bin
bin = ${buildout:directory}/bin
etc = ${buildout:directory}/etc
etc = ${buildout:directory}/etc
services = ${:etc}/run
services = ${:etc}/run
promises = ${:etc}/promise
promises = ${:etc}/promise
srv = ${buildout:directory}/srv
var = ${buildout:directory}/var
var = ${buildout:directory}/var
log = ${:var}/log
log = ${:var}/log
run = ${:var}/run
run = ${:var}/run
...
...
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