Class: Jenkins2::CLI::CreateCredentialsDomainByXml

Inherits:
Jenkins2::CLI
  • Object
show all
Defined in:
lib/jenkins2/cli/credentials.rb

Instance Attribute Summary

Attributes inherited from Jenkins2::CLI

#errors, #options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Jenkins2::CLI

#call, class_to_command, #initialize, #parse, subcommands

Constructor Details

This class inherits a constructor from Jenkins2::CLI

Class Method Details

.descriptionObject



30
31
32
# File 'lib/jenkins2/cli/credentials.rb', line 30

def self.description
	'Create credential domain by reading stdin as an XML configuration.'
end

Instance Method Details

#add_optionsObject



34
35
36
37
38
39
# File 'lib/jenkins2/cli/credentials.rb', line 34

def add_options
	parser.separator 'Mandatory arguments:'
	parser.on '--store STORE', 'Store id. (e.g. "system")' do |s|
		options[:store] = s
	end
end

#mandatory_argumentsObject



41
42
43
# File 'lib/jenkins2/cli/credentials.rb', line 41

def mandatory_arguments
	super + %i[store]
end

#runObject



45
46
47
# File 'lib/jenkins2/cli/credentials.rb', line 45

def run
	jc.credentials.store(options[:store]).create_domain($stdin.read)
end