Commit 02c80d58 authored by Kirill Smelkov's avatar Kirill Smelkov

gitlab-backup: Cosmetics

Add comments about what each function does, and add appropriate echo
which were missing in several pull & restore places.
parent 14ce9ff3
...@@ -30,6 +30,7 @@ export PGHOST= ...@@ -30,6 +30,7 @@ export PGHOST=
export PGPORT= export PGPORT=
export PGPASSWORD= export PGPASSWORD=
# make sure gitlab is configured and read what we need from its config
need_gitlab_config() { need_gitlab_config() {
test -n "$GITLAB_BACKUP_PATH" && return test -n "$GITLAB_BACKUP_PATH" && return
...@@ -70,6 +71,7 @@ need_gitlab_config() { ...@@ -70,6 +71,7 @@ need_gitlab_config() {
} }
# pull gitlab data into git-backup repository
backup_pull() { backup_pull() {
need_gitlab_config need_gitlab_config
...@@ -87,6 +89,7 @@ backup_pull() { ...@@ -87,6 +89,7 @@ backup_pull() {
# 2. unpack backup_tar so it is ready to be pulled into git-backup # 2. unpack backup_tar so it is ready to be pulled into git-backup
echo " * Unpacking dump tarballs"
mkdir "$tmpd/gitlab_backup" mkdir "$tmpd/gitlab_backup"
tar -C "$tmpd/gitlab_backup" -xf "$backup_tar" tar -C "$tmpd/gitlab_backup" -xf "$backup_tar"
# unpack tarballs so files are better stored in git # unpack tarballs so files are better stored in git
...@@ -184,6 +187,7 @@ backup_pull() { ...@@ -184,6 +187,7 @@ backup_pull() {
} }
# restore gitlab data from git-backup repository
backup_restore() { backup_restore() {
HEAD=$1 HEAD=$1
vupok=$2 vupok=$2
...@@ -270,6 +274,7 @@ backup_restore() { ...@@ -270,6 +274,7 @@ backup_restore() {
rm -rf "$tmpd" # tmpd no longer needed rm -rf "$tmpd" # tmpd no longer needed
# 4. extract repositories into .../repositories.<timestamp> # 4. extract repositories into .../repositories.<timestamp>
echo " * Extracting repositories"
reposX="${GITLAB_REPOS_PATH}.${backup_created_at}" reposX="${GITLAB_REPOS_PATH}.${backup_created_at}"
$GIT_BACKUP restore $HEAD gitlab/repo:"$reposX" $GIT_BACKUP restore $HEAD gitlab/repo:"$reposX"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment