Class: KuberKit::Configs
Constant Summary collapse
- AVAILABLE_CONFIGS =
[ :image_dockerfile_name, :image_build_context_dir, :image_tag, :docker_ignore_list, :image_compile_dir, :kuber_kit_dirname, :kuber_kit_min_version, :images_dirname, :services_dirname, :infra_dirname, :configurations_dirname, :artifact_clone_dir, :service_config_dir, :deployer_strategy, :compile_simultaneous_limit, :additional_images_paths, :deprecation_warnings_disabled ]
- DOCKER_IGNORE_LIST =
[ 'Dockerfile', '.DS_Store', '**/.DS_Store', '**/*.log', 'node_modules', '.vagrant', '.vscode', 'tmp', 'logs' ]
Instance Method Summary collapse
- #add_default_configs ⇒ Object
- #get(key) ⇒ Object
-
#initialize ⇒ Configs
constructor
A new instance of Configs.
- #items ⇒ Object
- #reset! ⇒ Object
- #set(key, value) ⇒ Object
Constructor Details
#initialize ⇒ Configs
Returns a new instance of Configs.
32 33 34 |
# File 'lib/kuber_kit/configs.rb', line 32 def initialize add_default_configs unless items.any? end |
Instance Method Details
#add_default_configs ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/kuber_kit/configs.rb', line 36 def add_default_configs set :image_dockerfile_name, "Dockerfile" set :image_build_context_dir, "build_context" set :image_tag, 'latest' set :image_compile_dir, "/tmp/kuber_kit/image_builds" set :docker_ignore_list, DOCKER_IGNORE_LIST set :kuber_kit_dirname, "kuber_kit" set :kuber_kit_min_version, KuberKit::VERSION set :images_dirname, "images" set :services_dirname, "services" set :infra_dirname, "infrastructure" set :configurations_dirname, "configurations" set :artifact_clone_dir, "/tmp/kuber_kit/artifacts" set :service_config_dir, "/tmp/kuber_kit/services" set :deployer_strategy, :kubernetes set :compile_simultaneous_limit, 5 set :additional_images_paths, [] set :deprecation_warnings_disabled, false end |
#get(key) ⇒ Object
68 69 70 71 72 73 74 |
# File 'lib/kuber_kit/configs.rb', line 68 def get(key) unless AVAILABLE_CONFIGS.include?(key) raise ArgumentError, "#{key} is not a valid configuration key" end items[key] end |
#items ⇒ Object
56 57 58 |
# File 'lib/kuber_kit/configs.rb', line 56 def items @@items ||= {} end |
#reset! ⇒ Object
76 77 78 |
# File 'lib/kuber_kit/configs.rb', line 76 def reset! @@items = {} end |
#set(key, value) ⇒ Object
60 61 62 63 64 65 66 |
# File 'lib/kuber_kit/configs.rb', line 60 def set(key, value) unless AVAILABLE_CONFIGS.include?(key) raise ArgumentError, "#{key} is not a valid configuration key" end items[key] = value end |