Class: Kubert::Deployment
- Inherits:
-
Object
- Object
- Kubert::Deployment
- Defined in:
- lib/kubert/deployment.rb
Instance Attribute Summary collapse
-
#deployments ⇒ Object
readonly
Returns the value of attribute deployments.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#project_name ⇒ Object
readonly
Returns the value of attribute project_name.
Class Method Summary collapse
Instance Method Summary collapse
- #compilation ⇒ Object
-
#initialize(options, project_name = Kubert.configuration[:project_name]) ⇒ Deployment
constructor
A new instance of Deployment.
- #perform ⇒ Object
- #rollback ⇒ Object
Constructor Details
#initialize(options, project_name = Kubert.configuration[:project_name]) ⇒ Deployment
Returns a new instance of Deployment.
12 13 14 15 16 |
# File 'lib/kubert/deployment.rb', line 12 def initialize(, project_name= Kubert.configuration[:project_name]) @project_name = project_name @deployments = [] = end |
Instance Attribute Details
#deployments ⇒ Object (readonly)
Returns the value of attribute deployments.
11 12 13 |
# File 'lib/kubert/deployment.rb', line 11 def deployments @deployments end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
11 12 13 |
# File 'lib/kubert/deployment.rb', line 11 def end |
#project_name ⇒ Object (readonly)
Returns the value of attribute project_name.
11 12 13 |
# File 'lib/kubert/deployment.rb', line 11 def project_name @project_name end |
Class Method Details
.perform(options) ⇒ Object
3 4 5 |
# File 'lib/kubert/deployment.rb', line 3 def self.perform() new().perform end |
.rollback(options) ⇒ Object
7 8 9 |
# File 'lib/kubert/deployment.rb', line 7 def self.rollback() new().rollback end |
Instance Method Details
#compilation ⇒ Object
34 35 36 |
# File 'lib/kubert/deployment.rb', line 34 def compilation @compilation ||= KY::API.compile([:configmap_path], [:secrets_path], [:output_dir], ) end |
#perform ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/kubert/deployment.rb', line 26 def perform confirm "deploy" do compilation.deploy_generation.to_h.each do |deployment_file, _template_hash| `kubectl apply -f #{deployment_file}` unless excluded?(deployment_file) end end end |
#rollback ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/kubert/deployment.rb', line 18 def rollback confirm "rollback" do compilation.deploy_generation.proc_commands.keys.each do |deployment_name| `kubectl rollout status deployment/#{deployment_name} #{namespace_flag}` unless excluded?(deployment_name) end end end |