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 ||= { } end |
#register(opts, global_options) ⇒ Object
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 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/commands/promote.rb', line 34 def register(opts, ) opts. = "Usage: promote" opts.description = "Used to promote a build to Mobile JIRA." =begin opts.on('-c', "--config name", "Required - Name of the config we are building from.") do |v| options[:config] = v end =end 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('-k', "--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('-s', "--srcdir source directory", "Required") do |v| [:srcdir] = v end opts.on('-u', "--usenew", "") do |v| [:usenew] = true end opts.on('-l', "--usecli", "") do |v| [:usecli] = true end end |
#required_options ⇒ Object
required options
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/commands/promote.rb', line 19 def ||= Set.new [ #:config :bundleid, :product_key, :product_name, :device, :wiki_key, :version, :working_directory, :fix_versions, :srcdir, ] end |
#run(global_options) ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/commands/promote.rb', line 79 def run() =begin config_name = options[:config] config_repo_url = EcbSharedLib.prepare_config_repo(config_repo) info = EcbSharedLib.read_repo_config(config_repo_url, config_name) bundleid = info[:bundleid] product_key = info[:product_key] product_name = info[:product_name] device = info[:device] wiki_key = info[:wiki_key] =end bundleid = [:bundleid] product_key = [:product_key] product_name = [:product_name] device = [:device] wiki_key = [:wiki_key] version = [:version] srcdir = [:srcdir] 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} \ --srcdir #{srcdir} --version #{version} --wkdir #{working_directory} \ --fixversions #{fix_versions} #{usenew} #{usecli}" EcbSharedLib::CL.do_cmd(cmd, scriptsPath) end |