Class: Jenkins2::CLI::DeleteCredentials
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
51
52
53
|
# File 'lib/jenkins2/cli/credentials.rb', line 51
def self.description
'Delete credentials.'
end
|
Instance Method Details
#add_options ⇒ Object
55
56
57
58
59
60
61
62
63
64
65
66
|
# File 'lib/jenkins2/cli/credentials.rb', line 55
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
parser.on '--credential ID', 'Credential id.' do |c|
options[:credential] = c
end
end
|
#mandatory_arguments ⇒ Object
68
69
70
|
# File 'lib/jenkins2/cli/credentials.rb', line 68
def mandatory_arguments
super + %i[store domain credential]
end
|
#run ⇒ Object
72
73
74
75
|
# File 'lib/jenkins2/cli/credentials.rb', line 72
def run
jc.credentials.store(options[:store]).domain(options[:domain]).
credential(options[:credential]).delete
end
|