Class: Gitlab::Kubernetes::Helm::InstallCommand

Inherits:
BaseCommand
  • Object
show all
Includes:
ClientCommand
Defined in:
lib/gitlab/kubernetes/helm/install_command.rb

Instance Attribute Summary collapse

Attributes inherited from BaseCommand

#files, #name

Instance Method Summary collapse

Methods included from ClientCommand

#init_command, #repository_command

Methods inherited from BaseCommand

#cluster_role_binding_resource, #config_map_resource, #file_names, #pod_name, #pod_resource, #rbac?, #service_account_resource

Constructor Details

#initialize(chart:, version: nil, repository: nil, preinstall: nil, postinstall: nil, **args) ⇒ InstallCommand

Returns a new instance of InstallCommand.


12
13
14
15
16
17
18
19
# File 'lib/gitlab/kubernetes/helm/install_command.rb', line 12

def initialize(chart:, version: nil, repository: nil, preinstall: nil, postinstall: nil, **args)
  super(**args)
  @chart = chart
  @version = version
  @repository = repository
  @preinstall = preinstall
  @postinstall = postinstall
end

Instance Attribute Details

#chartObject (readonly)

Returns the value of attribute chart


9
10
11
# File 'lib/gitlab/kubernetes/helm/install_command.rb', line 9

def chart
  @chart
end

#postinstallObject (readonly)

Returns the value of attribute postinstall


9
10
11
# File 'lib/gitlab/kubernetes/helm/install_command.rb', line 9

def postinstall
  @postinstall
end

#preinstallObject (readonly)

Returns the value of attribute preinstall


9
10
11
# File 'lib/gitlab/kubernetes/helm/install_command.rb', line 9

def preinstall
  @preinstall
end

#repositoryObject (readonly)

Returns the value of attribute repository


9
10
11
# File 'lib/gitlab/kubernetes/helm/install_command.rb', line 9

def repository
  @repository
end

#versionObject

Returns the value of attribute version


10
11
12
# File 'lib/gitlab/kubernetes/helm/install_command.rb', line 10

def version
  @version
end

Instance Method Details

#generate_scriptObject


21
22
23
24
25
26
27
28
29
30
# File 'lib/gitlab/kubernetes/helm/install_command.rb', line 21

def generate_script
  super + [
    init_command,
    repository_command,
    repository_update_command,
    preinstall,
    install_command,
    postinstall
  ].compact.join("\n")
end