Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos-mynij-dev
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
Mynij
slapos-mynij-dev
Commits
45900811
Commit
45900811
authored
Aug 31, 2016
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runner: runner-importer and runner-exporter scripts write their actions into a log file.
parent
536b4d62
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
10 deletions
+27
-10
software/slaprunner/common.cfg
software/slaprunner/common.cfg
+4
-4
software/slaprunner/instance-runner-export.cfg.in
software/slaprunner/instance-runner-export.cfg.in
+2
-1
software/slaprunner/instance-runner-import.cfg.in
software/slaprunner/instance-runner-import.cfg.in
+2
-1
software/slaprunner/template/runner-export.sh.jinja2
software/slaprunner/template/runner-export.sh.jinja2
+9
-2
software/slaprunner/template/runner-import.sh.jinja2
software/slaprunner/template/runner-import.sh.jinja2
+10
-2
No files found.
software/slaprunner/common.cfg
View file @
45900811
...
@@ -62,7 +62,7 @@ recipe = hexagonit.recipe.download
...
@@ -62,7 +62,7 @@ recipe = hexagonit.recipe.download
ignore-existing = true
ignore-existing = true
url = ${:_profile_base_location_}/template/runner-import.sh.jinja2
url = ${:_profile_base_location_}/template/runner-import.sh.jinja2
download-only = true
download-only = true
md5sum =
d7f88b58b2508ce5af42ea7d7241626e
md5sum =
f1fea38763883de5214e898068c30841
filename = runner-import.sh.jinja2
filename = runner-import.sh.jinja2
mode = 0644
mode = 0644
...
@@ -70,7 +70,7 @@ mode = 0644
...
@@ -70,7 +70,7 @@ mode = 0644
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-runner-import.cfg.in
url = ${:_profile_base_location_}/instance-runner-import.cfg.in
output = ${buildout:directory}/instance-runner-import.cfg
output = ${buildout:directory}/instance-runner-import.cfg
md5sum =
341e1273f9489d60520c3bbaef72e1f4
md5sum =
5217b9157c3691c069a95dd2d487e703
mode = 0644
mode = 0644
[template-runner-export-script]
[template-runner-export-script]
...
@@ -78,7 +78,7 @@ recipe = hexagonit.recipe.download
...
@@ -78,7 +78,7 @@ recipe = hexagonit.recipe.download
ignore-existing = true
ignore-existing = true
url = ${:_profile_base_location_}/template/runner-export.sh.jinja2
url = ${:_profile_base_location_}/template/runner-export.sh.jinja2
download-only = true
download-only = true
md5sum =
1bfe048194d4478d0d8743e43e72f7d8
md5sum =
491fb665bf5a5a2dc80bf912aee1a844
filename = runner-export.sh.jinja2
filename = runner-export.sh.jinja2
mode = 0644
mode = 0644
...
@@ -86,7 +86,7 @@ mode = 0644
...
@@ -86,7 +86,7 @@ mode = 0644
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-runner-export.cfg.in
url = ${:_profile_base_location_}/instance-runner-export.cfg.in
output = ${buildout:directory}/instance-runner-export.cfg
output = ${buildout:directory}/instance-runner-export.cfg
md5sum =
c4c1c2059666e30b715e87509d2a0db7
md5sum =
2a962c3256d7d5ba31a4ffe7650a80f5
mode = 0644
mode = 0644
[template-resilient]
[template-resilient]
...
...
software/slaprunner/instance-runner-export.cfg.in
View file @
45900811
...
@@ -70,7 +70,8 @@ wrapper = $${:rendered}
...
@@ -70,7 +70,8 @@ wrapper = $${:rendered}
mode = 700
mode = 700
context =
context =
section directory directory
section directory directory
raw shell_binary ${dash:location}/bin/dash
raw output_log_file $${directory:log}/resilient.log
raw shell_binary ${bash:location}/bin/bash
raw rsync_binary ${rsync:location}/bin/rsync
raw rsync_binary ${rsync:location}/bin/rsync
[monitor-httpd-free-port]
[monitor-httpd-free-port]
...
...
software/slaprunner/instance-runner-import.cfg.in
View file @
45900811
...
@@ -76,7 +76,8 @@ context =
...
@@ -76,7 +76,8 @@ context =
key backend_url slaprunner:access-url
key backend_url slaprunner:access-url
key proxy_host slaprunner:ipv4
key proxy_host slaprunner:ipv4
section directory directory
section directory directory
raw shell_binary ${dash:location}/bin/dash
raw output_log_file $${directory:log}/resilient.log
raw shell_binary ${bash:location}/bin/bash
raw rsync_binary ${rsync:location}/bin/rsync
raw rsync_binary ${rsync:location}/bin/rsync
raw restore_exit_code_file $${:restore-exit-code-file}
raw restore_exit_code_file $${:restore-exit-code-file}
...
...
software/slaprunner/template/runner-export.sh.jinja2
View file @
45900811
...
@@ -6,6 +6,12 @@ umask 077
...
@@ -6,6 +6,12 @@ umask 077
# Exit on any error, to prevent inconsistent backup
# Exit on any error, to prevent inconsistent backup
set -e
set -e
# Redirect output to log
exec > >(tee -ai {{ output_log_file }})
exec 2>&1
echo -e "\n\n$0 run at : $(date)"
srv_directory={{ directory['srv'] }}
srv_directory={{ directory['srv'] }}
sync_element () {
sync_element () {
...
@@ -38,8 +44,9 @@ sync_element () {
...
@@ -38,8 +44,9 @@ sync_element () {
echo "Changing current directory to $path."
echo "Changing current directory to $path."
cd $path;
cd $path;
if [ -f $element ] || [ -d $element ]; then
if [ -f $element ] || [ -d $element ]; then
echo "Running {{ rsync_binary }} -rlptgov --safe-links --exclude-from=$srv_directory/exporter.exclude --delete --delete-excluded $element $backup_path"
command="{{ rsync_binary }} -rlptgov --stats --safe-links --exclude-from=$srv_directory/exporter.exclude --delete --delete-excluded $element $backup_path"
{{ rsync_binary }} -rlptgov --safe-links --exclude-from=$srv_directory/exporter.exclude --delete --delete-excluded $element $backup_path;
echo "Running : $command"
$command
fi
fi
done
done
}
}
...
...
software/slaprunner/template/runner-import.sh.jinja2
View file @
45900811
...
@@ -3,6 +3,13 @@ set -e
...
@@ -3,6 +3,13 @@ set -e
LC_ALL=C
LC_ALL=C
export LC_ALL
export LC_ALL
umask 077
umask 077
# Redirect output to log
exec > >(tee -ai {{ output_log_file }})
exec 2>&1
echo -e "\n\nrunner-import run at : $(date)"
srv_directory={{ directory['srv'] }}
srv_directory={{ directory['srv'] }}
restore_element () {
restore_element () {
backup_path=$1
backup_path=$1
...
@@ -13,7 +20,9 @@ restore_element () {
...
@@ -13,7 +20,9 @@ restore_element () {
do
do
cd $backup_path;
cd $backup_path;
if [ -f $element ] || [ -d $element ]; then
if [ -f $element ] || [ -d $element ]; then
{{ rsync_binary }} -av --delete --exclude *.sock --exclude *.pid --exclude .installed.cfg --exclude .installed-switch-softwaretype.cfg $backup_path/$element $restore_path;
command="{{ rsync_binary }} --stats -av --delete --exclude *.sock --exclude *.pid --exclude .installed.cfg --exclude .installed-switch-softwaretype.cfg $backup_path/$element $restore_path"
echo "Running: \"$command\""
$command
fi
fi
done
done
}
}
...
@@ -62,7 +71,6 @@ $SQLITE3 $DATABASE "update software11 set url='$SOFTWARE_RELEASE' where url='$OL
...
@@ -62,7 +71,6 @@ $SQLITE3 $DATABASE "update software11 set url='$SOFTWARE_RELEASE' where url='$OL
# Change slapproxy database to have all instances stopped
# Change slapproxy database to have all instances stopped
$SQLITE3 $DATABASE "update partition11 set slap_state='stopped';"
$SQLITE3 $DATABASE "update partition11 set slap_state='stopped';"
set -x
# Run slapproxy on different port (in case of running inside of erp5testnode
# Run slapproxy on different port (in case of running inside of erp5testnode
# with only one IP and port 50000 already taken by slapproxy of main instance)
# with only one IP and port 50000 already taken by slapproxy of main instance)
HOST="{{ proxy_host }}"
HOST="{{ proxy_host }}"
...
...
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