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
Thomas Gambier
slapos
Commits
0f2d0590
Commit
0f2d0590
authored
Dec 16, 2024
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Plain Diff
software/gitlab: gitaly need to be started for backup restoration
See merge request
!1707
parents
3ec53860
ffd4c301
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
12 deletions
+24
-12
software/gitlab/buildout.hash.cfg
software/gitlab/buildout.hash.cfg
+2
-2
software/gitlab/instance-gitlab-export.cfg.in
software/gitlab/instance-gitlab-export.cfg.in
+2
-0
software/gitlab/template/template-gitlab-resiliency-restore.sh.in
.../gitlab/template/template-gitlab-resiliency-restore.sh.in
+20
-10
No files found.
software/gitlab/buildout.hash.cfg
View file @
0f2d0590
...
...
@@ -58,7 +58,7 @@ md5sum = 35bb9f1d8f4fd6675bd768d8a7e1253c
[instance-gitlab-export.cfg.in]
_update_hash_filename_ = instance-gitlab-export.cfg.in
md5sum =
c8231583d04bf0d3fe2d26230b94d78d
md5sum =
330e1b13f793303e069ec8b7b8c882ea
[macrolib.cfg.in]
_update_hash_filename_ = macrolib.cfg.in
...
...
@@ -82,7 +82,7 @@ md5sum = b1becd9ec4c2eeefe573af4bb53c9751
[template-gitlab-resiliency-restore.sh.in]
_update_hash_filename_ = template/template-gitlab-resiliency-restore.sh.in
md5sum =
8ce31a27e814e750dfd38c92a278fb9e
md5sum =
c1b5f7ab33de40f301fa6931f84999a1
[puma.rb.in]
_update_hash_filename_ = template/puma.rb.in
...
...
software/gitlab/instance-gitlab-export.cfg.in
View file @
0f2d0590
...
...
@@ -76,6 +76,8 @@ context =
raw redis_script ${service-redis:wrapper}
raw puma_script ${service-puma:wrapper-path}
raw sidekiq_script ${service-sidekiq:wrapper-path}
raw gitaly_script ${service-gitaly:wrapper-path}
raw gitaly_pid_file ${gitaly:pid}
raw gitlab_backup_dir ${gitlab-backup-directory:backup-gitlab.git}
raw redis_pid_file ${service-redis:pid-file}
raw postgres_pid_file ${service-postgresql:pgdata-directory}/postmaster.pid
...
...
software/gitlab/template/template-gitlab-resiliency-restore.sh.in
View file @
0f2d0590
...
...
@@ -30,6 +30,8 @@ puma_script="{{ puma_script }}"
puma_pid_file="{{ puma_pid_file }}"
sidekiq_script="{{ sidekiq_script }}"
var_location="{{ var_directory }}"
gitaly_script="{{ gitaly_script }}"
gitaly_pid_file="{{ gitaly_pid_file }}"
# export GIT_EXEC_PATH=$git_location/libexec/git-core/
...
...
@@ -57,6 +59,7 @@ kill_process () {
check_process $postgres_pid_file "Postgres"
check_process $redis_pid_file "Redis"
check_process $puma_pid_file "Puma"
check_process $gitaly_pid_file "Gitaly"
if [ -f "$postgres_pid_file" ]; then
rm $postgres_pid_file
...
...
@@ -66,7 +69,7 @@ fi
# restoration will created them at every run
echo "Cleanup gitlab backup and old repositories folders..."
rm -rf $var_location/backup/*
rm -rf $var_location/repositories*
rm -rf $var_location/repositories
.
*
echo "Starting Postgres..."
$postgres_executable &
...
...
@@ -77,6 +80,20 @@ echo "Starting Redis server..."
$redis_executable &
redis_pid=$!
trap "kill $postgres_pid $redis_pid" EXIT TERM INT
echo "Starting gitaly service..."
$gitaly_script &
gitaly_pid=$!
trap "kill $gitaly_pid $postgres_pid $redis_pid" EXIT TERM INT
echo "Starting Puma"
$puma_script &
puma_pid=$!
trap "kill $gitaly_pid $postgres_pid $redis_pid $puma_pid" EXIT TERM INT
# wait until Puma is started and pid file exists
sleep 200
if [ -s "$puma_pid_file" ]; then
puma_pid=$(head -n 1 $puma_pid_file) > /dev/null 2>&1
trap "kill $postgres_pid $redis_pid $puma_pid" EXIT TERM INT
fi
echo "[OK]"
echo "Restoring gitlab data..."
...
...
@@ -90,15 +107,7 @@ echo "Checking gitlab promises..."
echo "[info] Not all promises are checked!"
$promise_check/gitlab-app
echo "Starting Puma to check gitlab-shell promise..."
$puma_script &
puma_pid=$!
trap "kill $postgres_pid $redis_pid $puma_pid" EXIT TERM INT
sleep 60
if [ -s "$puma_pid_file" ]; then
puma_pid=$(head -n 1 $puma_pid_file) > /dev/null 2>&1
trap "kill $postgres_pid $redis_pid $puma_pid" EXIT TERM INT
fi
echo "Check gitlab-shell promise..."
$promise_check/gitlab-shell
#echo "starting Sidekiq to check sidekiq promise..."
...
...
@@ -110,6 +119,7 @@ $promise_check/gitlab-shell
kill_process $postgres_pid
kill_process $redis_pid
kill_process $puma_pid
kill_process $gitaly_pid
RESTORE_EXIT_CODE=$?
...
...
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