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
Tristan Cavelier
slapos
Commits
51f45430
Commit
51f45430
authored
Sep 09, 2016
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resilient: promises to check backup integrity shouldn't fail if proofs do no exist
parent
9aa1d2a6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
6 deletions
+24
-6
stack/resilient/buildout.cfg
stack/resilient/buildout.cfg
+2
-2
stack/resilient/instance-pull-backup.cfg.in
stack/resilient/instance-pull-backup.cfg.in
+11
-3
stack/resilient/pbsready-import.cfg.in
stack/resilient/pbsready-import.cfg.in
+11
-1
No files found.
stack/resilient/buildout.cfg
View file @
51f45430
...
@@ -50,7 +50,7 @@ mode = 0644
...
@@ -50,7 +50,7 @@ mode = 0644
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/pbsready-import.cfg.in
url = ${:_profile_base_location_}/pbsready-import.cfg.in
output = ${buildout:directory}/pbsready-import.cfg
output = ${buildout:directory}/pbsready-import.cfg
md5sum =
cdebc491a50a61fecc3391a5eb311bdb
md5sum =
89619b0d8626c76402a11bb08e7ba8a1
mode = 0644
mode = 0644
[pbsready-export]
[pbsready-export]
...
@@ -66,7 +66,7 @@ mode = 0644
...
@@ -66,7 +66,7 @@ mode = 0644
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-pull-backup.cfg.in
url = ${:_profile_base_location_}/instance-pull-backup.cfg.in
output = ${buildout:directory}/instance-pull-backup.cfg
output = ${buildout:directory}/instance-pull-backup.cfg
md5sum =
232fcad0892e56d62f45e79ec01c7c3e
md5sum =
fba98fd740d564525fc3f236662f5d64
mode = 0644
mode = 0644
[template-replicated]
[template-replicated]
...
...
stack/resilient/instance-pull-backup.cfg.in
View file @
51f45430
...
@@ -268,9 +268,17 @@ monitor-username = $${htpasswd:username}
...
@@ -268,9 +268,17 @@ monitor-username = $${htpasswd:username}
[backup-transfer-integrity-promise]
[backup-transfer-integrity-promise]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template:jinja2
template = inline:
template = inline:
#!${dash:location}/bin/dash
#!${dash:location}/bin/dash
cd $${directory:pbs-backup}
# Raise an error if signatures are different
diff proof.signature $(find . -name backup.signature -maxdepth 2)
# Error cannot be deduced if files do not exist
cd $${directory:pbs-backup}
if [ ! -f "proof.signature" ]; then exit 0; fi
backup_signature=$(find . -maxdepth 2 -name backup.signature)
if [ -z "$backup_signature" ]; then
exit 0;
else
diff "proof.signature" "$backup_signature";
fi
rendered = $${basedirectory:promises}/backup-transfer-integrity-promise
rendered = $${basedirectory:promises}/backup-transfer-integrity-promise
mode = 700
mode = 700
...
...
stack/resilient/pbsready-import.cfg.in
View file @
51f45430
...
@@ -82,7 +82,17 @@ callback = $${post-notification-run:output}
...
@@ -82,7 +82,17 @@ callback = $${post-notification-run:output}
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template:jinja2
template = inline:
template = inline:
#!/${bash:location}/bin/bash
#!/${bash:location}/bin/bash
if [ "$(wc -l $${post-notification-run:diff-file} | cut -d \ -f1)" -eq 0 ]; then exit 0; else exit 1; fi
backup_diff_file=$${post-notification-run:diff-file}
if [ -f "$backup_diff_file" ]; then
if [ $(wc -l "$backup_diff_file" | cut -d \ -f1) -eq 0 ]; then
exit 0;
else
exit 1;
fi
else
# If file doesn't exist, promise should raise false positive
exit 0;
fi
rendered = $${basedirectory:promises}/backup-transfer-integrity-promise
rendered = $${basedirectory:promises}/backup-transfer-integrity-promise
mode = 700
mode = 700
...
...
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