summaryrefslogtreecommitdiff
path: root/support/gitlab_config.rb
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2019-10-03 12:26:20 +0100
committerNick Thomas <nick@gitlab.com>2019-10-08 12:20:30 +0100
commit1a3e687f772047988b9bcaeb471d94d6f49a853e (patch)
tree329d7a0112bcc501e4065b0c5786be6f64d90432 /support/gitlab_config.rb
parent9ba79e43395cf09e3c5904c541a011ea25b620f1 (diff)
downloadgitlab-shell-1a3e687f772047988b9bcaeb471d94d6f49a853e.tar.gz
Decouple bin/compile and bin/install from lib/
This commit duplicates a small amount of Ruby code that is run at build or install time. Over time, it would be nice to remove the dependency on Ruby for these steps, but the focus right now is on run-time. We'll be removing lib/* from gitlab-shell very soon, and these commands need to keep working when we do.
Diffstat (limited to 'support/gitlab_config.rb')
-rw-r--r--support/gitlab_config.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/support/gitlab_config.rb b/support/gitlab_config.rb
new file mode 100644
index 0000000..1416488
--- /dev/null
+++ b/support/gitlab_config.rb
@@ -0,0 +1,13 @@
+require 'yaml'
+
+class GitlabConfig
+ attr_reader :config
+
+ def initialize
+ @config = YAML.load_file(File.join(ROOT_PATH, 'config.yml'))
+ end
+
+ def auth_file
+ @config['auth_file'] ||= File.join(Dir.home, '.ssh/authorized_keys')
+ end
+end