Commit 8099a8bf authored by Kirill Smelkov's avatar Kirill Smelkov

gitlab-backup: Refactor need_gitlab_config() a bit

In the following patches we will be adding more and more settings to
read from gitlab config, so structure of code which does this is better
prepared:

    - part that emits the settings (in Ruby) is now multiline
    - we prepare shortcuts c & s which are Gitlab.config and
      Gitlab.config.gitlab_shell
    - in the end there is "END" emitted, and the reader checks this to
      make sure generate and read parts stay in sync.

/cc @kazuhiko
parent bb03a6d7
......@@ -28,10 +28,19 @@ need_gitlab_config() {
{
read GITLAB_BACKUP_PATH
read GITLAB_REPOS_PATH
} < <(gitlab-rails r 'puts Gitlab.config.backup.path, Gitlab.config.gitlab_shell.repos_path')
read END
} < <(gitlab-rails r '
c = Gitlab.config
s = c.gitlab_shell
puts c.backup.path, s.repos_path
puts "END"
')
test -n "$GITLAB_BACKUP_PATH" || die "E: cannot detect GITLAB_BACKUP_PATH"
test -n "$GITLAB_REPOS_PATH" || die "E: cannot detect GITLAB_REPOS_PATH"
test "$END" == "END" || die "E: self-consistency failure (END)"
}
......
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