Class: Gitlab::Ci::Config::Entry::Environment
Overview
Entry that represents an environment.
Constant Summary
collapse
- ALLOWED_KEYS =
%i[name url action on_stop auto_stop_in kubernetes deployment_tier].freeze
Gitlab::Config::Entry::Node::InvalidError
Instance Attribute Summary
#config, #default, #deprecation, #description, #key, #metadata, #parent
Instance Method Summary
collapse
#compose!, #entry_create!
#[], #add_warning, #ancestors, #array?, aspects, #compose!, default, #descendants, #errors, #initialize, #inspect, #integer?, #leaf?, #location, #opt, #relevant?, #specified?, #valid?, #warnings, with_aspect
Instance Method Details
#action ⇒ Object
77
78
79
|
# File 'lib/gitlab/ci/config/entry/environment.rb', line 77
def action
value[:action] || 'start'
end
|
#auto_stop_in ⇒ Object
89
90
91
|
# File 'lib/gitlab/ci/config/entry/environment.rb', line 89
def auto_stop_in
value[:auto_stop_in]
end
|
#deployment_tier ⇒ Object
93
94
95
|
# File 'lib/gitlab/ci/config/entry/environment.rb', line 93
def deployment_tier
value[:deployment_tier]
end
|
#hash? ⇒ Boolean
61
62
63
|
# File 'lib/gitlab/ci/config/entry/environment.rb', line 61
def hash?
@config.is_a?(Hash)
end
|
#kubernetes ⇒ Object
85
86
87
|
# File 'lib/gitlab/ci/config/entry/environment.rb', line 85
def kubernetes
value[:kubernetes]
end
|
#name ⇒ Object
69
70
71
|
# File 'lib/gitlab/ci/config/entry/environment.rb', line 69
def name
value[:name]
end
|
#on_stop ⇒ Object
81
82
83
|
# File 'lib/gitlab/ci/config/entry/environment.rb', line 81
def on_stop
value[:on_stop]
end
|
#skip_config_hash_validation? ⇒ Boolean
105
106
107
|
# File 'lib/gitlab/ci/config/entry/environment.rb', line 105
def skip_config_hash_validation?
true
end
|
#string? ⇒ Boolean
65
66
67
|
# File 'lib/gitlab/ci/config/entry/environment.rb', line 65
def string?
@config.is_a?(String)
end
|
#url ⇒ Object
73
74
75
|
# File 'lib/gitlab/ci/config/entry/environment.rb', line 73
def url
value[:url]
end
|
#value ⇒ Object
97
98
99
100
101
102
103
|
# File 'lib/gitlab/ci/config/entry/environment.rb', line 97
def value
case @config
when String then { name: @config, action: 'start' }
when Hash then @config
else {}
end
end
|