Class: KubeDeployTools::Push::Optparser::PushOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/kube_deploy_tools/push/options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePushOptions

Returns a new instance of PushOptions.



11
12
13
14
15
# File 'lib/kube_deploy_tools/push/options.rb', line 11

def initialize
  self.local_prefix = 'local-registry'
  self.registries = Set.new
  self.tag = KubeDeployTools::tag_from_local_env
end

Instance Attribute Details

#imagesObject

Returns the value of attribute images.



9
10
11
# File 'lib/kube_deploy_tools/push/options.rb', line 9

def images
  @images
end

#local_prefixObject

Returns the value of attribute local_prefix.



9
10
11
# File 'lib/kube_deploy_tools/push/options.rb', line 9

def local_prefix
  @local_prefix
end

#manifest_fileObject

Returns the value of attribute manifest_file.



9
10
11
# File 'lib/kube_deploy_tools/push/options.rb', line 9

def manifest_file
  @manifest_file
end

#registriesObject

Returns the value of attribute registries.



9
10
11
# File 'lib/kube_deploy_tools/push/options.rb', line 9

def registries
  @registries
end

#tagObject

Returns the value of attribute tag.



9
10
11
# File 'lib/kube_deploy_tools/push/options.rb', line 9

def tag
  @tag
end

Instance Method Details

#define_options(parser) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/kube_deploy_tools/push/options.rb', line 17

def define_options(parser)
  parser.on('-lPREFIX', '--local-prefix PREFIX', 'The local Docker prefix to strip to get to the base image name') do |f|
    self.local_prefix = f
  end

  parser.on('-tTAG', '--tag TAG', 'Tag Docker images with TAG') do |t|
    self.tag = t
  end

  parser.on('-mMANIFEST', '--manifest MANIFEST', 'The configuration MANIFEST to render deploys with.') do |f|
    self.manifest_file = f
  end

  parser.on('-rPREFIX', '--registry REGISTRY', 'The remote Docker registry to push to (can specify multiple times). If not specified, then will push to all registries in config.') do |r|
    self.registries.add r
  end
end