Class: Jenkins2::CLI::CreateCredentialsByXml
Instance Attribute Summary
#errors, #options
Class Method Summary
collapse
Instance Method Summary
collapse
#call, class_to_command, #initialize, #parse, subcommands
Constructor Details
This class inherits a constructor from Jenkins2::CLI
Class Method Details
.description ⇒ Object
6
7
8
|
# File 'lib/jenkins2/cli/credentials.rb', line 6
def self.description
'Create credential by reading stdin as an XML configuration.'
end
|
Instance Method Details
#add_options ⇒ Object
10
11
12
13
14
15
16
17
18
|
# File 'lib/jenkins2/cli/credentials.rb', line 10
def add_options
parser.separator 'Mandatory arguments:'
parser.on '--store STORE', 'Store id. (e.g. "system")' do |s|
options[:store] = s
end
parser.on '--domain DOMAIN', 'Domain id. (e.g. "_")' do |d|
options[:domain] = d
end
end
|
#mandatory_arguments ⇒ Object
20
21
22
|
# File 'lib/jenkins2/cli/credentials.rb', line 20
def mandatory_arguments
super + %i[store domain]
end
|
#run ⇒ Object
24
25
26
|
# File 'lib/jenkins2/cli/credentials.rb', line 24
def run
jc.credentials.store(options[:store]).domain(options[:domain]).create($stdin.read)
end
|