class GitlabClusterHelper::Config
Constants
- DEFAULT_PATH
Attributes
cluster_prefix[R]
gcp_project[R]
gcp_zone[R]
Public Class Methods
new()
click to toggle source
# File lib/gitlab_cluster_helper/config.rb, line 14 def initialize path = ENV["GITLAB_CLUSTER_HELPER_CONFIG"] || DEFAULT_PATH raise Error, "Config file does not exist at path: #{path}" unless Pathname.new(path).file? json = File.read(path) data = JSON.parse(json) @gcp_project = data['gcp_project'] @gcp_zone = data['gcp_zone'] @cluster_prefix = data['cluster_prefix'] end