Class: Commands::Promote
- Inherits:
-
Object
- Object
- Commands::Promote
- Defined in:
- lib/commands/promote.rb
Instance Method Summary collapse
-
#options ⇒ Object
holds the options that were passed you can set any initial defaults here.
- #register(opts, global_options) ⇒ Object
-
#required_options ⇒ Object
required options.
- #run(global_options) ⇒ Object
Instance Method Details
#options ⇒ Object
holds the options that were passed you can set any initial defaults here
13 14 15 16 |
# File 'lib/commands/promote.rb', line 13 def @options ||= { } end |
#register(opts, global_options) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/commands/promote.rb', line 32 def register(opts, ) opts. = "Usage: promote" opts.description = "Used to promote a build to Mobile JIRA." opts.on('-n', "--product-name name", "Required") do |v| [:product_name] = v end opts.on('-b', "--bundle-indentifer Bundle Identitifer", "Required") do |v| [:bundleid] = v end opts.on('-p', "--product-key key", "Required") do |v| [:product_key] = v end opts.on('-d', "--device deviceType", "Required") do |v| [:device] = v end opts.on('-w', "--wiki-key wiki key", "Required") do |v| [:wiki_key] = v end opts.on('-v', "--version version", "Required") do |v| [:version] = v end opts.on('-w', "--working-directory Path to source directory", "Required") do |v| [:working_directory] = v end opts.on('-f', "--fix-versions version", "Required") do |v| [:fix_versions] = v end opts.on('-u', "--usenew", "") do |v| [:usenew] = true end opts.on('-c', "--usecli", "") do |v| [:usecli] = true end end |
#required_options ⇒ Object
required options
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/commands/promote.rb', line 19 def @required_options ||= Set.new [ :bundleid, :product_key, :product_name, :device, :wiki_key, :version, :working_directory, :fix_versions, ] end |
#run(global_options) ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/commands/promote.rb', line 68 def run() bundleid = [:bundleid] product_key = [:product_key] product_name = [:product_name] device = [:device] wiki_key = [:wiki_key] version = [:version] working_directory = [:working_directory] fix_versions = [:fix_versions] usenew = !![:usenew] ? "-usenew" : "" usecli = !![:usecli] ? "-usecli" : "" config_repo_url = EcbSharedLib.prepare_config_repo(nil) scriptsPath = EcbSharedLib.path_to_scripts(config_repo_url) cmd = "./masterpromote.sh --bundleID #{bundleid} --projectKey #{product_key} --productName #{product_name} --device #{device} --wikiKey #{wiki_key} --version #{version} --wkdir #{working_directory} --fixversions #{fix_versions} #{usenew} #{usecli}" EcbSharedLib::CL.do_cmd(cmd, scriptsPath) end |